Skip to content
← All docs

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

ToolVersionNotes
Node.js20+Required by Next.js 15 and the Express API
npm10+Ships with Node 20
PostgreSQL14+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 migrate applies the SQL migrations in backend/migrations/. Pending migrations also run automatically on server startup, so the schema is created on first boot.
  • npm run seed:admin prints a bcrypt hash; copy it into ADMIN_PASSWORD_HASH in .env (preferred over a plaintext ADMIN_PASSWORD).
  • Check health: open http://localhost:4000/api/health (liveness) and http://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 /pricing and 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)

ScriptPurpose
npm run devDev server (http://localhost:3000)
npm run buildProduction build
npm startServe the production build
npm run lintESLint
npm run typecheckType-check without emitting

Backend (website/backend)

ScriptPurpose
npm run devWatch-mode dev server (tsx)
npm run buildCompile TypeScript to dist/
npm startRun the compiled server
npm run typecheckType-check without emitting
npm run migrateApply pending SQL migrations
npm run seed:adminPrint a bcrypt hash for the admin password
npm run list-leadsList early-access signups (filters)
npm run delete-leadDelete a signup by id or --email
npm run export-leadsExport signups to CSV (filters)
npm run list-adminsShow the configured admin account
npm run delete-adminPrint steps to revoke the admin account

See troubleshooting.md if anything fails to start.