Skip to content

Getting Started

rchlfryn edited this page Oct 28, 2026 · 10 revisions

Get up and running with the Avalanche Center Websites project in minutes.

Prerequisites

  • Node 24.x

  • pnpm 10.28 (the version is pinned in package.json packageManager; corepack enable picks it up)

  • sqlite3 CLI (used by the seed scripts)

  • drift - the pre-commit hook runs pnpm drift:check, which needs the drift binary on your PATH. It's a standalone binary, so pnpm install won't provide it:

    brew install fiberplane/tap/drift   # macOS / Linux

Then clone the repo.

Configuring Your Environment

Create the .env file:

cp .env.example .env

Important

Contact a member of the dev team to get required secret values (TODO: add to shared password manager).

The seed script needs a password for the seeded users. For local dev, add this to .env to use the default password localpass:

ALLOW_SIMPLE_PASSWORDS=true

Or set PAYLOAD_SEED_PASSWORD to choose your own.

Installing Dependencies

pnpm i

Seeding Your Database

The seed scripts create dev.db (in WAL mode) for you, replacing any existing one. There's no need to create the database by hand.

  • pnpm seed - Fresh database and full seed with Next.js dev server
  • pnpm seed:standalone - Seed only, faster (no dev server)

Updating the Seed Database

When you make changes to the schema or seed data:

  1. Start with your current database
  2. Make your changes and test them
  3. Have pnpm dev running
  4. Run pnpm reseed to update only the changed values
  5. Back up the database to use as your new seed reference

Setting Up Local Subdomains

To test tenant-scoped subdomains on your local machine, add the following entries to your hosts file:

  • macOS: Edit /etc/hosts
  • Windows: Edit C:\Windows\System32\drivers\etc\hosts
127.0.0.1       dvac.localhost
127.0.0.1       nwac.localhost
127.0.0.1       sac.localhost
127.0.0.1       snfac.localhost

How It Works

The application uses Next.js middleware (src/middleware.ts) to dynamically route requests from these subdomains to the appropriate tenant. Requests are rewritten based on subdomains, custom domains, or direct domain access—allowing multiple URLs to serve the same tenant-specific content.

Starting the app

Then start the development server:

pnpm dev

Access the app

Once the database is seeded and the development server is started:

  • Visit localhost:3000 to see our AvyFX homepage.
  • To see an individual avy site, include the slug in the URL SLUG.localhost:3000
  • Log in to the admin panel at localhost:3000/admin as admin@avy.com (super admin) using the seed password above. See the seed script for the full list of seeded users and roles.

If something doesn't work, check Troubleshooting.

Next Steps

  • See Git Workflow for guidelines for commits, required signing, and collaborative development.
  • See Developer Docs for architecture and coding guides.

Clone this wiki locally