Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

8 changed files with 125 additions and 10 deletions

27
.dockerignore Normal file
View File

@ -0,0 +1,27 @@
# Ignore node_modules and other generated files in boxes-fe
boxes-fe/node_modules
boxes-fe/build
# Ignore Go module cache and other generated files in boxes-api
boxes-api/vendor
boxes-api/bin
# Ignore IDE and editor configuration files
.vscode
.idea
# Ignore Git and other version control system files
.git
.gitignore
.cache
# Ignore Docker's own files
.dockerignore
Dockerfile.build
Dockerfile.create
Dockerfile.update
# Ignore other miscellaneous files
README.md
LICENSE
test.bash

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "boxes-fe"]
path = boxes-fe
url = git@gitea.r8z.us:stwhite/boxes-fe.git
[submodule "boxes-api"]
path = boxes-api
url = git@gitea.r8z.us:stwhite/boxes-api.git

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# Build React frontend
# Stage 1: Install dependencies
FROM node:14 AS fe-builder
WORKDIR /app
# Copy package.json and package-lock.json first to leverage caching
COPY boxes-fe/package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of your application code
COPY boxes-fe/.env .
COPY boxes-fe/. .
# Build the application
RUN npm run build
# next stage
FROM golang:latest
WORKDIR /app
COPY boxes-api/go.mod ./
COPY boxes-api/go.sum ./
#RUN --mount=type=cache,target="./.cache/go-mod" go mod download
RUN go mod download
COPY boxes-api/. ./
ENV CGO_ENABLED=1
#ENV GOCACHE=./.cache/go-build
#RUN --mount=type=cache,target="./.cache/go-build" go build -o boxes-api .
RUN go build -o boxes-api .
COPY --from=fe-builder /app/build /app/build
EXPOSE 8080
CMD ["/app/boxes-api"]

View File

@ -1,9 +0,0 @@
MIT License
Copyright (c) 2024 stwhite
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,2 +1,48 @@
# Boxes-App
# Boxes Project
This repository contains two main components:
1. boxes-api: The backend API
2. boxes-fe: The frontend application
## Getting Started
### Prerequisites
- Docker
- Docker Compose
### Configuration
Before running the project, you need to configure the API:
1. Navigate to the `boxes-api/config/` directory.
2. Open the `config.yaml` file.
3. Modify the configuration settings as needed for your environment.
### Running the Project
To start both the API and frontend services:
1. Open a terminal in the root directory of this repository.
2. Run the following command:
```
docker-compose up --build
```
This command will build the Docker images (if needed) and start the containers.
3. Wait for the services to start up. You should see logs from both the API and frontend in the terminal.
4. Once everything is running, you can access the application through your web browser.
## Additional Information
For more detailed information about each component, please refer to the individual README files in the `boxes-api` and `boxes-fe` directories.
## Troubleshooting
If you encounter any issues, please check the following:
- Ensure all required ports are available and not in use by other applications.
- Verify that the `config.yaml` file is properly configured.
- Check the Docker logs for any error messages.

1
boxes-api Submodule

@ -0,0 +1 @@
Subproject commit 4d9d722940ad0f14684ed236129e498f6755edb7

1
boxes-fe Submodule

@ -0,0 +1 @@
Subproject commit bd32bfaae5dcb9931633b3c2e290a1285f5aa244

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3.3'
services:
boxes-api:
environment:
- BOXES_API_CONFIG=/app/config/config.yaml
build: .
ports:
- "8080:8080"
volumes:
- ./boxes-api/images:/app/images
- ./boxes-api/config:/app/config
- ./boxes-api/data:/app/data
- ./boxes-api/build:/app/build