Group course project of a self service and kitchen management system for a fictional fast food restaurant.
Old README.md
Requirements: Local Kubernetes cluster, kubectl
- Clone and navigate to this repository:
git clone https://github.com/g-otn/soat-tech-challenge.git
cd soat-tech-challenge/
-
Make sure:
- Port
30000
is available. - Kubernetes cluster is running.
- Port
-
Apply configuration files in the
kubernetes
folder:
kubectl apply -f kubernetes/
This will create the fiap-grupo-63
namespace and all the
objects required to run the workload inside it.
- If you're using minikube, you need to forward the backend service using
minikube service
:
minikube service soat-tech-challenge-backend-service -n fiap-grupo-63
It'll automatically open a browser window with the proper URL.
- If you're using Docker Desktop's Kubernetes you can access http://localhost:30000/ or http://localhost:30000/swagger-ui/index.html to access a live OpenAPI spec of the available endpoints.
Requirements: Docker, Docker Compose, Java 17
- Open the Spring Boot Maven project in the
techchallenge/
folder with your IDE. - By default it'll:
- Use the
dev
Maven profile, which sets the Spring boot profile todev
, which enables thespring-boot-docker-compose
integration. spring-boot-docker-compose
will use the compose file attechchallenge/compose-dev.yaml
to start a dev database, executing the scripts indb
folder.
- Use the
- Start the project, no environment variables are required.
- Access http://localhost:8080 to open the Open API live docs (Swagger UI).
- With your IDE, change the Maven profile to
prod
. (seeapplication-prod.yml
)- Check if
dev
profile is not enabled at the same time (!dev
) - If
dev
is enabled in some way, the application will try to use thecompose-dev.yaml
. (We don't want a container to try to create containers, We want the app to simply directly connect to the db instead)
- Check if
- Execute the Maven lifecycle commands to generate the final .jar file, in this order:
clean
,compile
and thenpackage
- A .jar file should be created in the
target/
folder. Example:target/techchallenge-fase-1.jar
- Execute the build command in the
techchallenge/
folder, where theDockerfile
is located to create a local image:docker buildx build -t g0tn/soat-tech-challenge-backend:<tag> .
- Replace
<tag>
for something likefase-1
- Apply the
latest
tag to the image too:docker tag g0tn/soat-tech-challenge-backend:<tag> g0tn/soat-tech-challenge-backend:latest
- This tag is important so the correct version is downloaded from Docker Hub by
docker-compose.yml
- Pushing the image to Docker Hub:
docker push g0tn/soat-tech-challenge-backend:latest
docker push g0tn/soat-tech-challenge-backend:<tag>
Execute the steps in "Executing (for teachers)" at the beginning of this doc.
kubectl create configmap db-config --from-file=db/
docker run --rm -v kubernetes/:/dir stackrox/kube-linter lint /di
Requirements: Docker, Docker Compose
- Make sure port
80
is available. - With a copy of this repo (the
db
folder has some required SQL scripts), execute Docker Compose:
docker compose up
# or
docker-compose up
- Access http://localhost/ or http://localhost/swagger-ui/index.html to access a live OpenAPI spec of the available endpoints.
- Course project group members: g-otn, HenriqueZaim, marcelovbcfilho, thgosii.
- Course teachers