The Virtual Washington ARTCC Website.
This README is updated to reflect the current repository layout, Docker Compose usage, published container images, and the recommended local development steps.
Quick overview
- The project publishes Docker images to GitHub Container Registry (GHCR). The main image tag used by the repository is
ghcr.io/vzdc-artcc/website:master-latestand an updater imageghcr.io/vzdc-artcc/website_updater:master-latest. - The included
docker-compose.yamluses those GHCR images by default so you can run the site with minimal setup.
Requirements
- Node 18+ (for local development)
- Docker & Docker Compose (for containerized runs)
- A Postgres-compatible database (used by the containers or locally)
- VATSIM Connect credentials (for authentication)
Environment variables
There are two main environment patterns used in this repo:
stack.env(or a file you supply to Docker Compose) — the compose file reads environment variables from a file calledstack.envby default..env.example— a template of environment variables required for local development. Copy it to.env.localor tostack.envand fill values..env.public— holds frontend-public environment variables (for exampleNEXT_PUBLIC_DONATION_URL). This file is committed for convenience (it currently contains the donation URL) but you can override it in your deployment.
Important variables (summary)
- DEV_MODE:
trueto disable VATUSA roster checks for development only - DATABASE_URL: Postgres connection string
- NEXTAUTH_URL: Base URL used for OAuth2 redirect (e.g.
http://localhost:3000) - NEXTAUTH_SECRET: Secret used by NextAuth; use
openssl rand -hex 32to generate - VATSIM_CLIENT_ID, VATSIM_CLIENT_SECRET: VATSIM Connect credentials
- VATUSA_FACILITY, VATUSA_API_KEY: Facility name and API key for VATUSA
- UPLOADTHING_TOKEN: file upload token (if used)
- NEXT_PUBLIC_DONATION_URL: (public) donation link — kept in
.env.public
See .env.example for a full list of variables and short descriptions.
Docker Compose (recommended for quick starts)
Why: The compose file is configured to use pre-built images from GHCR so you don't need to build locally.
What it does:
postgres: runs a Postgres container using credentials from your environment filemigrations_website: runsnpx prisma migrate deployusing the same image to apply migrationswebsite: the website container (imageghcr.io/vzdc-artcc/website:master-latest)website_updater: optional updater service (imageghcr.io/vzdc-artcc/website_updater:master-latest)
Default ports and notes:
- By default
docker-compose.yamlmaps host3001to container3000for the website service. If you expecthttp://localhost:3000, be aware compose maps to3001in the provided file.
Quick-start with Docker Compose
-
Copy
.env.exampletostack.env(or create astack.envfile) and fill required variables. Do NOT expose production credentials publicly. -
(Optional) Edit
stack.envto match your environment. EnsureDATABASE_URLpoints to the Postgres container (if you want the containers to talk to each other use the default compose network and service namepostgres). -
Run Docker Compose from the repository root:
# starts containers, pulling images from GHCR if not present locally
docker compose up- The compose
migrations_websiteservice will apply Prisma migrations automatically. After the app is running, seed the database:
- Open a browser and visit:
http://localhost:3001/api/seed
Local development (when you want to run Next.js locally)
- Install dependencies:
# prefer pnpm if you use it; npm also works
pnpm install
# or
npm install- Create a local environment file from the example and fill values:
cp .env.example .env.local
# edit .env.local and set at minimum: DATABASE_URL, NEXTAUTH_URL, NEXTAUTH_SECRET, VATSIM_CLIENT_ID, VATSIM_CLIENT_SECRET- Run local database/migrations (if using local Postgres):
npm run db:deploy
npx prisma generate- Run the dev server:
npm run dev
# or
pnpm dev- Seed local DB once the server is up by visiting
http://localhost:3000/api/seed.
Notes on building images locally
- The project uses GHCR-published images by default. If you want to build the website image locally and run it with Docker Compose, either:
- Build and tag the image with the same name (
ghcr.io/vzdc-artcc/website:master-latest) and push to your registry (requires auth), or - Edit
docker-compose.yamlto usebuild: .for thewebsiteservice or change theimage:towebsiteafterdocker build -t website ..
- Build and tag the image with the same name (
Example local-build flow:
# build locally and run directly
docker build -t website .
# run with env file
docker run -p 80:80 --env-file stack.env websiteProduction
- The repository publishes images to GHCR;
docker compose upwith the provideddocker-compose.yamlwill pull those images. - Ensure environment variables on the production host are configured correctly. Make sure
NEXTAUTH_URLpoints to your production domain and the corresponding VATSIM redirect URI is registered.
Seeding the database
- The seed endpoint is available at
/api/seedon the running site. For a default compose setup the URL ishttp://localhost:3001/api/seed. - Run the seed endpoint after migrations have been applied.
Security notes
- Keep secrets (NEXTAUTH_SECRET, VATSIM client secret, VATUSA API key, database credentials) out of public repositories.
- Use
stack.env(or whichever file you use for Docker Compose) with appropriate filesystem permissions.
Troubleshooting
- If the site doesn't start, check container logs:
docker compose logs website-
If migrations fail, inspect the
migrations_websiteservice logs or run migrations locally withnpx prisma migrate deploy. -
If OAuth redirects fail, confirm
NEXTAUTH_URLand registered provider redirect URIs match exactly.
Development tips / extras
- If you change Prisma schema, run migrations and
npx prisma generate. - The frontend-public environment variables (prefixed with
NEXT_PUBLIC_) can be placed into.env.publicto be served to the client; this repo already includes.env.publicfor the donation URL.
Contributing
If you'd like to contribute, open a pull request against the repository. Keep changes small and include any relevant tests or instructions.
License
This project is licensed under the repository's LICENSE file.