Installation
Local Letter is a pnpm + Turborepo monorepo. One install at the root gets you every app.
Requirements
- Node.js 20 or newer
- pnpm 10.x —
corepack enablepicks up the version pinned in the rootpackage.json - A Postgres database — local or hosted, anything Prisma can reach
Clone and install
git clone https://github.com/Sagar9980/local-letter.git
cd local-letter
pnpm installCreate your env files
Each app reads its config from environment variables. Copy the example file for the apps you plan to run:
cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env
cp apps/site/.env.example apps/site/.env # optional — marketing site onlyThen open apps/api/.env and fill in two values that have no sensible default:
DATABASE_URL="postgresql://user:password@localhost:5432/local_letter"
BETTER_AUTH_SECRET="replace-with-a-long-random-secret"A good secret is any long random string:
openssl rand -base64 32Every variable is listed on the Configuration page.
Apply the database schema
pnpm --filter @local-letter/api exec prisma migrate devThis creates the tables for users, sessions, projects, templates, template locales and API keys.
Start everything
pnpm devTurborepo starts all three apps at once:
| App | URL |
|---|---|
| API | http://localhost:4000 |
| Dashboard | http://localhost:5173 |
| Marketing site | http://localhost:5174 |
| Docs (this site) | http://localhost:5175 |
To run just one, filter by package name:
pnpm --filter @local-letter/web devCheck that the API is up
curl http://localhost:4000/health{ "success": true, "statusCode": 200, "message": "Service is healthy", "data": { "status": "ok" } }The dashboard talks to the API across origins, so WEB_ORIGIN in
apps/api/.env must match the URL the dashboard is served from. With the
defaults above they already line up.
Other root scripts
Every root script fans out across the workspace the same way dev does:
pnpm build # build every app
pnpm lint # lint every app
pnpm typecheck # typecheck every app
pnpm test # run every test suiteNext
Create a project, design a template and send a real email in Send your first email.