Richmond Centre for Disability's (RCD) platform for people with disabilities to apply for accessible parking permits (APP) in Richmond, BC. The app consists of an applicant-facing application portal and an internal user/APP management portal.
- NodeJS application powered by the NextJS framework.
- Apollo for GraphQL server and client.
- Chakra UI for building accessible and responsive frontend components.
- Prisma ORM for PostgreSQL.
- i18next for internationalization and app translations.
- Service: Amazon SES for outbound email service.
- Service: Railway for application and database deploys.
.
├── components # Project components
│ └── Layout.tsx
├── containers # State containers
├── lib # Library
│ ├── graphql # Global GraphQL setup
│ └── scripts # Scripts
├── pages # Pages
│ ├── _app.tsx
│ ├── api # API routes
│ └── index.tsx
├── prisma # Prisma ORM
│ └── schema.prisma # Prisma Schema
├── public
│ ├── assets # Assets
│ └── locales # Translations
├── tools # Tools that are not central to an app module (more frontend-heavy)
│ ├── pages # Tools for pages
│ └── components # Tools for components
# Misc individual files
├── .env.sample # Sample .env file
├── README.md
├── apollo.config.js
├── codegen.yml
├── next-env.d.ts
├── next-i18next.config.js
├── next.config.js
├── package.json
├── tsconfig.json
└── yarn.lock
- Start database
docker-compose up --build
- Run the application
yarn install
npx prisma generate
yarn dev
- Deploy prisma schema
npx prisma migrate deploy
- Reset and seed database (ensure node is v14.17.0 or else it will stall)
npx prisma migrate reset
- Verify database
docker exec -it rcd_db bash -c "psql -U postgres -d rcd"
To create a new migration (after making changes to the Prisma schema):
npx prisma migrate dev --name <migration-name> --create-only
Duplicate .env.sample
to .env
and configure environment variables.
To deploy your database schema, run:
yarn reset-db YOUR_APP_NAME
or if that doesn't work, run the steps manually:
# Drop all tables from current Heroku Postgres database
heroku pg:reset -a YOUR_APP_NAME
# Deploy schema.sql to Heroku Postgres
heroku pg:psql -a YOUR_APP_NAME -f prisma/schema.sql
# Regenerate Prisma schema and client
npx prisma db pull && npx prisma format && npx prisma generate
# Seeding the database with sample data
npx prisma db seed --preview-feature
To run the application:
# Install dependencies
yarn
# Run locally
yarn dev
After making changes to GraphQL schema, automatically generate the TypeScript types:
yarn generate-graphql-types
Railway provides deploys for every PR!
Deployment occurs automatically on push to the Main and Staging branches. Railway handles the continuous deployment of these branches.