You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.4 KiB
Markdown
66 lines
2.4 KiB
Markdown
+++
|
|
title = "Create .env.example documenting DATABASE_URL and all local dev environment variables"
|
|
priority = 5
|
|
status = "todo"
|
|
ticket_type = "task"
|
|
dependencies = ["33ed29"]
|
|
+++
|
|
|
|
<context>
|
|
TRIAGE 33ed29 resolved the local dev database strategy: rusqlite with a local SQLite file.
|
|
The only environment variable required for local development is `DATABASE_URL` (optional — defaults
|
|
to `./quotesdb.sqlite`). No Turso, no wrangler, no Cloudflare account needed locally.
|
|
|
|
A `.env.example` file in the project root serves as self-documenting reference for contributors.
|
|
The `.env` file itself is gitignored (never committed). `.env.example` is committed and documents
|
|
all variables with their defaults and a brief description.
|
|
</context>
|
|
|
|
<goal>
|
|
Create `quotesdb/.env.example` with the following content:
|
|
|
|
```sh
|
|
# quotesdb local development environment variables
|
|
# Copy to .env and customise. The .env file is gitignored and must never be committed.
|
|
#
|
|
# All variables below have sensible defaults for local development and are OPTIONAL.
|
|
|
|
# Path to the local SQLite database file used by `cargo run` (native API server).
|
|
# The file is created automatically on first run; migrations run on startup.
|
|
# In production this variable is unused — the Workers runtime uses the D1 binding.
|
|
DATABASE_URL=./quotesdb.sqlite
|
|
```
|
|
|
|
Also ensure `.gitignore` in the `quotesdb/` root has an entry for `.env`:
|
|
|
|
```gitignore
|
|
.env
|
|
```
|
|
</goal>
|
|
|
|
<decisions-reflected>
|
|
- TRIAGE 33ed29: rusqlite + local SQLite file. `DATABASE_URL` is the only required env var.
|
|
- No Cloudflare account, no wrangler, no Turso credentials needed for local dev.
|
|
</decisions-reflected>
|
|
|
|
<constraints>
|
|
- `.env.example` must be committed to the repo. `.env` must be gitignored.
|
|
- Only document variables that are actually used by the codebase (see ticket 6e829e / 00aff0 for where DATABASE_URL is read).
|
|
- Do not add placeholder values for production secrets — `.env.example` is for local dev only.
|
|
- If production-only secrets (e.g., Cloudflare API tokens for infra) are identified later, add them in a separate PR with appropriate comments.
|
|
</constraints>
|
|
|
|
<validation>
|
|
Verify `.env.example` is tracked and `.env` is gitignored:
|
|
|
|
```sh
|
|
git status # .env.example should appear as a new untracked file
|
|
echo "test" > .env
|
|
git status # .env must NOT appear (should be ignored)
|
|
rm .env
|
|
```
|
|
</validation>
|
|
|
|
<commit>
|
|
`chore(quotesdb): add .env.example documenting DATABASE_URL for local dev`
|
|
</commit> |