API of the Memora project using FastAPI. The frontend app can be found here: Memora frontend.
ESIEE Paris - 2024 - 4th year project
Memora is a memory training mobile app designed for Alzheimer’s patients. It uses Spaced Retrieval Training (SRT, based on the Leitner system) to help exercise the brain with memories uploaded by relatives.
Contributors: Luca PALAYSI, Tilad CHRAITEH, Paul MALLARD, Damien PHILIPPE
Docker: Using Docker (recommended)
OR
See Installation without Docker below.
-
Make sure you have a docker engine such as Docker Desktop installed and running.
-
Clone the repository
git clone https://github.com/Daminoup88/Memora-backend.git- Navigate to the project directory
cd Memora-backend- Create a
.envfile from the example one:
On Linux/Mac:
cp .env.example .envOn Windows:
copy .env.example .env- IMPORTANT: Edit the
.envfile and set strong secrets (especially POSTGRES_PASSWORD and TOKEN_SECRET_KEY). You can generate a secure secret key using Python:
python -c "import secrets; print(secrets.token_hex(32))"-
You can add the LLM features by setting LLM_ENABLED to True.
-
Build and start:
- In PRODUCTION:
docker compose up -d --buildor, with the legacy docker-compose executable:
docker-compose -f compose.yaml up -d --build- For DEVELOPMENT:
docker compose -f compose-dev.yaml up -d --buildor, with the legacy docker-compose executable:
docker-compose -f compose-dev.yaml up -d --build- Clone the repository
git clone https://github.com/Daminoup88/Memora-backend.git- Navigate to the project directory
cd Memora-backend- Setup a virtual environment
python -m venv .venv- Activate the virtual environment
.venv\Scripts\activate- Install the dependencies
pip install -r requirements.txt- Create a
.envfile from the example one:
cp .env.example .env- IMPORTANT: Edit the
.envfile and set strong secrets (especially POSTGRES_PASSWORD and TOKEN_SECRET_KEY). You can generate a secure secret key using Python:
python -c "import secrets; print(secrets.token_hex(32))"-
If you have Ollama installed You can add the LLM features by setting LLM_ENABLED to True.
-
Run the server
fastapi run --reload --host 0.0.0.0 --port 8000The API documentation is available at http://localhost:8000/docs. To access the API from another device on the same network, replace localhost with the IP address of the host machine. Make sure the port is open and accessible to other devices.
To run the tests and coverage, use the following command in the root directory:
pytest --cov=app --cov-report=html