# minuteflow-online/minuteflow architecture

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

- Interactive diagram: https://gitdiagram.com/minuteflow-online/minuteflow
- Repository: https://github.com/minuteflow-online/minuteflow

## Overview

This repository is a workforce-operations platform: web and desktop clients support task assignment and execution, time/screenshot monitoring, submissions, team communication, and administrative finance workflows. The main web workflow is staff managing tasks through the project/task interface and API-backed assignment operations; the desktop client supports VA task work and capture. The README is a generic Next.js starter, so product capabilities are inferred from the tree and source index. Unsampled branches are represented by their directory paths; their internal wiring is not asserted.

Main entry points: [`src/lib/supabase/server.ts`](https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/supabase/server.ts) (Supabase services), [`src/lib/taskSchedule.ts`](https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/taskSchedule.ts) (Schedule rules), [`src/app/api/assigned-tasks/route.ts`](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/assigned-tasks/route.ts) (Assigned-task API), [`src/app/api/broadcasts/route.ts`](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/broadcasts/route.ts) (Broadcasts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_work["Task Operations"]
  node_project_tasks["Project tasks"]
  node_task_management["Task management"]
  node_task_api["Assigned-task API<br/>[route.ts]"]
  node_task_detail_api["Task updates<br/>[route.ts]"]
  node_recurring_ui["Recurring tasks"]
  node_recurring_api["Recurring API<br/>[route.ts]"]
  node_schedule["Schedule rules<br/>[taskSchedule.ts]"]
end

subgraph group_clients["Staff Clients"]
  node_desktop["Desktop app<br/>[App.tsx]"]
  node_desktop_tasks["Desktop task access<br/>[tasks.ts]"]
  node_desktop_store["Desktop data access<br/>[db.ts]"]
  node_messages["Team messaging"]
end

subgraph group_monitor["Work Monitoring"]
  node_capture["Screen capture"]
  node_submissions["Work submissions<br/>[route.ts]"]
  node_monitor_pages["Monitoring views"]
end

subgraph group_admin["Administration &amp; Finance"]
  node_admin_pages["Admin console"]
  node_payroll["Payroll &amp; paystubs<br/>[route.ts]"]
  node_broadcasts["Broadcasts<br/>[route.ts]"]
end

subgraph group_platform["Platform Services"]
  node_auth["Session &amp; auth<br/>[SessionContext.tsx]"]
  node_supabase[("Supabase services<br/>[server.ts]")]
  node_schema["Data model<br/>[database.ts]"]
end

node_staff(("Staff user"))
node_adminuser(("Admin user"))
node_email["Email delivery"]
node_telegram["Telegram"]

node_staff -->|"uses"| node_project_tasks
node_project_tasks -->|"renders"| node_task_management
node_adminuser -->|"uses"| node_admin_pages
node_task_api -->|"queries"| node_supabase
node_task_api -->|"checks budgets"| node_schedule
node_task_detail_api -->|"updates"| node_supabase
node_task_detail_api -->|"checks schedule"| node_schedule
node_recurring_ui -->|"uses"| node_schedule
node_recurring_api -->|"accesses"| node_supabase
node_recurring_api -->|"uses"| node_schedule
node_desktop -->|"fetches tasks"| node_desktop_tasks
node_desktop_tasks -->|"authenticates"| node_desktop_store
node_desktop -->|"renders"| node_messages
node_submissions -->|"queries"| node_supabase
node_payroll -->|"queries"| node_supabase
node_payroll -->|"sends paystub"| node_email
node_broadcasts -->|"accesses"| node_supabase
node_broadcasts -->|"sends email"| node_email
node_broadcasts -->|"notifies"| node_telegram
node_auth -->|"creates client"| node_supabase
node_task_api -.->|"uses types"| node_schema
node_capture -.->|"stores capture data"| node_supabase
node_monitor_pages -.->|"reviews capture"| node_capture

click node_project_tasks "https://github.com/minuteflow-online/minuteflow/blob/main/src/components/ProjectsTasksTab.tsx"
click node_task_management "https://github.com/minuteflow-online/minuteflow/blob/main/src/components/TaskManagementSection.tsx"
click node_task_api "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/assigned-tasks/route.ts"
click node_task_detail_api "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/assigned-tasks/%5Bid%5D/route.ts"
click node_recurring_ui "https://github.com/minuteflow-online/minuteflow/blob/main/src/components/RecurringTemplatesManager.tsx"
click node_recurring_api "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/recurring-task-templates/route.ts"
click node_schedule "https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/taskSchedule.ts"
click node_desktop "https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/App.tsx"
click node_desktop_tasks "https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/lib/tasks.ts"
click node_desktop_store "https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/lib/db.ts"
click node_messages "https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/components/MessageBoardPanel.tsx"
click node_capture "https://github.com/minuteflow-online/minuteflow/blob/main/src/contexts/ScreenCaptureProvider.tsx"
click node_submissions "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/submissions/route.ts"
click node_monitor_pages "https://github.com/minuteflow-online/minuteflow/tree/main/src/app/(app)/(monitoring)"
click node_admin_pages "https://github.com/minuteflow-online/minuteflow/tree/main/src/app/(admin)"
click node_payroll "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/paystub/send/route.ts"
click node_broadcasts "https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/broadcasts/route.ts"
click node_auth "https://github.com/minuteflow-online/minuteflow/blob/main/src/contexts/SessionContext.tsx"
click node_supabase "https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/supabase/server.ts"
click node_schema "https://github.com/minuteflow-online/minuteflow/blob/main/src/types/database.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_project_tasks,node_task_management,node_task_api,node_task_detail_api,node_recurring_ui,node_recurring_api,node_schedule,node_staff,node_adminuser toneBlue
class node_desktop,node_desktop_tasks,node_desktop_store,node_messages toneAmber
class node_capture,node_submissions,node_monitor_pages toneMint
class node_admin_pages,node_payroll,node_broadcasts toneRose
class node_auth,node_supabase,node_schema,node_email,node_telegram toneIndigo
```

## Components

### Task Operations

- [Project tasks](https://github.com/minuteflow-online/minuteflow/blob/main/src/components/ProjectsTasksTab.tsx): `src/components/ProjectsTasksTab.tsx`
- [Task management](https://github.com/minuteflow-online/minuteflow/blob/main/src/components/TaskManagementSection.tsx): `src/components/TaskManagementSection.tsx`
- [Assigned-task API](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/assigned-tasks/route.ts): `src/app/api/assigned-tasks/route.ts`
- [Task updates](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/assigned-tasks/%5Bid%5D/route.ts): `src/app/api/assigned-tasks/[id]/route.ts`
- [Recurring tasks](https://github.com/minuteflow-online/minuteflow/blob/main/src/components/RecurringTemplatesManager.tsx): `src/components/RecurringTemplatesManager.tsx`
- [Recurring API](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/recurring-task-templates/route.ts): `src/app/api/recurring-task-templates/route.ts`
- [Schedule rules](https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/taskSchedule.ts): `src/lib/taskSchedule.ts`

### Staff Clients

- [Desktop app](https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/App.tsx): `desktop/src/App.tsx`
- [Desktop task access](https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/lib/tasks.ts): `desktop/src/lib/tasks.ts`
- [Desktop data access](https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/lib/db.ts): `desktop/src/lib/db.ts`
- [Team messaging](https://github.com/minuteflow-online/minuteflow/blob/main/desktop/src/components/MessageBoardPanel.tsx): `desktop/src/components/MessageBoardPanel.tsx`

### Work Monitoring

- [Screen capture](https://github.com/minuteflow-online/minuteflow/blob/main/src/contexts/ScreenCaptureProvider.tsx): `src/contexts/ScreenCaptureProvider.tsx`
- [Work submissions](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/submissions/route.ts): `src/app/api/submissions/route.ts`
- [Monitoring views](https://github.com/minuteflow-online/minuteflow/tree/main/src/app/(app)/(monitoring)): `src/app/(app)/(monitoring)`

### Administration & Finance

- [Admin console](https://github.com/minuteflow-online/minuteflow/tree/main/src/app/(admin)): `src/app/(admin)`
- [Payroll & paystubs](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/paystub/send/route.ts): `src/app/api/paystub/send/route.ts`
- [Broadcasts](https://github.com/minuteflow-online/minuteflow/blob/main/src/app/api/broadcasts/route.ts): `src/app/api/broadcasts/route.ts`

### Platform Services

- [Session & auth](https://github.com/minuteflow-online/minuteflow/blob/main/src/contexts/SessionContext.tsx): `src/contexts/SessionContext.tsx`
- [Supabase services](https://github.com/minuteflow-online/minuteflow/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Data model](https://github.com/minuteflow-online/minuteflow/blob/main/src/types/database.ts): `src/types/database.ts`

### Other components

- **Staff user**
- **Admin user**
- **Email delivery**
- **Telegram**

## Connections

- Staff user → Project tasks: uses
- Project tasks → Task management: renders (evidence: `src/components/ProjectsTasksTab.tsx`)
- Admin user → Admin console: uses
- Assigned-task API → Supabase services: queries (evidence: `src/app/api/assigned-tasks/route.ts`)
- Assigned-task API → Schedule rules: checks budgets (evidence: `src/app/api/assigned-tasks/route.ts`)
- Task updates → Supabase services: updates (evidence: `src/app/api/assigned-tasks/[id]/route.ts`)
- Task updates → Schedule rules: checks schedule (evidence: `src/app/api/assigned-tasks/[id]/route.ts`)
- Recurring tasks → Schedule rules: uses (evidence: `src/components/RecurringTemplatesManager.tsx`)
- Recurring API → Supabase services: accesses (evidence: `src/app/api/recurring-task-templates/route.ts`)
- Recurring API → Schedule rules: uses (evidence: `src/app/api/recurring-task-templates/route.ts`)
- Desktop app → Desktop task access: fetches tasks (evidence: `desktop/src/App.tsx`)
- Desktop task access → Desktop data access: authenticates (evidence: `desktop/src/lib/tasks.ts`)
- Desktop app → Team messaging: renders (evidence: `desktop/src/App.tsx`)
- Work submissions → Supabase services: queries (evidence: `src/app/api/submissions/route.ts`)
- Payroll & paystubs → Supabase services: queries (evidence: `src/app/api/paystub/send/route.ts`)
- Payroll & paystubs → Email delivery: sends paystub (evidence: `src/app/api/paystub/send/route.ts`)
- Broadcasts → Supabase services: accesses (evidence: `src/app/api/broadcasts/route.ts`)
- Broadcasts → Email delivery: sends email (evidence: `src/app/api/broadcasts/route.ts`)
- Broadcasts → Telegram: notifies (evidence: `src/app/api/broadcasts/route.ts`)
- Session & auth → Supabase services: creates client (evidence: `src/contexts/SessionContext.tsx`)
- Assigned-task API → Data model: uses types
- Screen capture → Supabase services: stores capture data
- Monitoring views → Screen capture: reviews capture
