# jnunez2001/agencyos architecture

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

- Interactive diagram: https://gitdiagram.com/jnunez2001/agencyos
- Repository: https://github.com/jnunez2001/agencyos

## Overview

NexusOS is an organization-scoped agency operations platform: staff manage clients and projects, execute tasks and meetings, track time, maintain SOPs and QA, and record results for reporting. The principal workflow runs from the browser through the API routes into permission-aware domain services that persist agency data. Separate branches provide AI tools and Google integrations, alongside identity, activity, and notifications. The map reflects the README and the supplied source index; several capabilities are documented or listed but their implementation was not excerpted, so uncertain internal links are omitted.

Main entry points: [`server/routes/api.js`](https://github.com/jnunez2001/agencyos/blob/main/server/routes/api.js) (API routes), [`server/mcp.js`](https://github.com/jnunez2001/agencyos/blob/main/server/mcp.js) (AI assistants), [`server/services/clients.js`](https://github.com/jnunez2001/agencyos/blob/main/server/services/clients.js) (Clients and goals), [`server/services/tasks.js`](https://github.com/jnunez2001/agencyos/blob/main/server/services/tasks.js) (Tasks and QA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Web application<br/>[app.js]"]
  node_views["Feature views"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_core["Agency operations"]
  node_clients["Clients and goals<br/>[clients.js]"]
  node_projects["Projects<br/>[projects.js]"]
  node_tasks["Tasks and QA<br/>[tasks.js]"]
  node_calendar["Events and meetings<br/>[events.js]"]
  node_time["Time and retainers<br/>[timeentries.js]"]
  node_sops["SOPs<br/>[sops.js]"]
  node_requests["Client requests<br/>[requests.js]"]
  node_followups["Follow-ups<br/>[followups.js]"]
  node_decisions["Decisions<br/>[decisions.js]"]
end

subgraph group_insight["Insights and assistance"]
  node_results["Results<br/>[results.js]"]
  node_reports["Reports<br/>[reports.js]"]
  node_ai["AI assistants<br/>[mcp.js]"]
  node_google["Google integration<br/>[googlehub.js]"]
end

subgraph group_platform["Platform services"]
  node_routes["API routes<br/>[api.js]"]
  node_identity["Identity and access<br/>[permissions.js]"]
  node_activity["Activity log<br/>[audit.js]"]
  node_notifications["Notifications<br/>[notifications.js]"]
  node_database[("SQLite database<br/>[db.js]")]
  node_server["HTTP server<br/>[app.js]"]
end

node_staff(("Agency staff"))

node_staff -->|"uses"| node_browser
node_browser -->|"loads"| node_views
node_views -->|"requests data"| node_api_client
node_api_client -.->|"sends API requests"| node_routes
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_clients
node_routes -->|"dispatches"| node_projects
node_routes -->|"dispatches"| node_tasks
node_routes -->|"dispatches"| node_calendar
node_routes -->|"dispatches"| node_time
node_routes -->|"dispatches"| node_sops
node_routes -->|"dispatches"| node_requests
node_routes -->|"dispatches"| node_followups
node_routes -->|"dispatches"| node_decisions
node_routes -->|"dispatches"| node_results
node_routes -->|"dispatches"| node_reports
node_routes -->|"checks access"| node_identity
node_clients -->|"records changes"| node_activity
node_projects -->|"checks client"| node_clients
node_tasks -->|"uses SOPs"| node_sops
node_ai -->|"uses domain tools"| node_clients
node_ai -->|"uses domain tools"| node_tasks
node_ai -->|"uses domain tools"| node_calendar
node_ai -->|"uses domain tools"| node_requests
node_google -.->|"integrates"| node_server
node_routes -->|"dispatches"| node_notifications
node_routes -.->|"persists through"| node_database

click node_browser "https://github.com/jnunez2001/agencyos/blob/main/public/js/app.js"
click node_views "https://github.com/jnunez2001/agencyos/tree/main/public/js/views"
click node_api_client "https://github.com/jnunez2001/agencyos/blob/main/public/js/api.js"
click node_routes "https://github.com/jnunez2001/agencyos/blob/main/server/routes/api.js"
click node_clients "https://github.com/jnunez2001/agencyos/blob/main/server/services/clients.js"
click node_projects "https://github.com/jnunez2001/agencyos/blob/main/server/services/projects.js"
click node_tasks "https://github.com/jnunez2001/agencyos/blob/main/server/services/tasks.js"
click node_calendar "https://github.com/jnunez2001/agencyos/blob/main/server/services/events.js"
click node_time "https://github.com/jnunez2001/agencyos/blob/main/server/services/timeentries.js"
click node_sops "https://github.com/jnunez2001/agencyos/blob/main/server/services/sops.js"
click node_requests "https://github.com/jnunez2001/agencyos/blob/main/server/services/requests.js"
click node_followups "https://github.com/jnunez2001/agencyos/blob/main/server/services/followups.js"
click node_decisions "https://github.com/jnunez2001/agencyos/blob/main/server/services/decisions.js"
click node_results "https://github.com/jnunez2001/agencyos/blob/main/server/services/results.js"
click node_reports "https://github.com/jnunez2001/agencyos/blob/main/server/services/reports.js"
click node_ai "https://github.com/jnunez2001/agencyos/blob/main/server/mcp.js"
click node_google "https://github.com/jnunez2001/agencyos/blob/main/server/googlehub.js"
click node_identity "https://github.com/jnunez2001/agencyos/blob/main/server/services/permissions.js"
click node_activity "https://github.com/jnunez2001/agencyos/blob/main/server/services/audit.js"
click node_notifications "https://github.com/jnunez2001/agencyos/blob/main/server/services/notifications.js"
click node_database "https://github.com/jnunez2001/agencyos/blob/main/server/db.js"
click node_server "https://github.com/jnunez2001/agencyos/blob/main/server/app.js"

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_browser,node_views,node_api_client toneBlue
class node_clients,node_projects,node_tasks,node_calendar,node_time,node_sops,node_requests,node_followups,node_decisions toneAmber
class node_results,node_reports,node_ai,node_google toneMint
class node_routes,node_identity,node_activity,node_notifications,node_database,node_server toneRose
class node_staff toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/jnunez2001/agencyos/blob/main/public/js/app.js): `public/js/app.js`
- [Feature views](https://github.com/jnunez2001/agencyos/tree/main/public/js/views): `public/js/views`
- [API client](https://github.com/jnunez2001/agencyos/blob/main/public/js/api.js): `public/js/api.js`

### Agency operations

- [Clients and goals](https://github.com/jnunez2001/agencyos/blob/main/server/services/clients.js): `server/services/clients.js`
- [Projects](https://github.com/jnunez2001/agencyos/blob/main/server/services/projects.js): `server/services/projects.js`
- [Tasks and QA](https://github.com/jnunez2001/agencyos/blob/main/server/services/tasks.js): `server/services/tasks.js`
- [Events and meetings](https://github.com/jnunez2001/agencyos/blob/main/server/services/events.js): `server/services/events.js`
- [Time and retainers](https://github.com/jnunez2001/agencyos/blob/main/server/services/timeentries.js): `server/services/timeentries.js`
- [SOPs](https://github.com/jnunez2001/agencyos/blob/main/server/services/sops.js): `server/services/sops.js`
- [Client requests](https://github.com/jnunez2001/agencyos/blob/main/server/services/requests.js): `server/services/requests.js`
- [Follow-ups](https://github.com/jnunez2001/agencyos/blob/main/server/services/followups.js): `server/services/followups.js`
- [Decisions](https://github.com/jnunez2001/agencyos/blob/main/server/services/decisions.js): `server/services/decisions.js`

### Insights and assistance

- [Results](https://github.com/jnunez2001/agencyos/blob/main/server/services/results.js): `server/services/results.js`
- [Reports](https://github.com/jnunez2001/agencyos/blob/main/server/services/reports.js): `server/services/reports.js`
- [AI assistants](https://github.com/jnunez2001/agencyos/blob/main/server/mcp.js): `server/mcp.js`
- [Google integration](https://github.com/jnunez2001/agencyos/blob/main/server/googlehub.js): `server/googlehub.js`

### Platform services

- [API routes](https://github.com/jnunez2001/agencyos/blob/main/server/routes/api.js): `server/routes/api.js`
- [Identity and access](https://github.com/jnunez2001/agencyos/blob/main/server/services/permissions.js): `server/services/permissions.js`
- [Activity log](https://github.com/jnunez2001/agencyos/blob/main/server/services/audit.js): `server/services/audit.js`
- [Notifications](https://github.com/jnunez2001/agencyos/blob/main/server/services/notifications.js): `server/services/notifications.js`
- [SQLite database](https://github.com/jnunez2001/agencyos/blob/main/server/db.js): `server/db.js`
- [HTTP server](https://github.com/jnunez2001/agencyos/blob/main/server/app.js): `server/app.js`

### Other components

- **Agency staff**

## Connections

- Agency staff → Web application: uses (evidence: `README.md`)
- Web application → Feature views: loads (evidence: `public/js/app.js`)
- Feature views → API client: requests data (evidence: `public/js/views/clients.js`)
- API client → API routes: sends API requests
- HTTP server → API routes: mounts (evidence: `server/app.js`)
- API routes → Clients and goals: dispatches (evidence: `server/routes/api.js`)
- API routes → Projects: dispatches (evidence: `server/routes/api.js`)
- API routes → Tasks and QA: dispatches (evidence: `server/routes/api.js`)
- API routes → Events and meetings: dispatches (evidence: `server/routes/api.js`)
- API routes → Time and retainers: dispatches (evidence: `server/routes/api.js`)
- API routes → SOPs: dispatches (evidence: `server/routes/api.js`)
- API routes → Client requests: dispatches (evidence: `server/routes/api.js`)
- API routes → Follow-ups: dispatches (evidence: `server/routes/api.js`)
- API routes → Decisions: dispatches (evidence: `server/routes/api.js`)
- API routes → Results: dispatches (evidence: `server/routes/api.js`)
- API routes → Reports: dispatches (evidence: `server/routes/api.js`)
- API routes → Identity and access: checks access (evidence: `server/routes/api.js`)
- Clients and goals → Activity log: records changes (evidence: `server/services/clients.js`)
- Projects → Clients and goals: checks client (evidence: `server/services/projects.js`)
- Tasks and QA → SOPs: uses SOPs (evidence: `server/services/tasks.js`)
- AI assistants → Clients and goals: uses domain tools (evidence: `server/mcp.js`)
- AI assistants → Tasks and QA: uses domain tools (evidence: `server/mcp.js`)
- AI assistants → Events and meetings: uses domain tools (evidence: `server/mcp.js`)
- AI assistants → Client requests: uses domain tools (evidence: `server/mcp.js`)
- Google integration → HTTP server: integrates
- API routes → Notifications: dispatches (evidence: `server/routes/api.js`)
- API routes → SQLite database: persists through
