Skip to Content
Getting startedInstallation

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.xcorepack enable picks up the version pinned in the root package.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 install

Create 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 only

Then open apps/api/.env and fill in two values that have no sensible default:

apps/api/.env
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 32

Every variable is listed on the Configuration page.

Apply the database schema

pnpm --filter @local-letter/api exec prisma migrate dev

This creates the tables for users, sessions, projects, templates, template locales and API keys.

Start everything

pnpm dev

Turborepo starts all three apps at once:

AppURL
APIhttp://localhost:4000
Dashboardhttp://localhost:5173
Marketing sitehttp://localhost:5174
Docs (this site)http://localhost:5175

To run just one, filter by package name:

pnpm --filter @local-letter/web dev

Check 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 suite

Next

Create a project, design a template and send a real email in Send your first email.

Last updated on