Environments - BOD-Tech-Trend-Emporium/Backend GitHub Wiki
Overview
The project has three environments: Local, Development, and Production. Each environment has its own purpose and is isolated from the others.
Local environment
The goal of this environment is to allow each programmer to run the project on their own machine, enabling them to see the different changes they make. This environment requires prior configuration.
The API runs on port 8082, and Swagger is available at http://localhost:8082/swagger/index.html. If you want to try the API, we recommend consulting the Postman documentation.
Development environment
The goal of this environment is to upload all changes from the features that are developed. It includes CI/CD pipelines, where features can only be merged into the development branch if the tests pass successfully, allowing for deployment on Azure.
In this environment, programmers and users do not need to worry about setting up a database or running API containers, as the CI/CD process is fully automated. The machine hosts a development database container that stores all data, and the API runs continuously.
The CI process runs tests, measures code coverage, builds the image, and sends an email about the status. The CD process stops the API container, downloads the latest images from Docker Hub, removes outdated images, runs the new container, and sends an email about the status. You can view the results of this pipeline through GitHub Actions.
As mentioned, the API has different image versions saved on Docker Hub under the name oswe/tech-trend-emporium-api-develop.
The development environment has its own Swagger interface for viewing all endpoints. You can access it at http://20.57.126.5:8081/swagger/index.html. The URL for making requests in development is http://20.57.126.5:8081/. We recommend checking Postman for examples of requests using this URL.
Production environment
The goal of this environment is to upload all changes from the release branch that have been developed in the development branch. It includes CI/CD pipelines, where the release branch can only be merged into the production branch if the tests pass successfully, facilitating deployment on Azure. The machine hosts a production database container that stores all data, and the production API runs continuously.
The production CI process executes tests, measures code coverage, builds the production image, and sends an email with the status. The production CD process stops the API container, downloads the latest images from Docker Hub, removes obsolete images, runs the new container, and also sends an email regarding the status. You can view the results of this pipeline through GitHub Actions.
As mentioned, the production API has different image versions saved on Docker Hub under the name oswe/tech-trend-emporium-api-prod .
The production environment does not include a Swagger interface, as it would create an additional entry point that could be targeted by potential attacks. The URL for making requests in this environment is http://20.57.126.5:8080/. We recommend checking Postman for examples of requests using this URL