# washingtonolv/checklist architecture

> Architecture diagram of the GitHub repository washingtonolv/checklist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/washingtonolv/checklist
- Repository: https://github.com/washingtonolv/checklist

## Overview

Checklist Operacional D&D is a Next.js application for managing store routines across commercial admins, supervisors, and store managers. Users review dashboard indicators, work through recurring activities, record observations and photo evidence, and supervisors review completion; administrators maintain stores, users, categories, and task templates. Reports and history provide monitoring and audit views. The backend selector chooses local demo data or Supabase. The graph reflects README capabilities and relationships visible in the supplied excerpts and source index; unsampled implementations are represented at their known paths, without inferring their internal calls.

Main entry points: [`src/lib/backend/index.ts`](https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/index.ts) (Backend selection), [`src/components/layout/ManagerRoutine.tsx`](https://github.com/washingtonolv/checklist/blob/main/src/components/layout/ManagerRoutine.tsx) (Manager routine view), [`src/app/(app)/painel/page.tsx`](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/painel/page.tsx) (Management dashboard), [`src/app/(app)/atividades/[id]/page.tsx`](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/atividades/%5Bid%5D/page.tsx) (Activity checklists)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Management dashboard<br/>[page.tsx]"]
end

subgraph group_operations["Routine operations"]
  node_activity["Activity checklists<br/>[page.tsx]"]
  node_routine["Manager routine view<br/>[ManagerRoutine.tsx]"]
  node_taskactions["Task actions<br/>[TaskActions.tsx]"]
  node_photos["Photo evidence<br/>[PhotoUploader.tsx]"]
  node_evidence_route["Evidence delivery<br/>[route.ts]"]
  node_task_generation["Scheduled generation<br/>[route.ts]"]
end

subgraph group_management["Administration and insights"]
  node_templates["Task templates<br/>[templates.ts]"]
  node_template_form["Template editor<br/>[TemplateForm.tsx]"]
  node_stores["Store management<br/>[stores.ts]"]
  node_users["User management<br/>[users.ts]"]
  node_categories["Category management<br/>[categories.ts]"]
  node_reports["Reports and exports<br/>[page.tsx]"]
  node_history["Activity history<br/>[page.tsx]"]
end

subgraph group_platform["Application platform"]
  node_auth["Authentication actions<br/>[auth.ts]"]
  node_session["Server session access<br/>[auth-server.ts]"]
  node_backend_selector["Backend selection<br/>[index.ts]"]
  node_local_backend["Local demo backend<br/>[index.ts]"]
  node_local_db[("Local data store<br/>[db.ts]")]
  node_supabase_backend["Supabase backend<br/>[index.ts]"]
  node_supabase_store[("Supabase data and storage<br/>[server.ts]")]
  node_routine_rules["Routine date rules<br/>[manager-routine.ts]"]
  node_dashboard_logic["Dashboard calculations<br/>[dashboard.ts]"]
end

node_staff(("Store staff"))
node_reviewers(("Supervisors and admins"))

node_staff -->|"works through"| node_routine
node_routine -.->|"opens activities"| node_activity
node_activity -.->|"records progress"| node_taskactions
node_taskactions -.->|"adds evidence"| node_photos
node_photos -.->|"serves evidence"| node_evidence_route
node_reviewers -->|"reviews execution"| node_dashboard
node_dashboard -.->|"uses calculations"| node_dashboard_logic
node_dashboard -->|"renders routine"| node_routine
node_routine -->|"loads stores and tasks"| node_backend_selector
node_routine -->|"applies date rules"| node_routine_rules
node_template_form -->|"submits templates"| node_templates
node_task_generation -->|"requests generation"| node_backend_selector
node_reviewers -->|"maintains stores"| node_stores
node_reviewers -->|"maintains users"| node_users
node_reviewers -->|"organizes routines"| node_categories
node_reviewers -->|"configures routines"| node_templates
node_reviewers -->|"reviews reports"| node_reports
node_reviewers -->|"reviews audit trail"| node_history
node_auth -->|"uses backend"| node_backend_selector
node_session -->|"gets session"| node_backend_selector
node_backend_selector -->|"selects local mode"| node_local_backend
node_backend_selector -->|"selects Supabase mode"| node_supabase_backend
node_local_backend -.->|"uses local data"| node_local_db
node_supabase_backend -->|"queries and stores data"| node_supabase_store
node_activity -->|"loads activities"| node_backend_selector
node_reports -->|"loads report data"| node_backend_selector
node_history -->|"loads history"| node_backend_selector
node_dashboard -->|"loads dashboard data"| node_backend_selector

click node_dashboard "https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/painel/page.tsx"
click node_activity "https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/atividades/%5Bid%5D/page.tsx"
click node_routine "https://github.com/washingtonolv/checklist/blob/main/src/components/layout/ManagerRoutine.tsx"
click node_taskactions "https://github.com/washingtonolv/checklist/blob/main/src/components/tasks/TaskActions.tsx"
click node_photos "https://github.com/washingtonolv/checklist/blob/main/src/components/photos/PhotoUploader.tsx"
click node_evidence_route "https://github.com/washingtonolv/checklist/blob/main/src/app/api/evidencias/%5B...path%5D/route.ts"
click node_task_generation "https://github.com/washingtonolv/checklist/blob/main/src/app/api/cron/gerar/route.ts"
click node_templates "https://github.com/washingtonolv/checklist/blob/main/src/actions/templates.ts"
click node_template_form "https://github.com/washingtonolv/checklist/blob/main/src/components/forms/TemplateForm.tsx"
click node_stores "https://github.com/washingtonolv/checklist/blob/main/src/actions/stores.ts"
click node_users "https://github.com/washingtonolv/checklist/blob/main/src/actions/users.ts"
click node_categories "https://github.com/washingtonolv/checklist/blob/main/src/actions/categories.ts"
click node_reports "https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/relatorios/page.tsx"
click node_history "https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/historico/page.tsx"
click node_auth "https://github.com/washingtonolv/checklist/blob/main/src/actions/auth.ts"
click node_session "https://github.com/washingtonolv/checklist/blob/main/src/lib/auth-server.ts"
click node_backend_selector "https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/index.ts"
click node_local_backend "https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/local/index.ts"
click node_local_db "https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/local/db.ts"
click node_supabase_backend "https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/supabase/index.ts"
click node_supabase_store "https://github.com/washingtonolv/checklist/blob/main/src/lib/supabase/server.ts"
click node_routine_rules "https://github.com/washingtonolv/checklist/blob/main/src/lib/manager-routine.ts"
click node_dashboard_logic "https://github.com/washingtonolv/checklist/blob/main/src/lib/dashboard.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard toneBlue
class node_activity,node_routine,node_taskactions,node_photos,node_evidence_route,node_task_generation toneAmber
class node_templates,node_template_form,node_stores,node_users,node_categories,node_reports,node_history toneMint
class node_auth,node_session,node_backend_selector,node_local_backend,node_local_db,node_supabase_backend,node_supabase_store,node_routine_rules,node_dashboard_logic toneRose
class node_staff,node_reviewers toneIndigo
```

## Components

### User experience

- [Management dashboard](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/painel/page.tsx): `src/app/(app)/painel/page.tsx`

### Routine operations

- [Activity checklists](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/atividades/%5Bid%5D/page.tsx): `src/app/(app)/atividades/[id]/page.tsx`
- [Manager routine view](https://github.com/washingtonolv/checklist/blob/main/src/components/layout/ManagerRoutine.tsx): `src/components/layout/ManagerRoutine.tsx`
- [Task actions](https://github.com/washingtonolv/checklist/blob/main/src/components/tasks/TaskActions.tsx): `src/components/tasks/TaskActions.tsx`
- [Photo evidence](https://github.com/washingtonolv/checklist/blob/main/src/components/photos/PhotoUploader.tsx): `src/components/photos/PhotoUploader.tsx`
- [Evidence delivery](https://github.com/washingtonolv/checklist/blob/main/src/app/api/evidencias/%5B...path%5D/route.ts): `src/app/api/evidencias/[...path]/route.ts`
- [Scheduled generation](https://github.com/washingtonolv/checklist/blob/main/src/app/api/cron/gerar/route.ts): `src/app/api/cron/gerar/route.ts`

### Administration and insights

- [Task templates](https://github.com/washingtonolv/checklist/blob/main/src/actions/templates.ts): `src/actions/templates.ts`
- [Template editor](https://github.com/washingtonolv/checklist/blob/main/src/components/forms/TemplateForm.tsx): `src/components/forms/TemplateForm.tsx`
- [Store management](https://github.com/washingtonolv/checklist/blob/main/src/actions/stores.ts): `src/actions/stores.ts`
- [User management](https://github.com/washingtonolv/checklist/blob/main/src/actions/users.ts): `src/actions/users.ts`
- [Category management](https://github.com/washingtonolv/checklist/blob/main/src/actions/categories.ts): `src/actions/categories.ts`
- [Reports and exports](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/relatorios/page.tsx): `src/app/(app)/relatorios/page.tsx`
- [Activity history](https://github.com/washingtonolv/checklist/blob/main/src/app/(app)/historico/page.tsx): `src/app/(app)/historico/page.tsx`

### Application platform

- [Authentication actions](https://github.com/washingtonolv/checklist/blob/main/src/actions/auth.ts): `src/actions/auth.ts`
- [Server session access](https://github.com/washingtonolv/checklist/blob/main/src/lib/auth-server.ts): `src/lib/auth-server.ts`
- [Backend selection](https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/index.ts): `src/lib/backend/index.ts`
- [Local demo backend](https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/local/index.ts): `src/lib/backend/local/index.ts`
- [Local data store](https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/local/db.ts): `src/lib/backend/local/db.ts`
- [Supabase backend](https://github.com/washingtonolv/checklist/blob/main/src/lib/backend/supabase/index.ts): `src/lib/backend/supabase/index.ts`
- [Supabase data and storage](https://github.com/washingtonolv/checklist/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Routine date rules](https://github.com/washingtonolv/checklist/blob/main/src/lib/manager-routine.ts): `src/lib/manager-routine.ts`
- [Dashboard calculations](https://github.com/washingtonolv/checklist/blob/main/src/lib/dashboard.ts): `src/lib/dashboard.ts`

### Other components

- **Store staff**
- **Supervisors and admins**

## Connections

- Store staff → Manager routine view: works through (evidence: `README.md`)
- Manager routine view → Activity checklists: opens activities
- Activity checklists → Task actions: records progress
- Task actions → Photo evidence: adds evidence
- Photo evidence → Evidence delivery: serves evidence
- Supervisors and admins → Management dashboard: reviews execution (evidence: `README.md`)
- Management dashboard → Dashboard calculations: uses calculations (evidence: `src/app/(app)/painel/page.tsx`)
- Management dashboard → Manager routine view: renders routine (evidence: `src/app/(app)/painel/page.tsx`)
- Manager routine view → Backend selection: loads stores and tasks (evidence: `src/components/layout/ManagerRoutine.tsx`)
- Manager routine view → Routine date rules: applies date rules (evidence: `src/components/layout/ManagerRoutine.tsx`)
- Template editor → Task templates: submits templates (evidence: `src/components/forms/TemplateForm.tsx`)
- Scheduled generation → Backend selection: requests generation (evidence: `src/app/api/cron/gerar/route.ts`)
- Supervisors and admins → Store management: maintains stores (evidence: `README.md`)
- Supervisors and admins → User management: maintains users (evidence: `README.md`)
- Supervisors and admins → Category management: organizes routines (evidence: `README.md`)
- Supervisors and admins → Task templates: configures routines (evidence: `README.md`)
- Supervisors and admins → Reports and exports: reviews reports (evidence: `README.md`)
- Supervisors and admins → Activity history: reviews audit trail (evidence: `README.md`)
- Authentication actions → Backend selection: uses backend (evidence: `src/actions/auth.ts`)
- Server session access → Backend selection: gets session (evidence: `src/lib/auth-server.ts`)
- Backend selection → Local demo backend: selects local mode (evidence: `src/lib/backend/index.ts`)
- Backend selection → Supabase backend: selects Supabase mode (evidence: `src/lib/backend/index.ts`)
- Local demo backend → Local data store: uses local data
- Supabase backend → Supabase data and storage: queries and stores data (evidence: `src/lib/backend/supabase/index.ts`)
- Activity checklists → Backend selection: loads activities
- Reports and exports → Backend selection: loads report data (evidence: `src/app/(app)/relatorios/page.tsx`)
- Activity history → Backend selection: loads history (evidence: `src/app/(app)/historico/page.tsx`)
- Management dashboard → Backend selection: loads dashboard data (evidence: `src/app/(app)/painel/page.tsx`)
