Note
Python version 3.10 (or higher) is required.
-
master
Anything merged onmasterwill automatically be deployed -
stage
Thestagebranch is used to regroup potentially unfinished/tested work.
Always push/merge onstagebefore going tomaster.
Recommended
Setup a virtual environment (doc)
- Install the dependencies
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):
- Install MySQL
- Create a genorobotics database
- Set in the
.envfile: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:
- Ask for the credentials
- Set in the
.envfile:PGDATABASE="..." PGUSER="..." PGPASSWORD="..." PGHOST="..." PGPORT="..."
The (large) files are stored separately on AWS S3.
Deprecated
To disable AWS (why not), set in the.envfile:AWS_DISABLED="true"
To connect to AWS:
- Ask for the credentials
- Set in the
.envfile: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:appTo start via docker (need docker and docker-compose):
docker-compose up --build
- Install npm
- Go to
/interface:cd interface - Install the dependencies
npm i - Start by looking at the file
/interface/pages/index.tsx
- Start the development server:
npm run dev - The app is available at http://localhost:3000
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.