Getting started
Prerequisites
- Node.js 20+
- A Postgres database (Neon works locally too — grab a free branch, or use a local
pginstance)
1. Clone and install
2. Environment variables
Copy the example and fill in the values:
| Variable | Description |
|---|---|
DATABASE_URI |
Postgres connection string, e.g. postgresql://user:pass@host/db |
PAYLOAD_SECRET |
Any long random string — used to sign Payload sessions |
NEXT_PUBLIC_VAPID_PUBLIC_KEY |
VAPID public key for Web Push |
VAPID_PRIVATE_KEY |
VAPID private key |
VAPID_SUBJECT |
mailto:you@example.com |
Generate VAPID keys (one-time)
Copy the output into .env.local.
Note
There is no .env.example committed yet. The variables above are the full list — create the file manually.
3. Run the dev server
App runs at http://localhost:3000. Payload admin at http://localhost:3000/admin.
First-time admin setup
On first run, Payload will prompt you to create an admin user at /admin/create-first-user.
4. Run tests
14 tests across lib/auth.ts, lib/mystery-of-day.ts, and components/MysteryAccordion.
5. Type generation
If you modify any Payload collection schema, regenerate types:
This overwrites payload-types.ts at the repo root.