Skip to content

πŸ“š A program registration/management platform for the social diversity of children

License

Notifications You must be signed in to change notification settings

uwblueprint/social-diversity-for-children

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Social Diversity for Children Foundation

Build License: MIT active development GitHub code size in bytes

Program registration platform for Social Diversity for Children Foundation.

Currently in development!

This project was generated with superplate.

🍁 F21 Team

Project Lead: Rickson Yang
Product Manager: Emily Nairn
Designers: Rebecca Ma, Vedant Patel
Developers: Matthew Geng, Neel Ismail, Amy Li, Greg Maxin, Brandon Wong, Kevin Zhang

😎 S21 Team

Project Lead: Eric Feng
Product Manager: Raewyn Tsai
Designers: Stacy Kwok, Christina Ru
Developers: Jason Huang, Soha Khan, Cindy Wang, Brandon Wong, Victor Yun, Mahad Zaryab

πŸ”¨ Project Architecture

  1. NodeJS application powered by the Next.JS framework
  2. Prisma ORM for PostgreSQL
  3. Chakra UI for building accessible and responsive frontend components
  4. i18next for internationalization and translations, specifically next-i18next
  5. NextAuth.js for authentication
  6. Service: Amazon S3 for file storage
  7. Service: Amazon SES for email service
  8. Service: Amazon Lambda and Amazon Cloudwatch for notification mailing
  9. Service: Amazon Systems Manager for Storing one-time dynamic links
  10. Service: Stripe for Class payment and product/coupon management
  11. Service: Railway for deployment and database hosting
  12. Service: Heroku for PostgreSQL DB hosting
  13. Unstated Next for state management
  14. SWR React Hook library for data fetching

βš™ Project Structure

.
β”œβ”€β”€ .github
β”‚   β”œβ”€β”€ workflows # Github workflows
β”‚   └── pull_request_template.md # PR template
β”‚
β”œβ”€β”€ pages # Pages
β”‚   β”œβ”€β”€ _app.tsx
β”‚   β”œβ”€β”€ api # API routes
β”‚   └── index.tsx
β”‚
β”œβ”€β”€ prisma # Prisma ORM
β”‚   │── dev-seeds # seeding data for dev environment
β”‚   │── migrations # migrations for production
β”‚   │── schema.prisma # Prisma Schema
β”‚   │── schema.sql # SQL Schema
β”‚   └── seed.ts # utility to script dev environment
β”‚
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ icons # Icons
β”‚   └── locales # Translations
β”‚
β”œβ”€β”€ models # Typescript types
β”‚
β”œβ”€β”€ src # Frontend tools
β”‚   β”œβ”€β”€ components # Components
β”‚   β”œβ”€β”€ definitions # Chakra
β”‚   └── styles # CSS and Colours
β”‚
β”œβ”€β”€ terraform # Infrastructure as code for dev and prod
β”‚   β”œβ”€β”€ environments # code separated by environments
β”‚   └── modules # terraform modules for reuse
β”‚
β”œβ”€β”€ types # Dependency types
β”‚
β”œβ”€β”€ utils # Utility functions
β”‚   │── containers # unstated-next containers
β”‚   │── enum # enum utils
β”‚   │── hooks # SWR API hooks
β”‚   │── mail # SES mailing templates
β”‚   │── request # API request utils
β”‚   │── session # Session and authorization utils
β”‚   │── time # time and date utils
β”‚   │── toast # Chakra UI Toast msg utils
β”‚   └── validation # Data/Input Validators
β”‚
β”œβ”€β”€ services # Third party services
β”‚   β”œβ”€β”€ auth
β”‚   β”œβ”€β”€ aws
β”‚   β”œβ”€β”€ database
β”‚   β”œβ”€β”€ nodemailer
β”‚   └── stripe
β”‚
# Misc individual files
β”œβ”€β”€ .babelrc
β”œβ”€β”€ .eslintignore
β”œβ”€β”€ .env.sample # required env vars
β”œβ”€β”€ .gitattributes
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .prettierignore
β”œβ”€β”€ .prettierrc
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ next-i18next.config.js
β”œβ”€β”€ next-env.d.ts
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── yarn.lock

πŸ”— Local Dependencies

  1. Heroku Client
  2. NPM
  3. Yarn

πŸ’» Run Locally

Reset your database on Heroku and then deploy your database schema run (one-time):

# 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
# optional - `npx prisma introspect`
npx prisma generate

# Seed your database with sample data
npx ts-node -O {\"module\":\"CommonJS\"} prisma/seed.ts

To run the application:

# Install dependencies
yarn

# Run locally
yarn dev

πŸ‘¨β€πŸ’» Development

Linters run automatically as a pre-commit hook on edited .js, .jsx, .ts, .tsx files you edit and commit

To run the linters manually:

# Runs linting
yarn lint

# Correct  linting issues
yarn fix

✈️ Migration

NOTE: Before applying your migrations a production environment, ensure the diff via npx prisma db pull and npx prisma migrate status lines up with the migrations to be applied.

To migrate a database schema without losing data:

  1. change both the schema.sql and schema.prisma file as required
  2. run prisma migrate dev --name <DESCRIPTIVE_NAME> --create-only (this will require a shadow database)
  3. after the migration is approved, run npx prisma migrate deploy to apply all new migrations

Baseline environment:

Baselining initializes a migration history for databases that contain data and cannot be reset - such as the production database. Baselining tells Prisma Migrate to assume that one or more migrations have already been applied. Run the following command to baseline for each of the required migration: prisma migrate resolve --applied <MIGRATION_FOLDER_NAME>

For more info, please reference: Adding Prisma Migrate to an existing project

🚒 Deployment

Deployments occur automatically on push to main and staging branches through Railway.

πŸ“ License

MIT

About

πŸ“š A program registration/management platform for the social diversity of children

Resources

License

Stars

Watchers

Forks

Languages