Skip to content

Getting Started

Rachel Fryan edited this page Jan 22, 2026 · 9 revisions

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

Detailed guide for creating and managing local databases for development. Start by pulling down the repo.

Creating a New Database

If you need to start fresh with a new database:

  1. Create the .env file. You'll need to add two secret keys to your .env file. These are not stored in the repository for security reasons.

    cp .env.example .env

Important

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

  1. Initialize the database:

    sqlite3 dev.db
  2. In the SQLite console, enable WAL mode for better concurrency:

    PRAGMA journal_mode=WAL;
    .quit
    

Installing Dependencies

After creating your database:

pnpm i

Seeding Your Database

Use one of the convenience scripts:

  • pnpm seed - Fresh database and full seed with Next.js dev server
  • pnpm seed:standalone - Seed only, faster (no dev server)
  • pnpm bootstrap - Quick setup with single admin user

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:

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 a database file is chosen and the development server is started:

  • Visit localhost:3000 to see out 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 with credentials (see seed script for list of credentials)

Next Steps

  • See Git Workflow for guidelines for commits, required signing, and collaborative development.

Clone this wiki locally