Frontline.live is a web-based medical supplies matching platform.
General public can submit medical supplies requests at the public site (frontline.live).
Admin can approve and manage all requests at the admin site. (frontline.live/admin).
Component | Tech stack |
---|---|
Public site | React.js |
API server (for the public site) | Python |
Admin site | Plain HTML |
API server (for the admin site) | ASP.NET Core |
Deployment | Docker |
Infrastructure provisioning | Terraform |
The public site and the admin site uses different technology because we are in the midst of migrating the whole site to React.js + Python.
The admin site will be revamped into the said tech stack at a later stage.
Component | Services |
---|---|
Map | Map Box (https://www.mapbox.com/) |
CMS | Contentful (https://www.contentful.com/) |
Last mile postcode look up | Posttag (https://www.posttag.com) |
# Prepare local development settings
$ make setup
# Start servers in Docker
$ make dev
# For those who want to start development on website without Docker
#
# You can start depending services in docker
$ make -f Makefile.nodocker.mk docker-start-db
# And then run the dotnet process in local for admin portal
$ NO_DOCKER=1 MODULE=Web make dev
#
# For public-web
$ NO_DOCKER=1 PORT=3002 MODULE=public-web make dev
# For core API server
$ NO_DOCKER=1 MODULE=core make dev
After running above commands,
This setup guide assumes you are using Powershell.
Copy-Item ".\docker-compose.override.yml.template" -Destination ".\docker-compose.override.yml"
Copy-Item ".\Web\appsettings.Development.json.template" -Destination ".\Web\appsettings.Development.json"
Copy-Item ".\src\public-web\appConfig.js.template" -Destination ".\.\src\public-web\public\appConfig.js"
docker-compose -f ".\docker-compose.dev.yml" -f ".\docker-compose.override.yml" up
After running above commands,
The Makefiles only support Mac/ Linux environment. We need support to make it Powershell-friendly
$ docker-compose -f ./docker-compose.dev.yml -f ./docker-compose.override.yml run --rm core alembic revision -m 'Your message'
$ docker-compose -f ./docker-compose.dev.yml -f ./docker-compose.override.yml run --rm core alembic upgrade head
To add more environment variables, make sure you have already updated the following essential files
This project is organised in the following structure:
|-- Database (Obsoleted SQL Server database project)
|-- Shared (Shared code for admin portal)
|-- Web (Codebase for API server (for the admin site) and admin site)
|-- docs
`-- src
|-- core (Codebase for API Server (for the public site))
|-- infra (Terraform project for infrastructure provisioning and deployment)
`-- public-web (Codebase for public site)
All deployment will be run by the GitHub Action. Changes pushed to master
branch will be automatically deployed to dev
sites.
To deploy changes to production environment, you need approval from one of the maintainers of the repository.
* Should be environment specific.
Secret Name | Description |
---|---|
ARM_ACCESS_KEY | Azure Storage Account used for TF remote state. See here. |
ARM_CLIENT_ID* | |
ARM_CLIENT_SECRET* | |
ARM_SUBSCRIPTION_ID* | |
ARM_TENANT_ID* | |
ACR_USERNAME | Username for ACR's Admin Account. |
ACR_PASSWORD | Password for ACR's Admin Account. |
ACR_SERVER | The login server for ACR |
Secret Name | Description |
---|---|
APP_DATA_SUPPLIERS_SHEET* | - |
APP_EMAIL_FROMADDRESS* | - |
APP_EMAIL_SENDGRIDKEY* | - |
APP_EMAIL_SENDGRIDUSER* | - |
APP_EMAIL_TOADDRESS* | - |
APP_MAPBOX_TOKEN* | Map Token |
APP_RECAPTCHA_SECRETKEY* | - |
APP_RECAPTCHA_SITEKEY* | - |
APP_DATACONTEXT* | - |
WEB_USERSECRETSID* | - |
SQL_ADMIN_PASSWORD* | - |
CONTENTFUL_DELIVERY_ACCESS_TOKEN* | Content Delivery API - access token |
CONTENTFUL_SPACE_ID* | Contentful Space ID |
CONTENTFUL_ENVIRONMENT* | Name of Contentful environment in use |
POSTTAG_ENDPOINT* | - |
POSTTAG_ID* | - |
POSTTAG_API_KEY* | - |
Check build_and_deploy.yml. For list values, they should be JSON encoded.