docs: sync architecture doc with current codebase
- Add REVIEW to TaskStatus enum - Fix stores list: remove phantom files, add solo-store and product-store - Fix SelectionStore method names (selectPbi/selectStory) - Add solo board route and product layout to file tree - Mark sprint/planning as redirect, not a full page - Update Zustand store count from 3 to 5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e6e6c96261
commit
767476aa8e
1 changed files with 44 additions and 13 deletions
|
|
@ -200,7 +200,7 @@ Scrum4Me is een desktop-first Next.js 16 webapplicatie die server-side wordt ger
|
||||||
| implementation_plan | String | nullable | Opgeslagen door Claude Code MCP via `PATCH /api/tasks/:id` |
|
| implementation_plan | String | nullable | Opgeslagen door Claude Code MCP via `PATCH /api/tasks/:id` |
|
||||||
| priority | Int | 1–4, not null | |
|
| priority | Int | 1–4, not null | |
|
||||||
| sort_order | Float | not null | |
|
| sort_order | Float | not null | |
|
||||||
| status | Enum | TO_DO \| IN_PROGRESS \| DONE | |
|
| status | Enum | TO_DO \| IN_PROGRESS \| REVIEW \| DONE | |
|
||||||
| created_at | DateTime | default now() | |
|
| created_at | DateTime | default now() | |
|
||||||
| updated_at | DateTime | auto-update | |
|
| updated_at | DateTime | auto-update | |
|
||||||
|
|
||||||
|
|
@ -288,6 +288,7 @@ enum StoryStatus {
|
||||||
enum TaskStatus {
|
enum TaskStatus {
|
||||||
TO_DO
|
TO_DO
|
||||||
IN_PROGRESS
|
IN_PROGRESS
|
||||||
|
REVIEW
|
||||||
DONE
|
DONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -525,10 +526,12 @@ scrum4me/
|
||||||
│ │ ├── products/
|
│ │ ├── products/
|
||||||
│ │ │ ├── new/page.tsx
|
│ │ │ ├── new/page.tsx
|
||||||
│ │ │ └── [id]/
|
│ │ │ └── [id]/
|
||||||
|
│ │ │ ├── layout.tsx # Zet actief product in Zustand store
|
||||||
│ │ │ ├── page.tsx # Product Backlog (gesplitst scherm)
|
│ │ │ ├── page.tsx # Product Backlog (gesplitst scherm)
|
||||||
|
│ │ │ ├── solo/page.tsx # Solo board (Kanban per ingelogde gebruiker)
|
||||||
│ │ │ ├── sprint/
|
│ │ │ ├── sprint/
|
||||||
│ │ │ │ ├── page.tsx # Sprint Backlog (gesplitst scherm)
|
│ │ │ │ ├── page.tsx # Sprint Backlog (drie-paneel scherm)
|
||||||
│ │ │ │ └── planning/page.tsx # Sprint Planning (gesplitst scherm)
|
│ │ │ │ └── planning/page.tsx # Redirect → /sprint
|
||||||
│ │ ├── todos/page.tsx
|
│ │ ├── todos/page.tsx
|
||||||
│ │ └── settings/
|
│ │ └── settings/
|
||||||
│ │ ├── page.tsx # Profiel, account, PB-overzicht, rollen, tokens
|
│ │ ├── page.tsx # Profiel, account, PB-overzicht, rollen, tokens
|
||||||
|
|
@ -567,13 +570,9 @@ scrum4me/
|
||||||
├── stores/ # Zustand stores
|
├── stores/ # Zustand stores
|
||||||
│ ├── planner-store.ts # Optimistische drag-and-drop volgorde
|
│ ├── planner-store.ts # Optimistische drag-and-drop volgorde
|
||||||
│ ├── selection-store.ts # Geselecteerd PBI / story
|
│ ├── selection-store.ts # Geselecteerd PBI / story
|
||||||
│ └── sprint-store.ts # Sprint Backlog interacties
|
│ ├── sprint-store.ts # Sprint Backlog taakvolgordes
|
||||||
│ ├── products.ts
|
│ ├── solo-store.ts # Solo board optimistische taakstatus
|
||||||
│ ├── pbis.ts
|
│ └── product-store.ts # Actief product (naam + id) voor navbar
|
||||||
│ ├── stories.ts
|
|
||||||
│ ├── sprints.ts
|
|
||||||
│ ├── tasks.ts
|
|
||||||
│ └── todos.ts
|
|
||||||
├── prisma/
|
├── prisma/
|
||||||
│ ├── schema.prisma
|
│ ├── schema.prisma
|
||||||
│ ├── migrations/
|
│ ├── migrations/
|
||||||
|
|
@ -608,7 +607,7 @@ scrum4me/
|
||||||
**Trade-off:** Redundante data vereist consistente updates. Gehandhaafd via Prisma-transacties in de service-laag.
|
**Trade-off:** Redundante data vereist consistente updates. Gehandhaafd via Prisma-transacties in de service-laag.
|
||||||
|
|
||||||
### Beslissing: Zustand voor client-side state management
|
### Beslissing: Zustand voor client-side state management
|
||||||
**Keuze:** Drie Zustand-stores naast Server Components
|
**Keuze:** Vijf Zustand-stores naast Server Components
|
||||||
**Rationale:** De gesplitste schermen met dnd-kit vereisen client-side staat die twee panelen tegelijk aanstuurt. `useState` per component leidt tot prop drilling; Context API veroorzaakt onnodige re-renders bij 60fps drag-events. Zustand's selector-gebaseerde subscriptions updaten alleen de componenten die de gewijzigde slice observeren. De gouden regel: Zustand beheert uitsluitend ephemere UI-staat — nooit server-data. Server-data blijft in Server Components en wordt opgehaald via Prisma.
|
**Rationale:** De gesplitste schermen met dnd-kit vereisen client-side staat die twee panelen tegelijk aanstuurt. `useState` per component leidt tot prop drilling; Context API veroorzaakt onnodige re-renders bij 60fps drag-events. Zustand's selector-gebaseerde subscriptions updaten alleen de componenten die de gewijzigde slice observeren. De gouden regel: Zustand beheert uitsluitend ephemere UI-staat — nooit server-data. Server-data blijft in Server Components en wordt opgehaald via Prisma.
|
||||||
**Trade-off:** Extra abstractielaag die geïnitialiseerd moet worden vanuit server-data. Opgelost via een patroon waarbij het Server Component de initiële ids doorgeeft aan een Client Component dat de store hydrateert.
|
**Trade-off:** Extra abstractielaag die geïnitialiseerd moet worden vanuit server-data. Opgelost via een patroon waarbij het Server Component de initiële ids doorgeeft aan een Client Component dat de store hydrateert.
|
||||||
|
|
||||||
|
|
@ -678,8 +677,8 @@ Beheert welk PBI of story geselecteerd is in het linkerpaneel, zodat beide panel
|
||||||
interface SelectionStore {
|
interface SelectionStore {
|
||||||
selectedPbiId: string | null
|
selectedPbiId: string | null
|
||||||
selectedStoryId: string | null
|
selectedStoryId: string | null
|
||||||
setSelectedPbi: (id: string | null) => void
|
selectPbi: (id: string | null) => void
|
||||||
setSelectedStory: (id: string | null) => void
|
selectStory: (id: string | null) => void
|
||||||
clearSelection: () => void
|
clearSelection: () => void
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -706,6 +705,38 @@ interface SprintStore {
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### `useSoloStore` — Solo board optimistische taakstatus
|
||||||
|
|
||||||
|
Beheert de taakstatus van de ingelogde gebruiker op het solo Kanban-board. Ondersteunt optimistische verplaatsingen tussen kolommen met rollback bij serverfout.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// stores/solo-store.ts
|
||||||
|
interface SoloStore {
|
||||||
|
tasks: Record<string, SoloTask>
|
||||||
|
initTasks: (tasks: SoloTask[]) => void
|
||||||
|
optimisticMove: (taskId: string, toStatus: TaskStatus) => TaskStatus | null
|
||||||
|
rollback: (taskId: string, prevStatus: TaskStatus) => void
|
||||||
|
updatePlan: (taskId: string, plan: string | null) => void
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### `useProductStore` — Actief product voor navbar
|
||||||
|
|
||||||
|
Houdt het actief geselecteerde product (id + naam) bij zodat de navbar de productnaam kan tonen zonder prop drilling door de layout-hiërarchie.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
// stores/product-store.ts
|
||||||
|
interface ProductStore {
|
||||||
|
currentProduct: { id: string; name: string } | null
|
||||||
|
setCurrentProduct: (id: string, name: string) => void
|
||||||
|
clearCurrentProduct: () => void
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Data flow architectuur
|
## Data flow architectuur
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue