GenoRobotics-EPFL / Database

https://database-database.vercel.app
0 stars 1 forks source link

Database

Note
Python version 3.10 (or higher) is required.

Git branches

API

Getting started

Recommended
Setup a virtual environment (doc)

Authentification

The prod API authentificates requests via an API key. To enable this behaviour on the dev setup, Set in the .env file:

API_KEY="your test api key"

Database

The API supports several types of SQL databases.
The behaviour is controlled by environment variables, to that end we use a .env file on local (all following environment variables should be set in that file).

MySQL (local)

To use MySQL (only on local):

Postgres (prod)

Warning
Please don't mess with this database

This is the version used in production. To connect to the prod database:

AWS

The (large) files are stored separately on AWS S3.

Deprecated
To disable AWS (why not), set in the .env file:

AWS_DISABLED="true"

To connect to AWS:

Run (local)

Note
Once started, documentation is auto-generated and accessible at http://localhost:8000/docs

To run directly:

uvicorn app:app --app-dir src

# or
cd src
uvicorn app:app

To start via docker (need docker and docker-compose):

docker-compose up --build

Interface

Getting started

Run

Note
To verify that everything is working as expected and mostly that the app will be successfully deployed, try to create a production build of the app:

npm run build

Deployment

Railway

The postgres database and API are deployed on railway.app (dashboard).

The API is deployed via docker (see ./Dockerfile) and is set up to use the postgres database.

A Github App is set up to deploy the API on each push on the master branch.

Vercel

The interface is deployed on vercel (dashboard).

A Github App is set up to deploy the interface on each push on the master branch. A preview version of the interface will also be deployed for each branch.