# contactautopilotoffices-oss/saas_one architecture

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

- Interactive diagram: https://gitdiagram.com/contactautopilotoffices-oss/saas_one
- Repository: https://github.com/contactautopilotoffices-oss/saas_one

## Overview

This is a multi-tenant property and commercial-operations platform, despite the README’s generic “Task Manager App” description. Users work across property service operations, procurement and accounts, utilities, CRM, and AI-assisted workflows. The clearest sampled runtime path is ticket creation: the ticket API authenticates the caller, resolves classification, then requests intelligent assignment. The excerpts also establish a CRM call-coaching pipeline and a document-storage helper. Other capabilities are represented from the route and page tree; their internal wiring was not sampled, so those links are intentionally omitted.

Main entry points: [`backend/lib/coaching/pipeline.ts`](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/pipeline.ts) (Call coaching pipeline), [`app/api/tickets/route.ts`](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/app/api/tickets/route.ts) (Ticket operations), [`backend/lib/documentBank/storage.ts`](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/documentBank/storage.ts) (Private file storage), [`app`](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_service["Property Service"]
  node_servicehub["Service Hub"]
  node_tickets["Ticket operations<br/>[route.ts]"]
  node_ticketclass["Ticket classification"]
  node_ticketassign["Intelligent assignment"]
  node_sop["SOP management"]
  node_stock["Stock management"]
  node_electricity["Electricity operations"]
end

subgraph group_commercial["Commercial Operations"]
  node_procurement["Procurement"]
  node_accounts["Accounts and POs"]
  node_documents["Document bank"]
  node_docstorage["Private file storage<br/>[storage.ts]"]
end

subgraph group_crm["CRM"]
  node_crm["CRM workspace"]
  node_crmapi["CRM APIs"]
  node_coaching["Call coaching pipeline<br/>[pipeline.ts]"]
  node_whisper["Audio transcription<br/>[whisper.ts]"]
  node_groqcoach["Call scoring<br/>[groqCoach.ts]"]
  node_campaigninsights["Campaign insights"]
end

subgraph group_intelligence["AI Workflows"]
  node_agents["AI agent workflows"]
  node_agentruntime["Agent runtime<br/>[runtime.ts]"]
  node_council["Agent council"]
end

subgraph group_platform["Application Platform"]
  node_app["Web application"]
end

node_user(("Staff and managers"))
node_supabase[("Supabase")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_servicehub
node_tickets -->|"resolves classification"| node_ticketclass
node_tickets -->|"requests assignment"| node_ticketassign
node_coaching -->|"transcribes audio"| node_whisper
node_coaching -->|"scores transcript"| node_groqcoach
node_documents -->|"uses file storage"| node_docstorage
node_docstorage -->|"stores and signs files"| node_supabase
node_coaching -->|"reads and updates records"| node_supabase

click node_servicehub "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/frontend/components/dashboard/SoftServiceManagerDashboard.tsx"
click node_tickets "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/app/api/tickets/route.ts"
click node_ticketclass "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/backend/lib/ticketing"
click node_sop "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/properties/%5BpropertyId%5D/sop"
click node_stock "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/properties/%5BpropertyId%5D/stock"
click node_electricity "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/electricity"
click node_procurement "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/procurement"
click node_accounts "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/accounts"
click node_documents "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/document-bank"
click node_docstorage "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/documentBank/storage.ts"
click node_crm "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/(dashboard)/%5BorgId%5D/crm"
click node_crmapi "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/crm"
click node_coaching "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/pipeline.ts"
click node_whisper "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/whisper.ts"
click node_groqcoach "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/groqCoach.ts"
click node_campaigninsights "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/services/campaignAiEngine.ts"
click node_agents "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/agents"
click node_agentruntime "https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/agents/runtime.ts"
click node_council "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/backend/lib/council"
click node_app "https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app"

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_servicehub,node_tickets,node_ticketclass,node_ticketassign,node_sop,node_stock,node_electricity toneBlue
class node_procurement,node_accounts,node_documents,node_docstorage,node_supabase toneAmber
class node_crm,node_crmapi,node_coaching,node_whisper,node_groqcoach,node_campaigninsights toneMint
class node_agents,node_agentruntime,node_council toneRose
class node_app,node_user toneIndigo
```

## Components

### Property Service

- [Service Hub](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/frontend/components/dashboard/SoftServiceManagerDashboard.tsx): `frontend/components/dashboard/SoftServiceManagerDashboard.tsx`
- [Ticket operations](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/app/api/tickets/route.ts): `app/api/tickets/route.ts`
- [Ticket classification](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/backend/lib/ticketing): `backend/lib/ticketing`
- **Intelligent assignment**
- [SOP management](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/properties/%5BpropertyId%5D/sop): `app/api/properties/[propertyId]/sop`
- [Stock management](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/properties/%5BpropertyId%5D/stock): `app/api/properties/[propertyId]/stock`
- [Electricity operations](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/electricity): `app/api/electricity`

### Commercial Operations

- [Procurement](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/procurement): `app/api/procurement`
- [Accounts and POs](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/accounts): `app/api/accounts`
- [Document bank](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/document-bank): `app/api/document-bank`
- [Private file storage](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/documentBank/storage.ts): `backend/lib/documentBank/storage.ts`

### CRM

- [CRM workspace](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/(dashboard)/%5BorgId%5D/crm): `app/(dashboard)/[orgId]/crm`
- [CRM APIs](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/crm): `app/api/crm`
- [Call coaching pipeline](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/pipeline.ts): `backend/lib/coaching/pipeline.ts`
- [Audio transcription](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/whisper.ts): `backend/lib/coaching/whisper.ts`
- [Call scoring](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/coaching/groqCoach.ts): `backend/lib/coaching/groqCoach.ts`
- [Campaign insights](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/services/campaignAiEngine.ts): `backend/services/campaignAiEngine.ts`

### AI Workflows

- [AI agent workflows](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app/api/agents): `app/api/agents`
- [Agent runtime](https://github.com/contactautopilotoffices-oss/saas_one/blob/main/backend/lib/agents/runtime.ts): `backend/lib/agents/runtime.ts`
- [Agent council](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/backend/lib/council): `backend/lib/council`

### Application Platform

- [Web application](https://github.com/contactautopilotoffices-oss/saas_one/tree/main/app): `app`

### Other components

- **Staff and managers**
- **Supabase**

## Connections

- Staff and managers → Web application: uses
- Web application → Service Hub: renders
- Ticket operations → Ticket classification: resolves classification
- Ticket operations → Intelligent assignment: requests assignment
- Call coaching pipeline → Audio transcription: transcribes audio
- Call coaching pipeline → Call scoring: scores transcript
- Document bank → Private file storage: uses file storage
- Private file storage → Supabase: stores and signs files
- Call coaching pipeline → Supabase: reads and updates records
