Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.

RomainCtl/RecoFinement-api

Repository files navigation

RecoFinement - API service

Test&Deploy badge Tests Coverage score

Check instruction about requirements in the README.md file of the master project.

Requirements

  • PostgreSQL Server with a database with the name of your choice (Do not forget to define env variables, see next point).

Configuration

In order to run correctly, the project needs to recover its configuration. To do so, just copy the .env.default file:

cp .env.default .env

Then replace the values, and in particular the variables for the connection to the database.

Usage

Basic usage:

# Initialize project (install dependencies)
make init

# Update database to the last migration (or initialize it if it does not exist)
make db-updade

# Serve locally the development build
make serve

# Run all unit tests
make test

Display Makefile help (display all available targets):

make
# or
make help

Database versionning

During the successive phases of development, you will have to modify the database (new table, new column, ...). In order to ensure that the database is up to date at each installation, a versioning procedure of the database has been set up with the Flask-Migrate tool.

All files and scripts produced by Flask-Migrate are stored in the directory ./migrations/.

To change the database structure and create a new database migration script, follow these steps:

  1. Edit the SQLAlchemy data models in the directory ./src/model/
  2. Run the following command to generate a new database migration script:
make db-migration version="explicit_version_name"
  1. Check the contents of the generated script in the directory ./migrations/versions/<genrated-file>. Sometimes Flask-Migrate does not detect certain changes. In this case, you will have to do it manually

Contribution

Contributions are managed using github's Pull Request (PR). After cloning the master branch of the project, use the following commands to create a new branch with its associated Pull Request:

# Create a feature branch and its PR
make git-branch feat="Adds a nice feature"

# Create a bug fix branch and its PR
make git-branch fix="Fix a bug"

# Create a documentation|support branch and its PR
make git-branch doc="Adds a nice documentation or support"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages