Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
e47f32b
Rewrite: Next.js 16 with AI-powered chat interface
ndemarco Dec 17, 2025
e8a2e96
Add Storage Type Registry for common organizers
ndemarco Dec 18, 2025
7ee85c8
Add subdimensions, cell merging, and dimension management
ndemarco Dec 18, 2025
7731c91
Add path validation for subdimensions and merged cells
ndemarco Dec 18, 2025
df3cc01
Improve agent instructions and response formatting
ndemarco Dec 18, 2025
9addc60
Add caching for seeds, tools, and agents (performance)
ndemarco Dec 18, 2025
73cb1fe
Remove deprecated templates, add agent upsert support
ndemarco Dec 18, 2025
25bc174
Add Storage Navigator side panel for visual location display
ndemarco Dec 18, 2025
3650e54
Migrate middleware.ts to proxy.ts for Next.js 16
ndemarco Dec 18, 2025
6d2bbda
Fix side panel, sessions page, and propagate specialist tool calls
ndemarco Dec 18, 2025
7b77b43
WIP: Storage navigator, audit logging, dashboard, and various fixes
ndemarco Mar 8, 2026
965d204
Add v2 data models, repositories, and tests (130 passing)
ndemarco Mar 10, 2026
f764fba
Clean up old models, repos, and components
ndemarco Mar 10, 2026
f988237
Rewrite tool definitions for v2 data model
ndemarco Mar 11, 2026
6a0d876
Implement tool handlers and repository barrel export
ndemarco Mar 11, 2026
cffa1aa
Rewrite agent definitions for v2 tool set
ndemarco Mar 11, 2026
94990e7
Add in-memory MongoDB dev mode
ndemarco Mar 11, 2026
6e8dbb0
Fix session reset bug, add structured logging
ndemarco Mar 11, 2026
600d148
Add tool handler tests (66 tests)
ndemarco Mar 11, 2026
7214ff9
Add .gitignore and commit guidelines
ndemarco Mar 11, 2026
b722dd2
Replace sprawling spec docs with consolidated CLAUDE.md
ndemarco Mar 17, 2026
cf0e5da
Expand agent and tool system for v2
ndemarco Mar 17, 2026
6cc55ff
Add 3-pane GUI with module explorer and location grid
ndemarco Mar 17, 2026
f945622
Add structured logging and exercise harness
ndemarco Mar 17, 2026
75b8369
Update dependencies, dev tooling, and storage model spec
ndemarco Mar 17, 2026
92c25df
Split CLAUDE.md into dev directives and project intent spec
ndemarco Mar 17, 2026
3b6b69e
Refine storage model spec and update stack for rewrite
ndemarco Mar 17, 2026
6409ac2
Add dev process, testing strategy, and deployment spec
ndemarco Mar 17, 2026
34a60f1
Move navigator spec to specification/, remove boilerplate
ndemarco Mar 17, 2026
968b68e
Defer multi-user to future, capture AI agent architecture
ndemarco Mar 17, 2026
3ac3bdc
Gut v1 codebase and scaffold v2 foundation
ndemarco Mar 17, 2026
e86317f
Add module repository with transaction logging and tests
ndemarco Mar 17, 2026
1b95d74
Add template, item, interface type, location, insert, and assignment …
ndemarco Mar 17, 2026
fb7dcff
Add REST API routes for all resources
ndemarco Mar 17, 2026
456b8c7
Add continuous-dimension locations, unit system, and overflow directi…
ndemarco Mar 18, 2026
70d1272
Add browse and search UX prototypes with persistent detail panel
ndemarco Mar 18, 2026
a89f4a3
Hide pick list numbered badges when pick list is not active
ndemarco Mar 18, 2026
45d4aa9
Remove category dots, add multi-location links to detail panel
ndemarco Mar 18, 2026
5c1501e
Add item maintenance use cases specification
ndemarco Mar 18, 2026
25bd8c7
Add item taxonomy specification
ndemarco Mar 18, 2026
ea0bba8
Revise item taxonomy: rename class to aspect, add defaults, defer fam…
ndemarco Mar 18, 2026
4bd67c2
Emphasize item characterization as core in project intent
ndemarco Mar 18, 2026
0e0e79e
Add cell selection, multi-select with merge/split actions, configurab…
ndemarco Mar 18, 2026
50474c0
Add unified storage navigator prototype merging browse and search modes
ndemarco Mar 18, 2026
560e948
Rebuild navigator prototype: merge search as overlay on browse
ndemarco Mar 18, 2026
32ce059
Add item taxonomy schema, repositories, and API routes
ndemarco Mar 18, 2026
edf7cb1
More detail
ndemarco Mar 18, 2026
359722b
Add item management UX prototype v1
ndemarco Mar 18, 2026
999a037
Add item management UI spec and cross-cutting UI paradigms
ndemarco Mar 18, 2026
5dbb62b
Add sidebar menu to item management prototype
ndemarco Mar 18, 2026
fcfe16b
Add rich item listing with search, filtering, and sort
ndemarco Mar 18, 2026
5d53eca
Add item management frontend and seed data
ndemarco Mar 19, 2026
31bdfae
Add storage definition spec and prototype
ndemarco Mar 19, 2026
66e0b55
Add merge axis constraint to templates
ndemarco Mar 19, 2026
6bb2e74
Add selective version upgrade flow for template instances
ndemarco Mar 19, 2026
986a910
Show version properties on template detail
ndemarco Mar 19, 2026
192da0c
Move properties to right panel, show permanent dividers and origin in…
ndemarco Mar 19, 2026
21b43bb
Template detail: selectable versions, active badge, apply-to-selected
ndemarco Mar 19, 2026
efcc4f0
Template detail: larger grid, editable properties, version removal
ndemarco Mar 19, 2026
5d0da22
Template properties: labeling, origin, per-axis dividers, larger grid…
ndemarco Mar 19, 2026
6edcc2b
Template properties: correct control types, label validation, live grid
ndemarco Mar 19, 2026
82309a4
Always-editable properties, origin-aware labels, external origin marker
ndemarco Mar 19, 2026
c0fc898
Update storage definition spec to match prototype refinements
ndemarco Mar 19, 2026
95f33e8
Template schema: activeVersion, independent divider settings, setActi…
ndemarco Mar 19, 2026
0e48d7b
Template CRUD pages: list, create, and detail views
ndemarco Mar 19, 2026
a92486d
Add template seed data and db:seed npm script
ndemarco Mar 19, 2026
614ba02
Make seed script idempotent — skip sections with existing data
ndemarco Mar 19, 2026
b486e14
Module pages: list, creation wizard, detail view
ndemarco Mar 19, 2026
0046d18
Place Insert flow: template picker, parametric config, child location…
ndemarco Mar 19, 2026
ea5e915
Add insert UID field for RFID tag identification
ndemarco Mar 19, 2026
b095e5c
Storage navigator: grid assignments, cell detail, activity log
ndemarco Mar 19, 2026
e2a1112
Taxonomy management page, item aspect/category editing
ndemarco Mar 19, 2026
858a316
Aspect deletion: type-to-confirm with impact summary
ndemarco Mar 19, 2026
bf135b9
Aspect delete modal: plain text, shorter copy
ndemarco Mar 19, 2026
b406a31
Taxonomy admin prototype v1: list+detail two-column layout
ndemarco Mar 19, 2026
72af50b
Taxonomy admin prototype v2: grid-focused layout with drawer detail
ndemarco Mar 19, 2026
cfa7965
Taxonomy admin prototype v3: three-panel layout matching app pattern
ndemarco Mar 19, 2026
83ac9b4
Taxonomy v3: split center panel — aspect detail on top, param detail …
ndemarco Mar 19, 2026
95f2d43
Taxonomy v3: tighten spacing across all panels
ndemarco Mar 19, 2026
80b7650
Standards M2M: aspects↔standards many-to-many
ndemarco Apr 9, 2026
70390d9
Storage base model: canonical mm, template scope, capacity clamps
Apr 14, 2026
518506a
Repos support template scope + continuous-dim capacity
Apr 14, 2026
2c75243
Sidebar: expand/collapse with labels (GN-1)
Apr 14, 2026
b0876fb
Module detail: non-interactive header + right-panel edit mode
Apr 14, 2026
ee7dd6d
Breadcrumb on module detail (GN-2)
Apr 14, 2026
d978214
Sidebar: top-right chevron affordance + keyboard shortcut
Apr 14, 2026
f91b511
Module detail: auto-select last-used level (MD-4)
Apr 14, 2026
44e6fba
Module deletion dialog (ML-2)
Apr 14, 2026
9edac47
Capture TP-* template-area UX issues
Apr 14, 2026
e673d7e
Templates: hide + reference-aware delete (TP-2 backend)
Apr 14, 2026
14acc23
Templates: master-detail layout with hide/delete (TP-1, TP-2, TP-3, T…
Apr 14, 2026
0e94909
Capture IN-1 (inserts UI) + IN-2 (override editing) tasks
Apr 14, 2026
f823449
IN-2/1 Disable override: prerequisite + cell panel UI
Apr 14, 2026
3c41a8e
Capture IN-1 (filterable inserts list + left menu), NV-1 (admin secti…
Apr 14, 2026
43d685b
IN-2/2 Restrict override: API + cell panel UI
Apr 14, 2026
01e7a62
Module detail: auto-recover from stale cell IDs
Apr 14, 2026
21faf1c
Inserts area + admin sidebar grouping + sticky Place Insert footer
Apr 14, 2026
97b93f6
Capture IN-3 (surface insert inside receptacle) + IN-4 (insert-first …
Apr 14, 2026
f9af432
Refine IN-3/IN-4: insert name is insert-owned; unplace from either side
Apr 14, 2026
012f54d
Cells belong to insert, not receptacle (IN-3 foundation)
Apr 14, 2026
a09033a
IN-3: insert surfaced in module level header · IN-4: Place/Move picker
Apr 14, 2026
c136cff
Capture IN-5 (New insert), IN-6 (hide UID), IN-7 (insert = item\xE2\x…
Apr 14, 2026
310a3b6
New insert UI + hide UID + fix test-DB footgun
Apr 14, 2026
b1e2f00
Insert cells materialize at creation, not placement
Apr 14, 2026
ccaf148
Insert detail: render cell grid (read-only for now)
Apr 14, 2026
f81c95a
IN-7 Phase A: interactive cells on insert grid
Apr 14, 2026
74fe1ec
IN-7 Phase B: merge/unmerge on insert grid
Apr 14, 2026
ce76cea
IN-7 Phase C: divide / undivide a cell
Apr 14, 2026
4c94afb
Insert grid: render divided cells + sticky merge-select mode
Apr 15, 2026
82e555f
Dedup: extract getGridLabel into web/lib/gridLabels.ts
Apr 15, 2026
62e3885
Divide visual: full-size rect bisected by interior line(s)
Apr 15, 2026
6e4ba77
InsertGrid: CSS Grid + HTML, text reflows, scales to container
Apr 15, 2026
7900d7e
Doc: AI-collaboration guide for POC-to-production work
Apr 15, 2026
36e5b00
Module detail: scope-restrict insert-backed cells
Apr 15, 2026
50d2e0b
Insert grid: fit viewport, no scrolling
Apr 15, 2026
51f33af
Divided cell: surface Undivide from any child
Apr 15, 2026
965064b
Disabled cell: light crosshatch + overlaid disable reason
Apr 15, 2026
51aa79c
IN-8: smart subdivision label suggestions from template (deferred TODO)
Apr 15, 2026
3eb79d1
Insert grid: render template's fixed dividers as overlay stripes
Apr 15, 2026
6f618ee
Disabled cells: visible multi-select state for merge
Apr 15, 2026
18edb8d
Insert grid: merge controls move to right sidebar, refuse merging dis…
Apr 15, 2026
37072f2
Inserts right pane: View/Assign and Edit tabs
Apr 15, 2026
336f193
Inserts right pane: View owns placement + items, Edit owns overrides …
Apr 15, 2026
546ebb9
Receptacles declare interface; Place wizard becomes insert-first
Apr 15, 2026
d2afbb8
Extract CellGrid; module page renders cells via the same HTML grid
Apr 15, 2026
603dd19
Module level list: badge shows insert name when filled, interface whe…
Apr 15, 2026
43e7e7b
Module detail: prominent level header with click-pencil rename
Apr 15, 2026
615d0db
Module detail: consolidate insert actions into right panel; level dis…
Apr 15, 2026
0f76849
Center pane title: level / insert, drop type + position count from su…
Apr 15, 2026
ad40daf
Right panel level view: Place / Edit tabs, drop Close
Apr 15, 2026
df460ff
Right panel level: strip redundant info, move Disable to Edit tab
Apr 15, 2026
162c241
Unify placement: inline candidates in right pane on both pages
Apr 15, 2026
25c809f
Placement needs a confirm step; delete the orphan wizard route
Apr 15, 2026
d9c0a43
IN-8: subdivision label suggestions + MD-1 note
Apr 15, 2026
557c247
Modules list: levels shown per card; kill the 4-step new-module wizard
Apr 15, 2026
bcd568f
New module form: add/remove level rows; drop redundant Cancel + Count
Apr 15, 2026
587aec2
Move 'New module' to Admin sidebar group; drop redundant button
Apr 15, 2026
3b185a9
Onboarding tour: /tour page with concept diagram + sidebar entry
Apr 15, 2026
02d5b4d
Tour: rebuild as an animated stepped slideshow
Apr 15, 2026
bf03097
IN-8: render divided cells with orientation from labels
Apr 15, 2026
0fbfda8
Modules list: shelved cabinet look + inline-editable level labels
Apr 15, 2026
bd9779c
Modules list: show cell fill fraction per level; highlight label edit…
Apr 15, 2026
0c61a29
Modules list: drop inline label edit; level click opens detail only
Apr 15, 2026
bf64ca0
gitignore: exclude Claude Code local state files
Apr 15, 2026
55f3afa
Modules list: drop interface-type suffix from empty levels
Apr 15, 2026
b3a22ab
Levels: stable ordering — by creation for non-numeric labels, numeric…
Apr 15, 2026
927a026
Frontend tests: jsdom project + CellGrid suite (7 tests)
Apr 15, 2026
7a9c4d9
Items: designation picker + auto-fill
Apr 15, 2026
95458b0
Taxonomy: Standards admin tab
Apr 15, 2026
ab3108e
Taxonomy / Parameters: inline edit (dataType, unit, enum values, nume…
Apr 15, 2026
0b3e512
Aspects: inline 'create new parameter' while adding to an aspect (no …
Apr 15, 2026
5ecbc74
Standards: inline-edit header (name/tag/desc); bulk designation entry…
Apr 15, 2026
58cc947
Standards: right Info panel (items using, designation histogram, summ…
Apr 15, 2026
e2311e2
Aspects: Matrix view — rows=parameters, cols=aspects, click cells/hea…
Apr 15, 2026
2776db0
Standards Info panel: match inserts/modules right-panel styling; move…
Apr 15, 2026
da3a597
Standards tab: match modules/inserts layout — breadcrumb bar, title-r…
Apr 15, 2026
1c2f844
Aspects: ParamTypeahead — search existing params or create-and-add in…
Apr 15, 2026
870e1f0
Step 1: Create item from designation + category inference
Apr 15, 2026
68aa863
Step 2: Generate set dialog
Apr 15, 2026
5533096
Step 3: dedup on save
Apr 15, 2026
f92fe3e
Bulk aspect import: paste structured text, parser splits sections → a…
Apr 16, 2026
e47f3c4
BulkAspectImport: AI-assisted two-phase flow (extract prompt → ingest…
Apr 16, 2026
013b58c
Phase 1: parameter_definitions gains description + searchTerms (migra…
Apr 16, 2026
edf5590
Phase 2: prompt preamble + validator + save include description + sea…
Apr 16, 2026
829352d
Phases 3+4: conflict banner with reuse/rename/skip resolution; save h…
Apr 16, 2026
6a5be44
Phase B: aspect/parameter usage counts (listWithUsage + getUsage repo…
Apr 16, 2026
021a985
Phase E: SI prefix parser util + 4 input wirings (BulkAspectImport mi…
Apr 16, 2026
eaa94f2
Phase D: /taxonomy Audit tab + repo audit() methods for params, aspec…
Apr 16, 2026
59764d0
Phase A: filter input on Aspects list + Parameters table
Apr 16, 2026
d68b81a
Phase C: where-used drilldowns — aspect detail 'Used by N items' sect…
Apr 16, 2026
42920da
Phase F.2: aspect-first parameter assignment
Apr 16, 2026
4e977bd
R1: taxonomy subtabs become routed subpages; sidebar gains Taxonomy g…
Apr 16, 2026
d5fb2b0
R2: Aspects three-pane (left list, middle editable header + parameter…
Apr 16, 2026
2d6a10b
R3: Parameters three-pane (left list, middle editor form, right Usage…
Apr 16, 2026
b8cf962
Deployment package: Dockerfile (multi-stage, multi-arch), reference c…
Apr 16, 2026
f141c38
Categories three-pane: left list, middle editor (color picker + SVG m…
Apr 16, 2026
f470db8
CI: .gitlab-ci.yml (lint, backend+frontend tests, multi-arch buildx t…
Apr 16, 2026
f5ae6c4
Pivot to public FOSS on GitHub: AGPL-3.0 LICENSE, README with Docker …
Apr 16, 2026
b0b15e6
Lint: rename 'module' vars in API routes, escape quotes in BulkAspect…
Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .claude/hooks/check-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Pre-test check: Docker daemon + Postgres container must be running

if ! docker ps > /dev/null 2>&1; then
echo "Docker is not running. Start Docker Desktop on Windows, wait ~15 seconds for WSL2 integration, then retry." >&2
exit 2
fi

if ! docker ps --filter "name=wheretf-postgres" --filter "status=running" | grep -q postgres; then
echo "Postgres container is not running. Start it with: docker compose -f docker-compose.dev.yml up -d" >&2
exit 2
fi
24 changes: 24 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "echo \"$CLAUDE_TOOL_INPUT\" | grep -qE '(npm test|npx vitest|vitest run)' && /home/nick/projects/nickydoes/wheretf/.claude/hooks/check-docker.sh || true"
}
]
}
]
},
"permissions": {
"allow": [
"Bash(DATABASE_URL=\"postgresql://wheretf:wheretf@localhost:5432/wheretf_test\" npx vitest run)",
"WebSearch"
],
"additionalDirectories": [
"/home/nick/projects/nickydoes/wheretf/web/app/api/modules"
]
}
}
4 changes: 4 additions & 0 deletions .claude/skills/committing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Commit Guidelines

- Do not include Co-Authored-By lines or any AI/Claude attribution in commit messages.
- Keep commit messages concise and focused on the "why" of the change.
152 changes: 152 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: CI

on:
push:
branches: [main, v2-rewrite]
tags: ["v*"]
pull_request:
branches: [main]

permissions:
contents: read
packages: write # to push to GHCR on the publish job

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
REGISTRY: ghcr.io
APP_IMAGE: ghcr.io/${{ github.repository }}/web
MIGRATE_IMAGE: ghcr.io/${{ github.repository }}/migrate

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- run: npm ci --prefer-offline --no-audit --no-fund
working-directory: web
- run: npm run lint
working-directory: web
- run: npx tsc --noEmit
working-directory: web

test-backend:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: wheretf_test
POSTGRES_USER: wheretf
POSTGRES_PASSWORD: wheretf
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U wheretf"
--health-interval 5s
--health-timeout 3s
--health-retries 10
env:
DATABASE_URL: postgresql://wheretf:wheretf@localhost:5432/wheretf_test
DATABASE_URL_TEST: postgresql://wheretf:wheretf@localhost:5432/wheretf_test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- run: npm ci --prefer-offline --no-audit --no-fund
working-directory: web
- run: npm run db:migrate
working-directory: web
- run: npm run test:backend
working-directory: web

test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- run: npm ci --prefer-offline --no-audit --no-fund
working-directory: web
- run: npm run test:frontend
working-directory: web

build-and-publish:
runs-on: ubuntu-latest
needs: [lint, test-backend, test-frontend]
# Only publish images on main / tags — PRs run lint+tests only.
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- uses: actions/checkout@v4

- name: Set up QEMU (for arm64 emulation)
uses: docker/setup-qemu-action@v3

- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Tag metadata (app)
id: meta-app
uses: docker/metadata-action@v5
with:
images: ${{ env.APP_IMAGE }}
tags: |
type=sha,prefix=sha-
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}

- name: Build + push runner image
uses: docker/build-push-action@v6
with:
context: ./web
target: runner
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-app.outputs.tags }}
labels: ${{ steps.meta-app.outputs.labels }}
cache-from: type=gha,scope=runner
cache-to: type=gha,scope=runner,mode=max

- name: Tag metadata (migrate)
id: meta-migrate
uses: docker/metadata-action@v5
with:
images: ${{ env.MIGRATE_IMAGE }}
tags: |
type=sha,prefix=sha-
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}

- name: Build + push migrator image
uses: docker/build-push-action@v6
with:
context: ./web
target: migrator
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-migrate.outputs.tags }}
labels: ${{ steps.meta-migrate.outputs.labels }}
cache-from: type=gha,scope=migrator
cache-to: type=gha,scope=migrator,mode=max
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OS
.DS_Store
Thumbs.db

# IDE
.idea/
*.swp
*.swo
*~

# Claude Code local state
.claude/settings.local.json
.claude/project-context.json

# Environment
.env
.env.*
!.env.*.example

# Data / runtime
data/

# Node (root-level scripts)
node_modules/

# Docker volumes
docker-data/
83 changes: 83 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# WhereTF — Development Directives

## Claude project notes
- Keep this file under 150 lines.
- Prefer higher level CLAUDE.md files for generalized instructions

## Folder structure
- Specifications belong in `specification/`

## Stack

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 Commands

From `web/`:
- `npm run dev` — next dev (requires local PostgreSQL)
- `npm test` — Vitest unit and integration tests
- `npm run test:watch` — Vitest in watch mode
- `npm run db:migrate` — run Drizzle migrations
- `npm run db:generate` — generate migration from schema changes
- `npm run db:studio` — Drizzle Studio (database browser)

## Testing

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

## Architecture

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

## Repository Conventions

- All methods take a single destructured object: `create({ userId, name, location })`
- All user-data queries must scope by `userId` — no unscoped queries. Future: `orgId` scoping when multi-tenant is implemented; items will be global (shared across orgs).
- Repositories throw errors; API routes catch and return `{ error: "msg" }`

## API Response Shape

```
Success: { items: [...] } or { item: {...} }
Error: { error: "Error message" }
```

## Naming

| 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` |

## Styling

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.

## Adding Things

**New model:** Drizzle schema in `web/db/schema/` → generate migration → repository in `web/repositories/` → API routes in `web/app/api/` → tests first

## Specification

- [specification/project-intent.md](specification/project-intent.md) — what WhereTF is, interaction model, domain concepts
- [specification/storage-model.md](specification/storage-model.md) — storage data model (modules, templates, inserts, overrides, paths)
- [specification/deployment.md](specification/deployment.md) — CI/CD pipeline and deployment
- [specification/storage-navigator-design.md](specification/storage-navigator-design.md) — grid visualization UI/UX spec
- [specification/storage-definition-design.md](specification/storage-definition-design.md) — module/template/insert definition UI/UX spec
- [specification/item-taxonomy.md](specification/item-taxonomy.md) — item classification (categories, parameters, aspects)
- [specification/item-maintenance.md](specification/item-maintenance.md) — item lifecycle use cases
- [specification/item-management-design.md](specification/item-management-design.md) — item management UI/UX spec
- [specification/ui-paradigms.md](specification/ui-paradigms.md) — cross-cutting UI/UX rules
- [specification/ai-agent-architecture.md](specification/ai-agent-architecture.md) — AI agent patterns (deferred, reference only)
28 changes: 28 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Code of Conduct

## In short

Be decent. Don't be a jerk.

## Longer version

- Assume good faith. People miscommunicate, especially over text.
- Disagreement about technical choices is fine and expected. Framing
disagreement as attacks on a person is not.
- No harassment, no slurs, no threats, no doxxing. Obvious.
- This project has one maintainer. Decisions that can't be resolved
by discussion fall to them. If you don't like a decision, fork —
that's your right under AGPL.

## Scope

Applies to interactions in this repo (issues, PRs, discussions) and
any WhereTF-branded channels elsewhere.

## Enforcement

Report violations by emailing the maintainer (address in the commit
log). Warnings escalate to ban from project spaces. No appeals
process — this is a solo-run project, not a committee.

— The Maintainer
Loading
Loading