← 输入框|github.com|刷新
Skip to content

About

The Home of Hack Western's Web Projects

Resources

Stars

11 stars

Watchers

14 watching

Forks

Latest commit

 

History

1,093 Commits

Folders and files

Repository files navigation

hackwestern

Welcome to Hack Western :)

Pre-requisites

  • Linux, MacOS, or Windows with Windows Subsystem For Linux installed.
  • Node version 21 or higher with npm
    • We recommend using nvm to install node and npm
  • 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 cd into it.

Development Start

  1. Get a copy of the .env from a web lead.
    • generate your own NEXTAUTH_SECRETwith openssl rand -base64 32
  2. Run npm install to install dependencies using the node package manager.
  3. Run npm run db:start to start your dev Postgres database using Docker (see ./start-database.sh).
  4. Run npm run db:migrate to push the drizzle database schema changes to your dev Postgres database using drizzle.
  5. Optionally, you can run npm run db:seed to seed (some of) the database with fake data to use when testing.
  6. Run npm run dev to start the development server!
  7. Use npm run db:studio to 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.

Database migrations

Schema changes flow from your local machine to the production database via CI. The workflow for contributors is:

  1. Edit the schema files under src/server/db/.
  2. Run npx drizzle-kit generate locally to produce a new SQL migration file in ./drizzle.
  3. Commit the schema change AND the generated SQL file together in the same PR.
  4. Once the PR is merged to main, the Apply schema migrations GitHub Actions workflow (see .github/workflows/migrate.yml) runs npx drizzle-kit migrate against 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.

Technologies

If you are not familiar with the different technologies used in this project, please refer to their respective docs.

Visit our deepwiki to find out more! Ask DeepWiki

About

The Home of Hack Western's Web Projects

Resources

Stars

11 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages