Note
Python version 3.10 (or higher) is required.
master
Anything merged on master
will automatically be deployed
stage
The stage
branch is used to regroup potentially unfinished/tested work.
Always push/merge on stage
before going to master
.
Recommended
Setup a virtual environment (doc)
pip3 install -r requirements.txt
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"
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).
To use MySQL (only on local):
Set in the .env
file:
USE_MYSQL="true"
MYSQLDATABASE="genorobotics"
MYSQLUSER="..."
MYSQLPASSWORD="..."
MYSQLHOST="localhost"
MYSQLPORT="3306"
Warning
Please don't mess with this database
This is the version used in production. To connect to the prod database:
.env
file:
PGDATABASE="..."
PGUSER="..."
PGPASSWORD="..."
PGHOST="..."
PGPORT="..."
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:
.env
file:
AWS_BUCKET_NAME="genorobotics-bucket"
AWS_REGION_NAME="eu-central-1"
AWS_ACCESS_KEY_ID="..."
AWS_SECRET_ACCESS_KEY="..."
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
:
cd interface
npm i
/interface/pages/index.tsx
npm run dev
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
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.
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.