Skip to content

Development

MeetAlias is a single Next.js app (App Router, React Server Components and server actions) in TypeScript, on Postgres. There's no ORM and no CSS framework: SQL through postgres.js and one hand-written stylesheet.

Requirements

  • Node.js 22 or newer
  • Docker (for Postgres)
  • For real Google sign-in: a development OAuth client with redirect URI http://localhost:3000/api/auth/callback (see Google setup). For real Microsoft sign-in: a development app registration with the same redirect URI (see Microsoft setup). Without either, use fake Google, which can also play a Microsoft install.

Run it locally

npm install
cp .env.example .env              # fill in; DATABASE_URL must point at the dev database
docker compose -f docker-compose.dev.yml up -d   # Postgres on 127.0.0.1:5432
npm run dev                       # applies the schema, then serves http://localhost:3000

For local use, set in .env:

DATABASE_URL=postgres://meetings:meetings@localhost:5432/meetings

and make config/brands.json contain a site with "url": "http://localhost:3000".

Without Google

Set GOOGLE_FAKE=1 in .env to swap Google for an in-memory fake. Then sign in by opening:

http://localhost:3000/api/auth/test-login?email=you@example.com

(the email must be on ALLOWED_DOMAIN). Events and emails go to the fake and disappear on restart. Fake mode refuses to run with any https:// site.

Useful commands

Command What it does
npm run dev Dev server with hot reload.
npm run lint ESLint with the Next.js and React Hooks rules.
npm test Unit and service tests (Vitest) against a real Postgres test database.
npm run e2e Browser tests (Playwright) against a production build.
npm run build Production build (.next/standalone).
npm run migrate Apply new db/migrations/*.sql to the database in .env.
npm run brand-color <logo> Suggest a site colour from a logo.
npx tsc --noEmit Type-check.

Project layout

db/migrations/           numbered SQL migrations, each applied once by db/migrate.mjs
src/
  app/                   pages, layouts, API routes and server actions (Next.js App Router)
    actions.ts           server actions for the staff area
    book-actions.ts      server actions for public booking
    ui.tsx               ListRow / AddPanel / Popover: the shared ways to show and edit things
    globals.css          all styles
    api/                 auth, health, slots, photos
    [handle]/            public booking pages
    b/[token]/           client's reschedule/cancel page
    m/[slug]/            meeting link redirect
  lib/                   everything that isn't UI: services, Google and Microsoft gateways, crypto
  instrumentation.ts     startup checks and background jobs
  proxy.ts               rate limit on meeting links, session renewal
tests/                   Vitest tests
e2e/                     Playwright tests
scripts/                 migrate, brand-color
docs/                    this documentation (MkDocs)

Screenshots

The app screenshots in docs/assets/screens/ are made by e2e/screenshots.spec.ts with demo data on the fake provider. After a UI change, run:

npm run screenshots

The Google Cloud console and Entra admin center screenshots can't be scripted. They go in docs/assets/screens/console/; each one's place is marked in google.md and microsoft.md with a <!-- screenshot to add: … --> comment saying what it shows. Blur client IDs, tenant IDs and secrets before you add one.

Continue with Architecture, Testing and Contributing.