# itigges22/movalab architecture

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

- Interactive diagram: https://gitdiagram.com/itigges22/movalab
- Repository: https://github.com/itigges22/movalab

## Overview

MovaLab is a self-hosted professional-services automation platform for agencies. The principal workflow is: an authenticated team member manages projects and tasks, records time and availability, and uses capacity analytics to decide whether work can be accepted; workflows and the client portal provide governed handoffs and external visibility. Sampled routes confirm Supabase-backed authorization, project/task/time operations, and capacity calculations. Workflow, analytics, and portal branches are represented from the documented capabilities and tree, but their internal call wiring was not sampled.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Identity and Access"]
  node_login["Login and Signup<br/>[page.tsx]"]
  node_auth["Authentication<br/>[auth-server.ts]"]
  node_access["Access Control"]
  node_roles_api["Roles API<br/>[route.ts]"]
end

subgraph group_g2["Projects and Tasks"]
  node_projects_ui["Project Workspace<br/>[page.tsx]"]
  node_projects_api["Projects API<br/>[route.ts]"]
  node_tasks_api["Tasks API<br/>[route.ts]"]
  node_task_service["Task Service<br/>[task-service-db.ts]"]
end

subgraph group_g3["Time and Capacity"]
  node_time_ui["Time Tracking<br/>[page.tsx]"]
  node_time_api["Time Entries API<br/>[route.ts]"]
  node_clock_api["Clock API<br/>[route.ts]"]
  node_availability_api["Availability API<br/>[route.ts]"]
  node_availability_service["Availability Service"]
  node_capacity_ui["Capacity Dashboard<br/>[page.tsx]"]
  node_capacity_api["Capacity APIs"]
end

subgraph group_g4["Workflows and Clients"]
  node_workflow_ui["Workflow Builder"]
  node_workflow_api["Workflow APIs"]
  node_workflow_execution["Workflow Execution"]
  node_client_ui["Client Portal<br/>[page.tsx]"]
  node_client_api["Client Portal API<br/>[route.ts]"]
end

subgraph group_g5["Insights and Administration"]
  node_roles_ui["Role Administration<br/>[page.tsx]"]
  node_analytics_ui["Analytics Dashboard<br/>[page.tsx]"]
  node_analytics_api["Analytics APIs"]
end

node_actor(("Team or Client"))
node_database[("Supabase PostgreSQL")]
node_mailer["Email Delivery<br/>[mailer.ts]"]

node_actor -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_roles_ui -->|"manages roles"| node_roles_api
node_roles_api -->|"checks permission"| node_access
node_roles_api -->|"reads/writes"| node_database
node_actor -->|"manages work"| node_projects_ui
node_projects_ui -->|"loads projects"| node_projects_api
node_projects_api -->|"checks access"| node_access
node_projects_api -->|"reads/writes"| node_database
node_tasks_api -->|"checks project access"| node_access
node_tasks_api -->|"updates tasks"| node_task_service
node_task_service -->|"reads/writes"| node_database
node_actor -->|"logs time"| node_time_ui
node_time_ui -->|"submits entries"| node_time_api
node_time_api -->|"checks permission"| node_access
node_time_api -->|"reads/writes"| node_database
node_clock_api -->|"records sessions"| node_database
node_availability_api -->|"manages availability"| node_availability_service
node_actor -->|"reviews capacity"| node_capacity_ui
node_capacity_ui -->|"loads utilization"| node_capacity_api
node_capacity_api -->|"checks visibility"| node_access
node_capacity_api -->|"reads schedules"| node_database
node_workflow_ui -->|"edits workflows"| node_workflow_api
node_workflow_api -->|"starts workflows"| node_workflow_execution
node_actor -->|"reviews projects"| node_client_ui
node_client_ui -->|"approves or comments"| node_client_api
node_client_api -->|"reads/writes"| node_database
node_analytics_ui -->|"loads metrics"| node_analytics_api
node_analytics_api -->|"reads data"| node_database
node_client_api -.->|"sends invitations"| node_mailer

click node_login "https://github.com/itigges22/movalab/blob/main/app/login/page.tsx"
click node_auth "https://github.com/itigges22/movalab/blob/main/lib/auth-server.ts"
click node_access "https://github.com/itigges22/movalab/blob/main/lib/access-control-server.ts"
click node_roles_ui "https://github.com/itigges22/movalab/blob/main/app/admin/roles/page.tsx"
click node_roles_api "https://github.com/itigges22/movalab/blob/main/app/api/roles/route.ts"
click node_projects_ui "https://github.com/itigges22/movalab/blob/main/app/projects/page.tsx"
click node_projects_api "https://github.com/itigges22/movalab/blob/main/app/api/projects/route.ts"
click node_tasks_api "https://github.com/itigges22/movalab/blob/main/app/api/tasks/%5BtaskId%5D/route.ts"
click node_task_service "https://github.com/itigges22/movalab/blob/main/lib/task-service-db.ts"
click node_time_ui "https://github.com/itigges22/movalab/blob/main/app/time-entries/page.tsx"
click node_time_api "https://github.com/itigges22/movalab/blob/main/app/api/time-entries/route.ts"
click node_clock_api "https://github.com/itigges22/movalab/blob/main/app/api/clock/route.ts"
click node_availability_api "https://github.com/itigges22/movalab/blob/main/app/api/availability/route.ts"
click node_availability_service "https://github.com/itigges22/movalab/blob/main/lib/services/availability-service.ts"
click node_capacity_ui "https://github.com/itigges22/movalab/blob/main/app/capacity/page.tsx"
click node_capacity_api "https://github.com/itigges22/movalab/tree/main/app/api/capacity"
click node_workflow_ui "https://github.com/itigges22/movalab/blob/main/components/workflow-editor/workflow-canvas.tsx"
click node_workflow_api "https://github.com/itigges22/movalab/tree/main/app/api/workflows"
click node_workflow_execution "https://github.com/itigges22/movalab/blob/main/lib/workflow-execution-service.ts"
click node_client_ui "https://github.com/itigges22/movalab/blob/main/app/(client-portal)/client-portal/page.tsx"
click node_client_api "https://github.com/itigges22/movalab/blob/main/app/api/client/portal/projects/route.ts"
click node_analytics_ui "https://github.com/itigges22/movalab/blob/main/app/analytics/page.tsx"
click node_analytics_api "https://github.com/itigges22/movalab/tree/main/app/api/analytics"
click node_mailer "https://github.com/itigges22/movalab/blob/main/lib/email/mailer.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_login,node_auth,node_access,node_roles_api,node_actor toneBlue
class node_projects_ui,node_projects_api,node_tasks_api,node_task_service,node_database toneAmber
class node_time_ui,node_time_api,node_clock_api,node_availability_api,node_availability_service,node_capacity_ui,node_capacity_api toneMint
class node_workflow_ui,node_workflow_api,node_workflow_execution,node_client_ui,node_client_api toneRose
class node_roles_ui,node_analytics_ui,node_analytics_api toneIndigo
class node_mailer toneTeal
```

## Components

### Identity and Access

- [Login and Signup](https://github.com/itigges22/movalab/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Authentication](https://github.com/itigges22/movalab/blob/main/lib/auth-server.ts): `lib/auth-server.ts`
- [Access Control](https://github.com/itigges22/movalab/blob/main/lib/access-control-server.ts): `lib/access-control-server.ts`
- [Roles API](https://github.com/itigges22/movalab/blob/main/app/api/roles/route.ts): `app/api/roles/route.ts`

### Projects and Tasks

- [Project Workspace](https://github.com/itigges22/movalab/blob/main/app/projects/page.tsx): `app/projects/page.tsx`
- [Projects API](https://github.com/itigges22/movalab/blob/main/app/api/projects/route.ts): `app/api/projects/route.ts`
- [Tasks API](https://github.com/itigges22/movalab/blob/main/app/api/tasks/%5BtaskId%5D/route.ts): `app/api/tasks/[taskId]/route.ts`
- [Task Service](https://github.com/itigges22/movalab/blob/main/lib/task-service-db.ts): `lib/task-service-db.ts`

### Time and Capacity

- [Time Tracking](https://github.com/itigges22/movalab/blob/main/app/time-entries/page.tsx): `app/time-entries/page.tsx`
- [Time Entries API](https://github.com/itigges22/movalab/blob/main/app/api/time-entries/route.ts): `app/api/time-entries/route.ts`
- [Clock API](https://github.com/itigges22/movalab/blob/main/app/api/clock/route.ts): `app/api/clock/route.ts`
- [Availability API](https://github.com/itigges22/movalab/blob/main/app/api/availability/route.ts): `app/api/availability/route.ts`
- [Availability Service](https://github.com/itigges22/movalab/blob/main/lib/services/availability-service.ts): `lib/services/availability-service.ts`
- [Capacity Dashboard](https://github.com/itigges22/movalab/blob/main/app/capacity/page.tsx): `app/capacity/page.tsx`
- [Capacity APIs](https://github.com/itigges22/movalab/tree/main/app/api/capacity): `app/api/capacity`

### Workflows and Clients

- [Workflow Builder](https://github.com/itigges22/movalab/blob/main/components/workflow-editor/workflow-canvas.tsx): `components/workflow-editor/workflow-canvas.tsx`
- [Workflow APIs](https://github.com/itigges22/movalab/tree/main/app/api/workflows): `app/api/workflows`
- [Workflow Execution](https://github.com/itigges22/movalab/blob/main/lib/workflow-execution-service.ts): `lib/workflow-execution-service.ts`
- [Client Portal](https://github.com/itigges22/movalab/blob/main/app/(client-portal)/client-portal/page.tsx): `app/(client-portal)/client-portal/page.tsx`
- [Client Portal API](https://github.com/itigges22/movalab/blob/main/app/api/client/portal/projects/route.ts): `app/api/client/portal/projects/route.ts`

### Insights and Administration

- [Role Administration](https://github.com/itigges22/movalab/blob/main/app/admin/roles/page.tsx): `app/admin/roles/page.tsx`
- [Analytics Dashboard](https://github.com/itigges22/movalab/blob/main/app/analytics/page.tsx): `app/analytics/page.tsx`
- [Analytics APIs](https://github.com/itigges22/movalab/tree/main/app/api/analytics): `app/api/analytics`

### Other components

- **Team or Client**
- **Supabase PostgreSQL**
- [Email Delivery](https://github.com/itigges22/movalab/blob/main/lib/email/mailer.ts): `lib/email/mailer.ts`

## Connections

- Team or Client → Login and Signup: signs in
- Login and Signup → Authentication: authenticates
- Role Administration → Roles API: manages roles
- Roles API → Access Control: checks permission
- Roles API → Supabase PostgreSQL: reads/writes
- Team or Client → Project Workspace: manages work
- Project Workspace → Projects API: loads projects
- Projects API → Access Control: checks access
- Projects API → Supabase PostgreSQL: reads/writes
- Tasks API → Access Control: checks project access
- Tasks API → Task Service: updates tasks
- Task Service → Supabase PostgreSQL: reads/writes
- Team or Client → Time Tracking: logs time
- Time Tracking → Time Entries API: submits entries
- Time Entries API → Access Control: checks permission
- Time Entries API → Supabase PostgreSQL: reads/writes
- Clock API → Supabase PostgreSQL: records sessions
- Availability API → Availability Service: manages availability
- Team or Client → Capacity Dashboard: reviews capacity
- Capacity Dashboard → Capacity APIs: loads utilization
- Capacity APIs → Access Control: checks visibility
- Capacity APIs → Supabase PostgreSQL: reads schedules
- Workflow Builder → Workflow APIs: edits workflows
- Workflow APIs → Workflow Execution: starts workflows
- Team or Client → Client Portal: reviews projects
- Client Portal → Client Portal API: approves or comments
- Client Portal API → Supabase PostgreSQL: reads/writes
- Analytics Dashboard → Analytics APIs: loads metrics
- Analytics APIs → Supabase PostgreSQL: reads data
- Client Portal API → Email Delivery: sends invitations
