Getting Started
Configuration
How to configure Ledger's database connection, OAuth providers, and runtime options through a single environment file.
Configuration
Ledger reads its entire configuration from a single environment file at the project root. The repository ships an .env.example with every supported variable documented; copying it to .env.local and filling in the handful of required values is enough to get a development instance running. Nothing about Ledger requires editing source code to configure — every behaviour-changing setting is an environment variable.
This page walks through the variables in three groups: the small required set that every instance needs, the OAuth provider credentials (at least one is required for sign-in), and a longer list of optional variables you can leave at their defaults until you have a reason to change them.
Required variables#
These three values are non-negotiable. Without all three, the server refuses to start. The auth secret should be generated locally and never reused across environments — openssl rand -base64 32 produces a suitable value.
Variable | Description |
|---|---|
| PostgreSQL connection string |
| 32-byte secret for signing JWT sessions |
| Public URL of this app (e.g. |
OAuth providers#
Ledger doesn't manage passwords directly — all sign-ins go through a third-party OAuth provider. At least one provider must be configured for sign-in to work; all three listed below are supported and you can configure as many as you want.
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=Database setup#
Once DATABASE_URL points at a reachable PostgreSQL instance, apply the schema migrations before starting the server for the first time. The standard production-style flow is migrate deploy, which applies the committed migration history exactly as it was created.
npx prisma migrate deployFor local development where you'd rather skip the migration ceremony, db push synchronises the schema without recording a migration. Use this only for personal databases that no one else depends on.
npx prisma db pushOptional variables#
The rest of the configuration surface has sensible defaults. Override these only when you have a specific reason to — most local-development setups never touch them.
Variable | Default | Description |
|---|---|---|
|
| Used in emails and public links |
|
| One of |
|
| API rate-limit window in milliseconds |