The codebase is being roughed out, but finer details are likely to change.
- Runtime environment - NodeJS
- Programming language - Typescript
- Database - PostgreSQL
- Backend API server - NestJS
- Express
- TypeORM
- Frontend React framework - NextJS
- Formik
- Tailwind CSS
- class-validator
- Cypress
- Deployment
- GitHub Actions
- Terraform
- AWS CloudFront/S3/Lambda/RDS
| Workspace or Package | Description | README |
|---|---|---|
| apps/api | Backend NestJS API server | |
| apps/web | Frontend NextJS React app | |
| packages/common | Shared library | |
| packages/accessibility | Accessibility Test |
The Make command run-local to build and launch containers is defined in Makefile.
-
create containers
$ make run-local
-
destroy containers
$ make docker-down
Containers:
- team_based_care_db
- team_based_care_common
- team_based_care_web
- team_based_care_api
Containers are configured by Dockerfile and docker-compose.yml
Database Hostname Resolution
POSTGRES_HOSTenv is defined asdb, which is used as a service name in docker-compose.yml. Asapiuses it to connect to the database and a service name is resolved as an address only in Docker environment, you need to redefine it to resolve it on your local machine. You can set it tolocalhostif you persistently run the app in this way. Otherwise, add127.0.0.1 dbto/etc/hosts.
API Calls
NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1To make successful requests from
webtoapi, you need to setNEXT_PUBLIC_API_URLenvironment variable. It is set by default when using Docker or run bymakecommand, but if you run the application bynext startcommand inapps/webfolder, you should supply this value by creating a file named.env.localplaced inapps/web.
In order to make breakpoints work in
watchmode, setsourceMaptotruein tsconfig.json and restart the apps.