Côme
Julien
Victor
Corentin (PO)
Axel (SM)
- The cloned project
- Docker & compose 20.20 or later
- We recommend having a Linux OS or Mac to run the project (WSL is good too)
The project is a SAE (Application and Environment Service) for the BUT 2 S4 2025.
It is a web application (for phones) that allows you to get feedback and datas from specific rooms in the university.
It is a project that uses an API to get the data and an APP to display it.
The API is built with Symfony and the APP is built with React.
Be advised that the projeect has been made by French students, the code is written in English but the comments are French.
This project is composed of a Docker stack with 4 containers:
- nginx (web server)
- api (Symfony application)
- app (React application)
- database (MariaDB database)
The web server is an NGINX server version 1.23.3
The API is a Symfony application version 6.4.19
The APP is a React application version 19.0.0
The database is a MariaDB version 10.10.2. \
To get started with the project, you need to clone the repository.
For Linux distributions, you need to change the
.env
file located in the root of the project.
To get the informations you need, you can useid
command in the terminal. \
You must then change the following variables in sae4api/.env
:
API_URL=#TO_COMPLETE#
API_USERNAME=#TO_COMPLETE#
API_USERPASS=#TO_COMPLETE#
Also change the following variables in sae4api/.env
file for the Weather API:
WEATHER_API_URL=#TO_COMPLETE#
WEATHER_API_TOKEN=#TO_COMPLETE#
And in sae4app/.env
change these variables with the same values as in the previous file:
VITE_API_URL=#TO_COMPLETE#
VITE_API_USERNAME=#TO_COMPLETE#
VITE_API_USERPASS=#TO_COMPLETE#
Note that you can contact the project manager to get the values of these variables.
Also note that theses variables are not mendatory to run the project, but they are necessary to get the real data from the APIs and access all the features. \
If its thee first time that you run the stack or if you deleted it:
docker compose up -d --build
If you already have the stack:
docker compose up -d
Get into the API container:
docker compose exec sae4api bash
Download the dependencies:
cd sae4api/
composer i
Run the migrations:
php bin/console d:m:m
Run the fixtures (answer 'yes' to the question):
php bin/console d:f:l
If you changed the variables in the .env
files, you can run the scheduler.
Run the scheduler:
php bin/console app:run-scheduler
The scheduler is a command that runs every 10 minutes to update the data in the database by fetching the APIs.
It run in the terminal indefinitely until you stop it with CTRL+C
.
Note that not changing the variables in the
.env
files will not break the project, and not running the scheduler will not break the project either but will display fake datas and some features won't be available.
After completing all the previous steps, you can access the API: http://localhost:8000/api.
After completing all the previous steps, you can access the APP: http://localhost:5173.
Note that you could use the APP on your phone, unforunately, we haven't added the feature to the GitHub repository yet.
To test the API, you can use the following commands in the terminal:
composer exec sae4api bash
We move into the API directory:
cd sae4api/
If its the first time you run the tests, you need to create the test database and run the migrations:
php bin/console doctrine:database:create --env=test
php bin/console doc:mig:mig --env=test
And then run the fixtures for the test database:
php bin/console doc:fix:load --env=test
You can now run the tests:
php bin/phpunit
To stop the project, you can use the following command:
docker compose stop
To remove the containers, you can use the following command:
docker compose down
Don't forget to remove the database volume and the images.