Skip to Content
suntzu rcdocs
Guides

Run it locally

The whole platform (site, API, database, events engine) on your own computer in about ten minutes. You don't need an AWS, Cloudflare or Google account: locally, emails are printed instead of sent and the paid services are simply off.

What you need

ToolVersionHow to get it
Node.js24nodejs.org, or nvm install 24 (the repository's .nvmrc says 24, so nvm use picks it)
pnpm12corepack enable pnpm (comes with Node). Never npm or yarn: the project is pnpm only
DockeranyDocker Desktop on macOS and Windows, Docker Engine on Linux. It runs the local database
Gitanygit-scm.com

On Windows, use WSL 2 (Ubuntu) and run everything inside it.

Steps

git clone https://github.com/akamachinecode/suntzu-rc-platform.git
cd suntzu-rc-platform
pnpm install

Start the database (PostgreSQL in Docker) and create its tables:

pnpm db:up && pnpm db:migrate

Copy the example settings. They work as they are:

cp apps/api/.env.example apps/api/.env && cp apps/app/.env.example apps/app/.env

Load the data, the same way production starts:

pnpm db:seed && pnpm census && pnpm engine
  • db:seed: the hand-checked events, places, clubs and the sources the engine reads.
  • census: the FAA's fields, airports and airspace for Florida, and the Census ZIP codes (about eight downloads from public registers).
  • engine: reads every active source on the real web, politely (robots.txt, two seconds between requests to the same site). It takes a few minutes.

Start everything:

pnpm dev

Things to try

  • Sign in at http://localhost:3000/sign-in with any email. The email isn't sent: the link and the 6-digit code appear in the terminal where pnpm dev runs, in the API's output.
  • Open the crew console: put your email in CREW_EMAILS in apps/api/.env, restart pnpm dev, sign in again and open http://localhost:3000/crew. Events the engine wasn't sure about wait there for a person.
  • Search with ⌘K or Ctrl+K on any page, and check "Can I fly here?" at http://localhost:3000/places/can-i-fly-here.
  • Send the alerts: pnpm notify prints the change alerts it would email (pnpm notify digest for the weekly digest).

Before a pull request

pnpm check

It runs formatting, lint, types, the bits check (every piece of behaviour in docs/bits/ has a test), unit tests and a full build. pnpm test:e2e runs the end-to-end tests, one per bit, against production builds and a database of their own (stop pnpm dev first: they use the same ports). pnpm format fixes the formatting by itself. CI also checks every public page for accessibility in four browsers; with pnpm dev running, pnpm test:a11y does the same in Chromium and a phone (the first time, pnpm --filter @workspace/app exec playwright install chromium). Then follow Your first contribution.

When something goes wrong

What you seeWhat to do
pnpm db:up fails, or "connection refused" on 5432Docker isn't running: start Docker Desktop (or sudo systemctl start docker) and try again
Port 5432 is already in useAnother PostgreSQL is running. Use DB_PORT=5433 pnpm db:up and change the port in DATABASE_URL in apps/api/.env
Port 3000, 3001 or 3002 is in useSomething else is on it: stop it, or run only what you need (pnpm dev:app, pnpm dev:api, pnpm dev:docs)
pnpm install refuses a package versionThe project only installs versions published at least a day ago, on purpose (pnpm-workspace.yaml). Wait, or pick the previous version
The engine reports errors for some sourcesNormal: a site can be down or block robots. Each source's result is in the report; one failing doesn't stop the others
The site shows no eventsRun pnpm db:seed && pnpm engine again, and check the API is running on :3001
You want to start overpnpm db:down, then docker volume rm the db-data volume (docker volume ls shows its full name), and repeat from pnpm db:up

Still stuck? Ask in Discussions with what you ran and what you saw.

On this page