This a mono repo implementing a web application made for collecting symptoms related to COVID-19. This would help:
- tracking evolution of symptoms amongst confined populations
- anticipate trafic in healthcare facilities
Collected data is meant to be open and non-identifying.
This application consists of:
- a lightweight (~80KB) react, next.js server-side-rendered frontend (see
./pages) - a single lambda endpoint to store submissions sent by users (see
./apiand./lib/db) - a Postgres instance where data will be stored (see config in
./.envand./docker-compose.yml)
yarn install
now dev
In case you only want to run the client:
next dev
docker-compose up
When instanciating this db for the first time, you should create all tables etc using
yarn run typeorm schema:sync
Requirements:
- You should have
ts-nodeinstalled globally (yarn global add ts-node).
Commands:
typeorm migration:create -n migrationName
typeorm migration:generate -n migrationName
Requirements:
- Typeorm only handles
.jsmigrations, so one needs to transpile them first:
tsc lib/db/**/*.ts --outDir build
Commands:
yarn run typeorm migration:run
now --prod
Requirements:
- you should have
dotenv-cliinstalled globally (yarn global add dotenv-cli) - you should have a
./.env.prodfile with necessary variables setup (all necessary variables are listed in./.env)
Commands:
dotenv -e .env.prod yarn run typeorm migration:run