Documentation for the Backend Subsystem

📘 Backend FastAPI – Modular Architecture + Automatic Tests

This project is a fully modular backend built with FastAPI, organized into:

  • models/ → Pydantic models
  • services/ → Functions and logic
  • api/ → FastAPI routers/endpoints
  • tests/ → Automated pytest tests
  • run.ps1 → script that runs tests before launching the backend

This README explains:

  • how to run the backend (with and without tests)

🚀 Running the Backend

✅ First create a virtual environment and install dependencies

python -m venv env 
.\env\Scripts\activate
pip install -r requirements.txt

✅ Run the backend WITHOUT tests

uvicorn app.main:app --reload

✅ Run the backend WITH tests

.\\run.ps1

✅ Run ONLY the tests

pytest

Documentation for the Frontend Subsystem

This is a React - Next.js frontend.

How to run the project

Development

While developing the project, you can run the project in development mode. To do so, you need to run the following command:

npm run dev

All changes made in the code will be automatically updated in the browser, which will be opened in the following url: http://localhost:3000

Production

To run the project in production mode, you need to run the following command:

npm run build

and then

npm run start

The 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

Dockerfile

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.1

Where 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.