- Keep this file under 150 lines.
- Prefer higher level CLAUDE.md files for generalized instructions
- Specifications belong in
specification/
Next.js (App Router) + React, PostgreSQL, Tailwind v4. Storage grid rendered as SVG within React components; DOM overlays for tooltips and detail panels. Single-user for initial implementation. Designed for future multi-user, multi-tenant (users belong to orgs). AI integration (OpenAI) deferred — build core storage and item management first.
Dev DB is always local Docker: docker compose -f docker-compose.dev.yml up -d from repo root. Never point dev at a remote Postgres. Connection string lives in web/.env.local (copy from .env.local.example).
From web/:
npm run dev— next dev (requires local Postgres +.env.local)npm test— Vitest unit and integration testsnpm run test:watch— Vitest in watch modenpm run db:migrate— Drizzle migrations (also seedsdefaultorg/user)npm run db:seed— sample taxonomy, items, templates, modules for UI worknpm run db:generate— generate migration from schema changesnpm run db:studio— Drizzle Studio (database browser)
Sign in at /login — Dev users panel has 4 one-click personas (admin, free, pro). Non-prod only.
TDD for data model and repository layers. Tests run against a real PostgreSQL database with per-test transaction rollback — no mocks, no in-memory fakes.
- Unit tests — repository functions, domain logic, path utilities
- Integration tests — API routes, multi-step operations (insert placement, assignment resolution)
- Component tests — React Testing Library + Vitest, test behavior not rendering
Three-layer data access — no exceptions:
- Schema (
web/db/schema/) — Drizzle schema definitions, no business logic - Repository (
web/repositories/) — All business logic, validation, org-scoped queries - API route (
web/app/api/) — Thin: parse request, check auth, call repository, format response
- All methods take a single destructured object:
create({ userId, name, location }) - All user-data queries must scope by
userId— no unscoped queries. Future:orgIdscoping when multi-tenant is implemented; items will be global (shared across orgs). - Repositories throw errors; API routes catch and return
{ error: "msg" }
Success: { items: [...] } or { item: {...} }
Error: { error: "Error message" }
| Type | Convention | Example |
|---|---|---|
| Components, models | PascalCase | ChatContainer.tsx, Module.ts |
| Utilities, functions, variables | camelCase | agentRunner.ts, userId |
| Constants | UPPER_SNAKE | MAX_TOKENS |
| Database fields | camelCase | createdAt |
| Module names (domain) | Short, not descriptive | MUSE, FLUX, NEON |
| Parameter keys (domain) | lowercase_underscore | thread_size, voltage_rating |
Tailwind v4 with custom accent color (#ff6600 orange). Dark mode supported. Grid labeling: rows=alpha (A,B,C), cols=numeric (1,2,3), origin=top-left.
New model: Drizzle schema in web/db/schema/ → generate migration → repository in web/repositories/ → API routes in web/app/api/ → tests first
- specification/project-intent.md — what WhereTF is, interaction model, domain concepts
- specification/storage-model.md — storage data model (modules, templates, inserts, overrides, paths)
- specification/storage-navigator-design.md — grid visualization UI/UX spec
- specification/interface-type-management.md — interface types: admin CRUD + template/receptacle integration
- specification/location-tracker-ux-issues.md — living UX issue log for
/modules+/templates+/inserts - specification/item-taxonomy.md — conceptual: categories, parameters, aspects
- specification/item-parametric-model.md — parameters + standards + designations: schema, unit conversion
- specification/taxonomy-management-design.md —
/taxonomyadmin UI spec - specification/taxonomy-synonyms.md — aspect/parameter aliases (deferred)
- specification/measure-family.md — unit-aware value equivalence (deferred)
- specification/item-management-design.md —
/itemsdesign decisions - specification/item-graphics.md — per-item SVG wireframes (deferred)
- specification/ui-paradigms.md — cross-cutting UI/UX rules
- specification/ui-layout-patterns.md — shell + three-panel layout + design tokens
- specification/user-menu.md — sidebar account affordance +
/settingsstructure - specification/auth-roadmap.md — auth, authz, multi-tenancy ordering
- specification/deployment.md — CI/CD pipeline and deployment
- specification/ai-agent-architecture.md — AI agent patterns (deferred, reference only)
- specification/ai-collaboration-notes.md — notes on AI collaboration workflow (not a product spec)