Local development
In development every external service is optional. Without Mailgun, emails are kept in a console outbox; without Stripe, billing is simulated; without Microsoft Entra, a developer sign-in is offered.
-
Install dependencies from the repository root:
Terminal window npm install -
Start Postgres and keep it running in its own terminal:
Terminal window npm run dev:dbThis starts an embedded Postgres on port 54329 with data in
apps/api/.pgdata, creates thepdfeditordatabase, and matches the defaultDATABASE_URL(postgres://postgres:postgres@localhost:54329/pdfeditor). SetDEV_DB_PORTto use another port (and changeDATABASE_URLto match). -
Configure (optional). Copy
apps/api/.env.exampletoapps/api/.env. Everything has a development default, so you can skip this at first. -
Start the API and web app:
Terminal window npm run devThe API listens on
http://localhost:3001and applies migrations on start. The web app runs onhttp://localhost:5173and proxies/apito the API (setAPI_URLto proxy elsewhere). Its startup line shows the billing mode, email transport and whether Microsoft sign-in is on. -
Create an account. Open
http://localhost:5173/signup. The confirmation email isn’t sent anywhere: its link is printed in the API log and kept in the dev outbox (below). -
Choose a plan. With simulated billing, Choose plan opens a Simulated checkout page where you confirm without paying.
Development helpers
Section titled “Development helpers”| Helper | What it does |
|---|---|
GET /api/dev/emails |
Emails captured by the console transport, newest first (the last 200). Filter with ?to=someone@example.com. Open it at http://localhost:5173/api/dev/emails. |
| Development sign-in | When DEV_LOGIN is on (the default outside production), the sign-in page has a Development sign-in panel listing existing users. Click one to sign in as them, with no password or Microsoft account. |
GET /api/dev/users |
The users that the development sign-in lists. |
| Simulated billing | BILLING_MODE=fake (the default without STRIPE_SECRET_KEY): checkout and extra packs complete on a local page and set up a 30-day period. The billing portal isn’t available. |
All /api/dev/* routes return 404 in production, and the development sign-in is always off there.
Other workspaces
Section titled “Other workspaces”npm run dev -w @pdfeditor/docs # this site, http://localhost:4322npm run dev -w @pdfeditor/marketing # the marketing site, http://localhost:4321npm test # shared + API testsnpm run lintTo create a super admin locally, see Creating the first super admin.