-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
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.
If you need to start fresh with a new database:
-
Create the
.envfile. You'll need to add two secret keys to your.envfile. 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).
-
Initialize the database:
sqlite3 dev.db
-
In the SQLite console, enable WAL mode for better concurrency:
PRAGMA journal_mode=WAL; .quit
After creating your database:
pnpm iUse 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
When you make changes to the schema or seed data:
- Start with your current database
- Make your changes and test them
- Have
pnpm devrunning - Run
pnpm reseedto update only the changed values - Back up the database to use as your new seed reference
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
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.
Then start the development server:
pnpm devOnce a database file is chosen and the development server is started:
- Visit
localhost:3000to 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/adminwith credentials (see seed script for list of credentials)
- See Git Workflow for guidelines for commits, required signing, and collaborative development.