API du projet MemoryMap
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Alix JEUDI--LEMOINE d50b25fb26
continuous-integration/drone/push Build is passing Details
Added an optional field for push subscriptions in the user model.
24 hours ago
app Added an optional field for push subscriptions in the user model. 24 hours ago
docker Added libmagic download in Dockerfile 1 month ago
images Updated stub, added JSON files for images and pins, as well as a function to import real data (+photos) from these files. 2 weeks ago
tests Updated test dependencies: added pywebpush library for push notifications. 2 days ago
.coveragerc Ignore stub for coverage 1 month ago
.drone.yml Added VAPID private key in the CI/CD configuration for push notifications. 2 days ago
.gitignore Initial commit 9 months ago
DockerCommand.txt 📝 Add command to launch MongoDB container w/ Docker 7 months ago
README.md 🚑 CI/CD down (containers deleted by admin) 1 week ago
memorymap.images.json Updated stub, added JSON files for images and pins, as well as a function to import real data (+photos) from these files. 2 weeks ago
memorymap.pins.json Updated stub, added JSON files for images and pins, as well as a function to import real data (+photos) from these files. 2 weeks ago
pytest.ini 🚧 Try omit stub from coverage 2 days ago
requirements.txt Added pywebpush dependency 2 days ago

README.md

REST API - MemoryMap

Build Status

Quality Gate Status Bugs Code Smells Coverage
Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating
Security Rating Technical Debt Vulnerabilities

Made with FastAPI (Python)

Documentation

You can find the official documentation for the project at https://api.memorymap.fr/docs (or https://api.memorymap.fr/redoc)

How to run it

If you want to try the API on the production environment, please look at the documentation

Prerequisites

  • Docker

Running the Application

  1. Clone the repository:

    git clone https://codefirst.iut.uca.fr/git/SAE3A_MemoryMap/api.git
    cd api
    
  2. Create a .env file: Create a .env file in the root directory of your project and add the following environment variables:

    MONGODB_URL=mongodb://localhost:27017/
    MONGODB_USERNAME=mongoadmin
    MONGODB_PASSWORD=secret
    MONGODB_DATABASE=memorymap
    JWT_SECRET_KEY=your_jwt_secret_key
    JWT_ALGORITHM=HS256
    JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30
    
  3. Build the docker image for the API:

    docker build -t memorymap_api -f docker/Dockerfile .
    
  4. Run the MongoDB container:

    docker run -d -p 27017:27017 --name mongodb -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo:8.0.3-noble
    
  5. Run the API container:

    docker run -d -p 8000:8000 --name memorymap_api --env-file .env memorymap_api
    
  6. Access the API: The API will be available at http://localhost:8000 and the documentation at http://localhost:8000/docs (or http://localhost:8000/redoc)

Running Tests

  1. Install test dependencies:

    pip install -r tests/requirements.txt
    
  2. Run the MongoDB container: ⚠ Do not change USERNAME / PASSWORD values

    docker run -d -p 27017:27017 --name mongodb -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo:8.0.3-noble
    
  3. Run the tests:

    pytest