3.2 KiB
3.2 KiB
Moon Base — Project Notes
Property management for the Moon homestead (Eau Claire, WI) — food forest plant
registry, home maintenance tracking, and equipment logs. Next.js 14 + Prisma +
Postgres. Same conventions as FMB (/Users/bonnamoon/Projects/fullmoonbakehouse).
Modules
- v0.1 — Garden: food forest plant registry + care/harvest log. Live.
- Home maintenance — planned next: systems, recurring tasks, repair history.
- Equipment — planned: tools/machines, service intervals, maintenance logs.
Local dev
- DB:
postgresql://tonym@localhost:5432/moonbase_dev - Copy
.env.example→.envand fill in values. npm installthennpm run dev(port 3000)- After schema edits:
npx prisma generatethen restart dev server. - Seed demo data:
npm run db:seed(creates Bonna + Tony accounts + sample plants) - Minimal seed (admin accounts only):
SEED_MODE=minimal npm run db:seed - Apply migrations:
npx prisma migrate deploy
First-run setup (brand new machine / fresh DB)
npm install- Create
.envfrom.env.example npx prisma migrate deploy— creates the DB schema + provisions Bonna and Tony accounts- Default password for both is
moonbase!withmustChangePassword=true— change on first login.
Conventions (same as FMB)
- Every commit bumps APP_VERSION in
src/lib/version.ts+ a plain-English entry at the top ofsrc/lib/changelog.ts. Minor (0.X.0) for features/migrations, patch for fixes. Write changelog for Bonna, not engineers. - AuditEvent on every mutation — append-only, never delete.
- Soft-delete via
active=falsefor Plant (keeps log history intact). - Pure core + colocated test — new logic goes in
src/lib/...as a pure function with a.test.tsnext to it; API routes stay thin. - Worktrees for parallel sessions — same pattern as FMB. Use a worktree
(
git worktree add ../moonbase-<slug> -b <slug>) if running two Claude sessions.
Git remote
Add Gitea remote once the repo is created there:
git remote add gitea http://192.168.0.5:3022/tonym/moonbase.git
git push gitea main
Auth
- Username OR email login (same as FMB). Accounts:
bonna/tony, role ADMIN. mustChangePassword=trueon provisioned accounts — user is prompted on next login (add that redirect tosrc/app/(dashboard)/layout.tsxwhen implementing it).getSession()/isAdmin()insrc/lib/auth.ts.
Garden module — data model
- Plant — commonName, species (scientific), variety, category (PlantCategory enum), zone (freeform text: "Back yard north fence"), plantedAt, source, notes, active.
- PlantLog — per-plant log: type (OBSERVATION / CARE / HARVEST / TREATMENT / TRANSPLANT / DIED), date, notes, quantity (freeform, for harvests).
- Category labels + log type labels/colors live in
src/lib/garden/categories.ts. - API:
POST /api/plants(create plant),POST /api/plants/[id]/logs(add log entry).
Color palette
Forest / earth theme. Key CSS variables:
--canopy— dark forest green sidebar--leaf— fresh green accent--soil/--soil-muted— body text--dew— pale sage background--ember— red for destructive actions