# mrx-tech18/robot-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mrx-tech18/robot-ai
- Repository: https://github.com/mrx-tech18/robot-ai

## Overview

This is an AI-assisted virtual office and executive-workspace product. Users sign in or enter a demo, then work with an office of specialist employees through command/chat, email and calendar workflows, tasks, approvals, history, and integrations. The React application calls a server API; that server coordinates workspace state, AI assistance, and connector operations. The graph preserves the documented-by-code product areas and shared domain logic. Evidence is limited to the supplied excerpts and SOURCE INDEX; edges without direct support are omitted.

Main entry points: [`src/App.tsx`](https://github.com/mrx-tech18/robot-ai/blob/main/src/App.tsx) (Application shell), [`server.ts`](https://github.com/mrx-tech18/robot-ai/blob/main/server.ts) (HTTP API and orchestration), [`src/components/AuthScreen.tsx`](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/AuthScreen.tsx) (Sign-in and demo), [`src/lib/api.ts`](https://github.com/mrx-tech18/robot-ai/blob/main/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workspace experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_authscreen["Sign-in and demo<br/>[AuthScreen.tsx]"]
  node_virtualoffice["Virtual office"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_command["Command center"]
  node_employees["Employee workspaces"]
  node_tasks["Task management"]
  node_approvals["Approval center"]
  node_history["Automation history"]
  node_integrationsui["Integration settings"]
end

subgraph group_api["API and workflows"]
  node_api_client["API client<br/>[api.ts]"]
  node_server["HTTP API and orchestration<br/>[server.ts]"]
  node_ai["Specialist AI<br/>[ai.ts]"]
  node_webhook["Webhook transport<br/>[webhookRequest.ts]"]
end

subgraph group_connectors["Integrations"]
  node_connector_service["Connector operations<br/>[connectors.ts]"]
  node_connector_repo["Connector persistence<br/>[connectorsRepo.ts]"]
  node_connector_ui["Connector controls"]
end

subgraph group_state["Workspace state"]
  node_workspace_db[("Workspace data<br/>[db.ts]")]
  node_firestore[("Cloud user data<br/>[firestore.ts]")]
  node_schema[("Relational schema<br/>[schema.ts]")]
  node_pg_db[("Postgres access<br/>[index.ts]")]
end

subgraph group_domain["Shared domain logic"]
  node_office_logic["Office workflow rules<br/>[officeLogic.ts]"]
  node_connector_logic["Connector rules<br/>[connectorLogic.ts]"]
end

node_user(("Workspace user"))
node_firebase_auth["Firebase authentication<br/>[firebase.ts]"]

node_user -->|"signs in"| node_authscreen
node_authscreen -->|"authenticates"| node_firebase_auth
node_authscreen -->|"registers session"| node_api_client
node_app -->|"loads workspace"| node_api_client
node_app -->|"renders"| node_authscreen
node_app -->|"renders"| node_virtualoffice
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_command
node_app -->|"renders"| node_employees
node_app -->|"renders"| node_tasks
node_app -->|"renders"| node_approvals
node_app -->|"renders"| node_history
node_app -->|"renders"| node_integrationsui
node_integrationsui -->|"manages connections"| node_api_client
node_integrationsui -->|"renders controls"| node_connector_ui
node_api_client -->|"sends API requests"| node_server
node_server -->|"reads and updates"| node_workspace_db
node_server -->|"loads user profile"| node_firestore
node_server -->|"requests assistance"| node_ai
node_server -->|"routes connector work"| node_connector_service
node_server -->|"posts webhook"| node_webhook
node_connector_service -->|"loads and records"| node_connector_repo
node_connector_service -->|"applies rules"| node_connector_logic
node_connector_repo -->|"queries database"| node_pg_db
node_pg_db -->|"binds schema"| node_schema
node_server -->|"uses workflow rules"| node_office_logic
node_webhook -->|"validates target"| node_office_logic
node_server -->|"loads dashboard"| node_connector_repo

click node_app "https://github.com/mrx-tech18/robot-ai/blob/main/src/App.tsx"
click node_authscreen "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/AuthScreen.tsx"
click node_virtualoffice "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/VirtualOfficeView.tsx"
click node_dashboard "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/DashboardView.tsx"
click node_command "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/CommandCenterView.tsx"
click node_employees "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/EmployeeWorkspaceView.tsx"
click node_tasks "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/TaskManagementView.tsx"
click node_approvals "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/ApprovalCenterView.tsx"
click node_history "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/AutomationHistoryView.tsx"
click node_integrationsui "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/IntegrationsView.tsx"
click node_api_client "https://github.com/mrx-tech18/robot-ai/blob/main/src/lib/api.ts"
click node_server "https://github.com/mrx-tech18/robot-ai/blob/main/server.ts"
click node_ai "https://github.com/mrx-tech18/robot-ai/blob/main/server/ai.ts"
click node_webhook "https://github.com/mrx-tech18/robot-ai/blob/main/server/webhookRequest.ts"
click node_connector_service "https://github.com/mrx-tech18/robot-ai/blob/main/server/connectors.ts"
click node_connector_repo "https://github.com/mrx-tech18/robot-ai/blob/main/server/connectorsRepo.ts"
click node_connector_ui "https://github.com/mrx-tech18/robot-ai/blob/main/src/components/connectors/ConnectorModals.tsx"
click node_workspace_db "https://github.com/mrx-tech18/robot-ai/blob/main/server/db.ts"
click node_firestore "https://github.com/mrx-tech18/robot-ai/blob/main/server/firestore.ts"
click node_schema "https://github.com/mrx-tech18/robot-ai/blob/main/src/db/schema.ts"
click node_pg_db "https://github.com/mrx-tech18/robot-ai/blob/main/src/db/index.ts"
click node_firebase_auth "https://github.com/mrx-tech18/robot-ai/blob/main/src/lib/firebase.ts"
click node_office_logic "https://github.com/mrx-tech18/robot-ai/blob/main/src/shared/officeLogic.ts"
click node_connector_logic "https://github.com/mrx-tech18/robot-ai/blob/main/src/shared/connectorLogic.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_app,node_authscreen,node_virtualoffice,node_dashboard,node_command,node_employees,node_tasks,node_approvals,node_history,node_integrationsui,node_user toneBlue
class node_api_client,node_server,node_ai,node_webhook toneAmber
class node_connector_service,node_connector_repo,node_connector_ui toneMint
class node_workspace_db,node_firestore,node_schema,node_pg_db toneRose
class node_office_logic,node_connector_logic toneIndigo
class node_firebase_auth toneTeal
```

## Components

### Workspace experience

- [Application shell](https://github.com/mrx-tech18/robot-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in and demo](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/AuthScreen.tsx): `src/components/AuthScreen.tsx`
- [Virtual office](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/VirtualOfficeView.tsx): `src/components/VirtualOfficeView.tsx`
- [Dashboard](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Command center](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/CommandCenterView.tsx): `src/components/CommandCenterView.tsx`
- [Employee workspaces](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/EmployeeWorkspaceView.tsx): `src/components/EmployeeWorkspaceView.tsx`
- [Task management](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/TaskManagementView.tsx): `src/components/TaskManagementView.tsx`
- [Approval center](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/ApprovalCenterView.tsx): `src/components/ApprovalCenterView.tsx`
- [Automation history](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/AutomationHistoryView.tsx): `src/components/AutomationHistoryView.tsx`
- [Integration settings](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/IntegrationsView.tsx): `src/components/IntegrationsView.tsx`

### API and workflows

- [API client](https://github.com/mrx-tech18/robot-ai/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [HTTP API and orchestration](https://github.com/mrx-tech18/robot-ai/blob/main/server.ts): `server.ts`
- [Specialist AI](https://github.com/mrx-tech18/robot-ai/blob/main/server/ai.ts): `server/ai.ts`
- [Webhook transport](https://github.com/mrx-tech18/robot-ai/blob/main/server/webhookRequest.ts): `server/webhookRequest.ts`

### Integrations

- [Connector operations](https://github.com/mrx-tech18/robot-ai/blob/main/server/connectors.ts): `server/connectors.ts`
- [Connector persistence](https://github.com/mrx-tech18/robot-ai/blob/main/server/connectorsRepo.ts): `server/connectorsRepo.ts`
- [Connector controls](https://github.com/mrx-tech18/robot-ai/blob/main/src/components/connectors/ConnectorModals.tsx): `src/components/connectors/ConnectorModals.tsx`

### Workspace state

- [Workspace data](https://github.com/mrx-tech18/robot-ai/blob/main/server/db.ts): `server/db.ts`
- [Cloud user data](https://github.com/mrx-tech18/robot-ai/blob/main/server/firestore.ts): `server/firestore.ts`
- [Relational schema](https://github.com/mrx-tech18/robot-ai/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [Postgres access](https://github.com/mrx-tech18/robot-ai/blob/main/src/db/index.ts): `src/db/index.ts`

### Shared domain logic

- [Office workflow rules](https://github.com/mrx-tech18/robot-ai/blob/main/src/shared/officeLogic.ts): `src/shared/officeLogic.ts`
- [Connector rules](https://github.com/mrx-tech18/robot-ai/blob/main/src/shared/connectorLogic.ts): `src/shared/connectorLogic.ts`

### Other components

- **Workspace user**
- [Firebase authentication](https://github.com/mrx-tech18/robot-ai/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`

## Connections

- Workspace user → Sign-in and demo: signs in (evidence: `src/components/AuthScreen.tsx`)
- Sign-in and demo → Firebase authentication: authenticates (evidence: `src/components/AuthScreen.tsx`)
- Sign-in and demo → API client: registers session (evidence: `src/components/AuthScreen.tsx`)
- Application shell → API client: loads workspace (evidence: `src/App.tsx`)
- Application shell → Sign-in and demo: renders (evidence: `src/App.tsx`)
- Application shell → Virtual office: renders (evidence: `src/App.tsx`)
- Application shell → Dashboard: renders (evidence: `src/App.tsx`)
- Application shell → Command center: renders (evidence: `src/App.tsx`)
- Application shell → Employee workspaces: renders (evidence: `src/App.tsx`)
- Application shell → Task management: renders (evidence: `src/App.tsx`)
- Application shell → Approval center: renders (evidence: `src/App.tsx`)
- Application shell → Automation history: renders (evidence: `src/App.tsx`)
- Application shell → Integration settings: renders (evidence: `src/App.tsx`)
- Integration settings → API client: manages connections (evidence: `src/components/IntegrationsView.tsx`)
- Integration settings → Connector controls: renders controls (evidence: `src/components/IntegrationsView.tsx`)
- API client → HTTP API and orchestration: sends API requests (evidence: `src/lib/api.ts`)
- HTTP API and orchestration → Workspace data: reads and updates (evidence: `server.ts`)
- HTTP API and orchestration → Cloud user data: loads user profile (evidence: `server.ts`)
- HTTP API and orchestration → Specialist AI: requests assistance (evidence: `server.ts`)
- HTTP API and orchestration → Connector operations: routes connector work (evidence: `server.ts`)
- HTTP API and orchestration → Webhook transport: posts webhook (evidence: `server.ts`)
- Connector operations → Connector persistence: loads and records (evidence: `server/connectors.ts`)
- Connector operations → Connector rules: applies rules (evidence: `server/connectors.ts`)
- Connector persistence → Postgres access: queries database (evidence: `server/connectorsRepo.ts`)
- Postgres access → Relational schema: binds schema (evidence: `src/db/index.ts`)
- HTTP API and orchestration → Office workflow rules: uses workflow rules (evidence: `server.ts`)
- Webhook transport → Office workflow rules: validates target (evidence: `server/webhookRequest.ts`)
- HTTP API and orchestration → Connector persistence: loads dashboard (evidence: `server.ts`)
