← All docs
Frontend (
Backend (
Installation
How to run the marketing website (frontend + API + database) locally. The
product app has its own setup in ../../backend and is not required to run the
website.
Prerequisites
| Tool | Version | Notes |
|---|---|---|
| Node.js | 20+ | Required by Next.js 15 and the Express API |
| npm | 10+ | Ships with Node 20 |
| PostgreSQL | 14+ | The website's database (separate from the product) |
The product app additionally needs Java 21 and MongoDB, but those are only for
../../backend- not for the website.
1. Database
Create a database and a user the API can connect as. For local development:
CREATE ROLE leadfella WITH LOGIN PASSWORD 'leadfella';
CREATE DATABASE leadfella OWNER leadfella;
The default development connection string is
postgresql://leadfella:leadfella@localhost:5432/leadfella. Adjust to match
your setup and put it in the backend's .env (see
configuration.md).
2. Backend (Express API)
cd website/backend
cp .env.example .env # then edit DATABASE_URL + admin/JWT secrets
npm install
npm run migrate # create tables + indexes (also runs on startup)
npm run seed:admin -- "your-admin-password" # prints a bcrypt hash for .env
npm run dev # http://localhost:4000 (tsx watch)
npm run migrateapplies the SQL migrations inbackend/migrations/. Pending migrations also run automatically on server startup, so the schema is created on first boot.npm run seed:adminprints a bcrypt hash; copy it intoADMIN_PASSWORD_HASHin.env(preferred over a plaintextADMIN_PASSWORD).- Check health: open
http://localhost:4000/api/health(liveness) andhttp://localhost:4000/api/health/db(database readiness).
3. Frontend (Next.js site)
cd website/frontend
npm install
npm run dev # http://localhost:3000
By default the frontend calls the API at http://localhost:4000. To point it
elsewhere, set NEXT_PUBLIC_API_URL (see configuration.md).
4. Verify it works
- Visit
http://localhost:3000- the marketing site loads. - Go to
/pricingand submit the early-access form. You should see a success state. - Open
http://localhost:3000/admin, sign in with the admin email + password, and confirm the new signup appears under Leads.
Useful scripts
Frontend (website/frontend)
| Script | Purpose |
|---|---|
npm run dev | Dev server (http://localhost:3000) |
npm run build | Production build |
npm start | Serve the production build |
npm run lint | ESLint |
npm run typecheck | Type-check without emitting |
Backend (website/backend)
| Script | Purpose |
|---|---|
npm run dev | Watch-mode dev server (tsx) |
npm run build | Compile TypeScript to dist/ |
npm start | Run the compiled server |
npm run typecheck | Type-check without emitting |
npm run migrate | Apply pending SQL migrations |
npm run seed:admin | Print a bcrypt hash for the admin password |
npm run list-leads | List early-access signups (filters) |
npm run delete-lead | Delete a signup by id or --email |
npm run export-leads | Export signups to CSV (filters) |
npm run list-admins | Show the configured admin account |
npm run delete-admin | Print steps to revoke the admin account |
See troubleshooting.md if anything fails to start.