Welcome to Hack Western :)
- Linux, MacOS, or Windows with Windows Subsystem For Linux installed.
- Node version 21 or higher with
npm- We recommend using
nvmto install node and npm
- We recommend using
- A modern browser (Chrome 108+, Edge 108+, Firefox 108+, Safari 16+, etc).
- Docker Desktop or an alternative such as colima.
- Git installed, GitHub account setup. Been added to our Hack Western GitHub organization.
- A modern text editor like VSCode or Neovim with the TypeScript LSP, Prettier and ESLint plugins installed and configured to run on save/commit.
- Have cloned this repository, and
cdinto it.
- Get a copy of the
.envfrom a web lead.- generate your own
NEXTAUTH_SECRETwithopenssl rand -base64 32
- generate your own
- Run
npm installto install dependencies using the node package manager. - Run
npm run db:startto start your dev Postgres database using Docker (see./start-database.sh). - Run
npm run db:migrateto push the drizzle database schema changes to your dev Postgres database using drizzle. - Optionally, you can run
npm run db:seedto seed (some of) the database with fake data to use when testing. - Run
npm run devto start the development server! - Use
npm run db:studioto use drizzle studio to manage your database
When making changes to the schema, first run npm run db:generate to generate the migration SQL scripts, then run npm run db:migrate to apply them. DO NOT use npx drizzle-kit push anymore.
Schema changes flow from your local machine to the production database via CI. The workflow for contributors is:
- Edit the schema files under
src/server/db/. - Run
npx drizzle-kit generatelocally to produce a new SQL migration file in./drizzle. - Commit the schema change AND the generated SQL file together in the same PR.
- Once the PR is merged to
main, theApply schema migrationsGitHub Actions workflow (see.github/workflows/migrate.yml) runsnpx drizzle-kit migrateagainst the production database to apply any pending migrations.
A separate Schema drift check workflow (.github/workflows/schema-drift.yml) runs on every PR. If you change the schema but forget step 2, the check fails with a message telling you to run npm run db:generate and commit the new file — so this mistake gets caught before merge instead of silently leaving prod out of sync.
Never apply migrations to prod manually — always go through the CI workflow so the migration history stays in sync with main.
If you are not familiar with the different technologies used in this project, please refer to their respective docs.