# rachitmalik-byte/workflow-conversation architecture

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

- Interactive diagram: https://gitdiagram.com/rachitmalik-byte/workflow-conversation
- Repository: https://github.com/rachitmalik-byte/workflow-conversation

## Overview

RelayHQ is a browser-based outbound sales operations workspace. Users authenticate, then work a lead pipeline and its records, coordinate through messaging and lead-linked notes, and manage tasks, reminders, and notifications. The app routes these views through a shared database client that selects between an in-memory simulator and Supabase; authentication, workspace settings, and keyboard/search tools support the workflow. The README also documents Google Chat mirroring and synthesized alarms. Some subsystem links are documented rather than visible in sampled call sites, so those are marked unverified.

Main entry points: [`src/services/dbClient.ts`](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/dbClient.ts) (Data access facade), [`src/App.tsx`](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/App.tsx) (App router), [`src/context/AuthContext.tsx`](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/AuthContext.tsx) (Auth and team context), [`src/services/supabase.ts`](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/supabase.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workspace Experience"]
  node_app["App router<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_search["Global search<br/>[GlobalSearch.tsx]"]
  node_commands["Keyboard commands<br/>[CommandPalette.tsx]"]
  node_settings["Workspace settings<br/>[SettingsView.tsx]"]
  node_theme["Theme preferences<br/>[ThemeContext.tsx]"]
end

subgraph group_pipeline["Lead Pipeline"]
  node_leads["Lead pipeline<br/>[LeadsView.tsx]"]
  node_lead_detail["Lead dossier<br/>[DetailPage.tsx]"]
  node_lead_create["Create lead<br/>[CreatePage.tsx]"]
  node_lead_edit["Edit lead<br/>[EditPage.tsx]"]
end

subgraph group_coordination["Team Coordination"]
  node_messaging["Channels and DMs<br/>[MessagingView.tsx]"]
  node_notes["Playbook notes<br/>[NotesView.tsx]"]
  node_tasks["Task management<br/>[TasksView.tsx]"]
  node_reminders["Reminders<br/>[RemindersView.tsx]"]
  node_notifications["Notification center"]
  node_alarm["Synthesized alarms<br/>[App.tsx]"]
  node_chat_mirror["Google Chat mirroring<br/>[AuthContext.tsx]"]
end

subgraph group_platform["Identity and Data"]
  node_auth_ui["Sign-in and signup<br/>[AuthPage.tsx]"]
  node_auth["Auth and team context<br/>[AuthContext.tsx]"]
  node_dbclient["Data access facade<br/>[dbClient.ts]"]
  node_mockdb[("In-memory simulator<br/>[mockDb.ts]")]
  node_supabase["Supabase client<br/>[supabase.ts]"]
end

node_user(("Workspace user"))
node_database[("Supabase PostgreSQL")]

node_user -->|"signs in"| node_auth_ui
node_user -->|"uses workspace"| node_app
node_app -->|"provides context"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_leads
node_app -->|"routes to"| node_lead_create
node_app -->|"routes to"| node_lead_edit
node_app -->|"routes to"| node_lead_detail
node_app -->|"routes to"| node_tasks
node_app -->|"routes to"| node_reminders
node_app -->|"routes to"| node_messaging
node_app -->|"routes to"| node_notes
node_app -->|"routes to"| node_settings
node_app -->|"plays alarm"| node_alarm
node_dashboard -.->|"loads data"| node_dbclient
node_leads -.->|"reads and writes"| node_dbclient
node_lead_detail -.->|"reads and writes"| node_dbclient
node_lead_create -.->|"creates records"| node_dbclient
node_lead_edit -.->|"updates records"| node_dbclient
node_tasks -->|"loads tasks"| node_dbclient
node_reminders -.->|"manages reminders"| node_dbclient
node_messaging -.->|"manages messages"| node_dbclient
node_notes -.->|"manages notes"| node_dbclient
node_search -->|"searches records"| node_dbclient
node_commands -.->|"accesses records"| node_dbclient
node_auth_ui -->|"authenticates"| node_supabase
node_auth_ui -->|"loads profiles"| node_dbclient
node_auth -->|"loads profiles"| node_dbclient
node_auth -.->|"observes sessions"| node_supabase
node_settings -.->|"configures appearance"| node_theme
node_dbclient -->|"falls back to"| node_mockdb
node_dbclient -->|"selects backend"| node_supabase
node_supabase -.->|"queries"| node_database
node_auth -.->|"sends mirrored chat"| node_chat_mirror
node_messaging -.->|"mirrors messages"| node_chat_mirror
node_reminders -.->|"raises alerts"| node_notifications
node_notifications -.->|"triggers alarm"| node_alarm

click node_app "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/App.tsx"
click node_dashboard "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/dashboard/DashboardView.tsx"
click node_search "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/ui/GlobalSearch.tsx"
click node_commands "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/ui/CommandPalette.tsx"
click node_settings "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/settings/SettingsView.tsx"
click node_theme "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/ThemeContext.tsx"
click node_leads "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/LeadsView.tsx"
click node_lead_detail "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/DetailPage.tsx"
click node_lead_create "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/CreatePage.tsx"
click node_lead_edit "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/EditPage.tsx"
click node_messaging "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/messaging/MessagingView.tsx"
click node_notes "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/notes/NotesView.tsx"
click node_tasks "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/tasks/TasksView.tsx"
click node_reminders "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/reminders/RemindersView.tsx"
click node_notifications "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/layout/NotificationCenter.tsx"
click node_alarm "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/App.tsx"
click node_chat_mirror "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/AuthContext.tsx"
click node_auth_ui "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/auth/AuthPage.tsx"
click node_auth "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/AuthContext.tsx"
click node_dbclient "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/dbClient.ts"
click node_mockdb "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/mockDb.ts"
click node_supabase "https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/supabase.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_dashboard,node_search,node_commands,node_settings,node_theme,node_user toneBlue
class node_leads,node_lead_detail,node_lead_create,node_lead_edit,node_database toneAmber
class node_messaging,node_notes,node_tasks,node_reminders,node_notifications,node_alarm,node_chat_mirror toneMint
class node_auth_ui,node_auth,node_dbclient,node_mockdb,node_supabase toneRose
```

## Components

### Workspace Experience

- [App router](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/dashboard/DashboardView.tsx): `src/views/dashboard/DashboardView.tsx`
- [Global search](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/ui/GlobalSearch.tsx): `src/components/ui/GlobalSearch.tsx`
- [Keyboard commands](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/ui/CommandPalette.tsx): `src/components/ui/CommandPalette.tsx`
- [Workspace settings](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/settings/SettingsView.tsx): `src/views/settings/SettingsView.tsx`
- [Theme preferences](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`

### Lead Pipeline

- [Lead pipeline](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/LeadsView.tsx): `src/views/leads/LeadsView.tsx`
- [Lead dossier](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/DetailPage.tsx): `src/views/leads/DetailPage.tsx`
- [Create lead](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/CreatePage.tsx): `src/views/leads/CreatePage.tsx`
- [Edit lead](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/leads/EditPage.tsx): `src/views/leads/EditPage.tsx`

### Team Coordination

- [Channels and DMs](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/messaging/MessagingView.tsx): `src/views/messaging/MessagingView.tsx`
- [Playbook notes](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/notes/NotesView.tsx): `src/views/notes/NotesView.tsx`
- [Task management](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/tasks/TasksView.tsx): `src/views/tasks/TasksView.tsx`
- [Reminders](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/reminders/RemindersView.tsx): `src/views/reminders/RemindersView.tsx`
- [Notification center](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/components/layout/NotificationCenter.tsx): `src/components/layout/NotificationCenter.tsx`
- [Synthesized alarms](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/App.tsx): `src/App.tsx`
- [Google Chat mirroring](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`

### Identity and Data

- [Sign-in and signup](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/views/auth/AuthPage.tsx): `src/views/auth/AuthPage.tsx`
- [Auth and team context](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Data access facade](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/dbClient.ts): `src/services/dbClient.ts`
- [In-memory simulator](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/mockDb.ts): `src/services/mockDb.ts`
- [Supabase client](https://github.com/rachitmalik-byte/workflow-conversation/blob/main/src/services/supabase.ts): `src/services/supabase.ts`

### Other components

- **Workspace user**
- **Supabase PostgreSQL**

## Connections

- Workspace user → Sign-in and signup: signs in
- Workspace user → App router: uses workspace (evidence: `src/App.tsx`)
- App router → Auth and team context: provides context (evidence: `src/App.tsx`)
- App router → Dashboard: routes to (evidence: `src/App.tsx`)
- App router → Lead pipeline: routes to (evidence: `src/App.tsx`)
- App router → Create lead: routes to (evidence: `src/App.tsx`)
- App router → Edit lead: routes to (evidence: `src/App.tsx`)
- App router → Lead dossier: routes to (evidence: `src/App.tsx`)
- App router → Task management: routes to (evidence: `src/App.tsx`)
- App router → Reminders: routes to (evidence: `src/App.tsx`)
- App router → Channels and DMs: routes to (evidence: `src/App.tsx`)
- App router → Playbook notes: routes to (evidence: `src/App.tsx`)
- App router → Workspace settings: routes to (evidence: `src/App.tsx`)
- App router → Synthesized alarms: plays alarm (evidence: `src/App.tsx`)
- Dashboard → Data access facade: loads data (evidence: `src/views/dashboard/DashboardView.tsx`)
- Lead pipeline → Data access facade: reads and writes (evidence: `src/views/leads/LeadsView.tsx`)
- Lead dossier → Data access facade: reads and writes (evidence: `src/views/leads/DetailPage.tsx`)
- Create lead → Data access facade: creates records (evidence: `src/views/leads/CreatePage.tsx`)
- Edit lead → Data access facade: updates records (evidence: `src/views/leads/EditPage.tsx`)
- Task management → Data access facade: loads tasks (evidence: `src/views/tasks/TasksView.tsx`)
- Reminders → Data access facade: manages reminders (evidence: `src/views/reminders/RemindersView.tsx`)
- Channels and DMs → Data access facade: manages messages (evidence: `src/views/messaging/MessagingView.tsx`)
- Playbook notes → Data access facade: manages notes (evidence: `src/views/notes/NotesView.tsx`)
- Global search → Data access facade: searches records (evidence: `src/components/ui/GlobalSearch.tsx`)
- Keyboard commands → Data access facade: accesses records (evidence: `src/components/ui/CommandPalette.tsx`)
- Sign-in and signup → Supabase client: authenticates (evidence: `src/views/auth/AuthPage.tsx`)
- Sign-in and signup → Data access facade: loads profiles (evidence: `src/views/auth/AuthPage.tsx`)
- Auth and team context → Data access facade: loads profiles (evidence: `src/context/AuthContext.tsx`)
- Auth and team context → Supabase client: observes sessions (evidence: `src/context/AuthContext.tsx`)
- Workspace settings → Theme preferences: configures appearance (evidence: `src/views/settings/SettingsView.tsx`)
- Data access facade → In-memory simulator: falls back to (evidence: `src/services/dbClient.ts`)
- Data access facade → Supabase client: selects backend (evidence: `src/services/dbClient.ts`)
- Supabase client → Supabase PostgreSQL: queries
- Auth and team context → Google Chat mirroring: sends mirrored chat (evidence: `src/context/AuthContext.tsx`)
- Channels and DMs → Google Chat mirroring: mirrors messages (evidence: `src/views/messaging/MessagingView.tsx`)
- Reminders → Notification center: raises alerts
- Notification center → Synthesized alarms: triggers alarm
