This project is a fully modular backend built with FastAPI, organized into:
models/ → Pydantic modelsservices/ → Functions and logicapi/ → FastAPI routers/endpointstests/ → Automated pytest testsrun.ps1 → script that runs tests before launching the backendThis README explains:
python -m venv env
.\env\Scripts\activate
pip install -r requirements.txtuvicorn app.main:app --reload.\\run.ps1pytestThis is a React - Next.js frontend.
While developing the project, you can run the project in development mode. To do so, you need to run the following command:
npm run devAll changes made in the code will be automatically updated in the browser, which will be opened in the following url: http://localhost:3000
To run the project in production mode, you need to run the following command:
npm run buildand then
npm run startThe first command will generate the build of the project, and the second one will run the project in production mode. The browser will be opened in the following url: http://localhost:3000
A Dockerfile is included in the project template frontend to build a docker image. To build the image, you need to run the following command:
docker build -t maasai_frontend:0.1 .Where maasai_frontend is the name of the image and 0.1 is the tag of the image.
Then, to run the image, you need to run the following command:
docker run -p 80:3000 maasai_frontend:0.1Where we indicate the name of the image, that needs to be the same used to build it (In this case maasai_frontend). The same happens with the tag of the image. The -p flag is used to indicate the port that will be used to run the image. In this case, the port 80 will be used.