# chinmaye5/converso architecture

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

- Interactive diagram: https://gitdiagram.com/chinmaye5/converso
- Repository: https://github.com/chinmaye5/converso

## Overview

Converso is a workspace-based customer-support chatbot product: operators configure a chatbot and knowledge base, visitors chat with it or request human help, and operators review conversations and tickets. The backend serves authenticated workspace operations and public chat, while the frontend provides operator screens and a public chat page. The README is empty, so the map relies on the file tree and sampled source; unsampled screens and integrations are shown only where their existence is clear, with unverified links omitted or dashed.

Main entry points: [`backend/server.ts`](https://github.com/chinmaye5/converso/blob/main/backend/server.ts) (Express API server), [`backend/db/index.ts`](https://github.com/chinmaye5/converso/blob/main/backend/db/index.ts) (PostgreSQL data access), [`backend/controllers/document.controller.ts`](https://github.com/chinmaye5/converso/blob/main/backend/controllers/document.controller.ts) (Document ingestion), [`backend/controllers/chat.controller.ts`](https://github.com/chinmaye5/converso/blob/main/backend/controllers/chat.controller.ts) (Authenticated chat handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_landing["Landing page<br/>[LandingPage.tsx]"]
  node_grainient["Landing visual<br/>[Grainient.tsx]"]
  node_app_shell["Authenticated app shell<br/>[AppShell.tsx]"]
  node_workspace_context["Workspace selection"]
  node_api_client["API client<br/>[api.ts]"]
  node_chat_ui["Public chat page<br/>[page.tsx]"]
  node_dashboard["Workspace dashboard"]
  node_conversation_ui["Conversation history"]
  node_operator_views["Operator feature views"]
  node_ui_primitives["Shared UI primitives"]
end

subgraph group_workspace["Workspace operations"]
  node_backend["Express API server<br/>[server.ts]"]
  node_workspace_routes["Workspace routes<br/>[workspace.route.ts]"]
  node_workspace_controller["Workspace management"]
  node_chatbot_routes["Chatbot routes<br/>[chatbot.routes.ts]"]
  node_chatbot_controller["Chatbot configuration"]
end

subgraph group_conversation["Chat and support"]
  node_chat_routes["Authenticated chat routes<br/>[chat.route.ts]"]
  node_chat_controller["Authenticated chat handling<br/>[chat.controller.ts]"]
  node_public_chat_routes["Public chat routes"]
  node_public_chat_controller["Public chat handling"]
  node_chat_graph["Answer generation<br/>[chat.graph.ts]"]
  node_handoff["Human handoff detection<br/>[handoff.utils.ts]"]
  node_ticket_routes["Ticket routes<br/>[ticket.route.ts]"]
  node_ticket_controller["Ticket management"]
end

subgraph group_knowledge["Knowledge retrieval"]
  node_document_controller["Document ingestion"]
  node_pdf_utils["PDF text processing<br/>[pdf.utils.ts]"]
  node_embedding_utils["Embedding generation<br/>[embedding.utils.ts]"]
  node_search_route["Knowledge search route<br/>[search.route.ts]"]
  node_search_utils["Semantic search<br/>[search.utils.ts]"]
end

subgraph group_data["Persistence"]
  node_database[("PostgreSQL data access<br/>[index.ts]")]
  node_schema["Product data model<br/>[schema.ts]"]
end

node_operator(("Workspace operator"))
node_visitor(("Chat visitor"))
node_supabase_storage["Supabase file storage<br/>[supabase.ts]"]
node_jina["Jina embeddings API"]

node_backend -->|"mounts routes"| node_workspace_routes
node_backend -->|"mounts routes"| node_chatbot_routes
node_backend -->|"mounts routes"| node_chat_routes
node_backend -->|"mounts routes"| node_public_chat_routes
node_backend -->|"mounts routes"| node_ticket_routes
node_backend -->|"mounts routes"| node_search_route
node_backend -->|"mounts document routes"| node_document_controller
node_chatbot_routes -->|"dispatches requests"| node_chatbot_controller
node_workspace_routes -->|"dispatches requests"| node_workspace_controller
node_chat_routes -->|"dispatches requests"| node_chat_controller
node_public_chat_routes -->|"dispatches requests"| node_public_chat_controller
node_ticket_routes -->|"dispatches requests"| node_ticket_controller
node_chat_controller -->|"generates answers"| node_chat_graph
node_public_chat_controller -->|"generates answers"| node_chat_graph
node_chat_controller -->|"checks handoff"| node_handoff
node_public_chat_controller -->|"checks handoff"| node_handoff
node_chat_graph -->|"retrieves context"| node_search_utils
node_search_route -->|"runs search"| node_search_utils
node_document_controller -->|"extracts and chunks"| node_pdf_utils
node_document_controller -->|"embeds chunks"| node_embedding_utils
node_embedding_utils -->|"requests vectors"| node_jina
node_document_controller -->|"stores PDF files"| node_supabase_storage
node_search_utils -->|"embeds query"| node_embedding_utils
node_document_controller -->|"stores documents"| node_database
node_chat_controller -->|"reads and writes chats"| node_database
node_public_chat_controller -->|"reads and writes chats"| node_database
node_chatbot_controller -->|"manages chatbot records"| node_database
node_ticket_controller -->|"manages tickets"| node_database
node_search_utils -->|"queries stored chunks"| node_database
node_database -->|"uses schema"| node_schema
node_operator -->|"visits product site"| node_landing
node_landing -->|"renders visual"| node_grainient
node_operator -.->|"opens workspace"| node_app_shell
node_app_shell -->|"provides workspace state"| node_workspace_context
node_dashboard -->|"reads workspace state"| node_workspace_context
node_dashboard -->|"loads dashboard data"| node_api_client
node_conversation_ui -->|"reads workspace state"| node_workspace_context
node_conversation_ui -->|"loads conversations"| node_api_client
node_app_shell -.->|"hosts feature pages"| node_operator_views
node_visitor -->|"starts conversation"| node_chat_ui
node_chat_ui -.->|"sends chat requests"| node_backend
node_api_client -.->|"calls API"| node_backend

click node_landing "https://github.com/chinmaye5/converso/blob/main/frontend/components/landing/LandingPage.tsx"
click node_grainient "https://github.com/chinmaye5/converso/blob/main/frontend/components/Grainient.tsx"
click node_app_shell "https://github.com/chinmaye5/converso/blob/main/frontend/components/layout/AppShell.tsx"
click node_workspace_context "https://github.com/chinmaye5/converso/blob/main/frontend/lib/workspace-context.tsx"
click node_api_client "https://github.com/chinmaye5/converso/blob/main/frontend/lib/api.ts"
click node_chat_ui "https://github.com/chinmaye5/converso/blob/main/frontend/app/chat/%5BchatbotId%5D/page.tsx"
click node_dashboard "https://github.com/chinmaye5/converso/blob/main/frontend/components/dashboard/DashboardOverview.tsx"
click node_conversation_ui "https://github.com/chinmaye5/converso/blob/main/frontend/components/conversations/ConversationsHistoryView.tsx"
click node_operator_views "https://github.com/chinmaye5/converso/tree/main/frontend/components"
click node_ui_primitives "https://github.com/chinmaye5/converso/tree/main/frontend/components/ui"
click node_backend "https://github.com/chinmaye5/converso/blob/main/backend/server.ts"
click node_workspace_routes "https://github.com/chinmaye5/converso/blob/main/backend/routes/workspace.route.ts"
click node_workspace_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/workspace.controller.ts"
click node_chatbot_routes "https://github.com/chinmaye5/converso/blob/main/backend/routes/chatbot.routes.ts"
click node_chatbot_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/chatbot.controller.ts"
click node_document_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/document.controller.ts"
click node_pdf_utils "https://github.com/chinmaye5/converso/blob/main/backend/utils/pdf.utils.ts"
click node_embedding_utils "https://github.com/chinmaye5/converso/blob/main/backend/utils/embedding.utils.ts"
click node_search_route "https://github.com/chinmaye5/converso/blob/main/backend/routes/search.route.ts"
click node_search_utils "https://github.com/chinmaye5/converso/blob/main/backend/utils/search.utils.ts"
click node_chat_routes "https://github.com/chinmaye5/converso/blob/main/backend/routes/chat.route.ts"
click node_chat_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/chat.controller.ts"
click node_public_chat_routes "https://github.com/chinmaye5/converso/blob/main/backend/routes/public-chat.route.ts"
click node_public_chat_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/public-chat.controller.ts"
click node_chat_graph "https://github.com/chinmaye5/converso/blob/main/backend/ai/chat.graph.ts"
click node_handoff "https://github.com/chinmaye5/converso/blob/main/backend/ai/handoff.utils.ts"
click node_ticket_routes "https://github.com/chinmaye5/converso/blob/main/backend/routes/ticket.route.ts"
click node_ticket_controller "https://github.com/chinmaye5/converso/blob/main/backend/controllers/ticket.controller.ts"
click node_database "https://github.com/chinmaye5/converso/blob/main/backend/db/index.ts"
click node_schema "https://github.com/chinmaye5/converso/blob/main/backend/db/schema.ts"
click node_supabase_storage "https://github.com/chinmaye5/converso/blob/main/backend/db/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_landing,node_grainient,node_app_shell,node_workspace_context,node_api_client,node_chat_ui,node_dashboard,node_conversation_ui,node_operator_views,node_ui_primitives toneBlue
class node_backend,node_workspace_routes,node_workspace_controller,node_chatbot_routes,node_chatbot_controller,node_supabase_storage toneAmber
class node_chat_routes,node_chat_controller,node_public_chat_routes,node_public_chat_controller,node_chat_graph,node_handoff,node_ticket_routes,node_ticket_controller,node_jina toneMint
class node_document_controller,node_pdf_utils,node_embedding_utils,node_search_route,node_search_utils toneRose
class node_database,node_schema,node_operator,node_visitor toneIndigo
```

## Components

### Web experience

- [Landing page](https://github.com/chinmaye5/converso/blob/main/frontend/components/landing/LandingPage.tsx): `frontend/components/landing/LandingPage.tsx`
- [Landing visual](https://github.com/chinmaye5/converso/blob/main/frontend/components/Grainient.tsx): `frontend/components/Grainient.tsx`
- [Authenticated app shell](https://github.com/chinmaye5/converso/blob/main/frontend/components/layout/AppShell.tsx): `frontend/components/layout/AppShell.tsx`
- [Workspace selection](https://github.com/chinmaye5/converso/blob/main/frontend/lib/workspace-context.tsx): `frontend/lib/workspace-context.tsx`
- [API client](https://github.com/chinmaye5/converso/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Public chat page](https://github.com/chinmaye5/converso/blob/main/frontend/app/chat/%5BchatbotId%5D/page.tsx): `frontend/app/chat/[chatbotId]/page.tsx`
- [Workspace dashboard](https://github.com/chinmaye5/converso/blob/main/frontend/components/dashboard/DashboardOverview.tsx): `frontend/components/dashboard/DashboardOverview.tsx`
- [Conversation history](https://github.com/chinmaye5/converso/blob/main/frontend/components/conversations/ConversationsHistoryView.tsx): `frontend/components/conversations/ConversationsHistoryView.tsx`
- [Operator feature views](https://github.com/chinmaye5/converso/tree/main/frontend/components): `frontend/components`
- [Shared UI primitives](https://github.com/chinmaye5/converso/tree/main/frontend/components/ui): `frontend/components/ui`

### Workspace operations

- [Express API server](https://github.com/chinmaye5/converso/blob/main/backend/server.ts): `backend/server.ts`
- [Workspace routes](https://github.com/chinmaye5/converso/blob/main/backend/routes/workspace.route.ts): `backend/routes/workspace.route.ts`
- [Workspace management](https://github.com/chinmaye5/converso/blob/main/backend/controllers/workspace.controller.ts): `backend/controllers/workspace.controller.ts`
- [Chatbot routes](https://github.com/chinmaye5/converso/blob/main/backend/routes/chatbot.routes.ts): `backend/routes/chatbot.routes.ts`
- [Chatbot configuration](https://github.com/chinmaye5/converso/blob/main/backend/controllers/chatbot.controller.ts): `backend/controllers/chatbot.controller.ts`

### Chat and support

- [Authenticated chat routes](https://github.com/chinmaye5/converso/blob/main/backend/routes/chat.route.ts): `backend/routes/chat.route.ts`
- [Authenticated chat handling](https://github.com/chinmaye5/converso/blob/main/backend/controllers/chat.controller.ts): `backend/controllers/chat.controller.ts`
- [Public chat routes](https://github.com/chinmaye5/converso/blob/main/backend/routes/public-chat.route.ts): `backend/routes/public-chat.route.ts`
- [Public chat handling](https://github.com/chinmaye5/converso/blob/main/backend/controllers/public-chat.controller.ts): `backend/controllers/public-chat.controller.ts`
- [Answer generation](https://github.com/chinmaye5/converso/blob/main/backend/ai/chat.graph.ts): `backend/ai/chat.graph.ts`
- [Human handoff detection](https://github.com/chinmaye5/converso/blob/main/backend/ai/handoff.utils.ts): `backend/ai/handoff.utils.ts`
- [Ticket routes](https://github.com/chinmaye5/converso/blob/main/backend/routes/ticket.route.ts): `backend/routes/ticket.route.ts`
- [Ticket management](https://github.com/chinmaye5/converso/blob/main/backend/controllers/ticket.controller.ts): `backend/controllers/ticket.controller.ts`

### Knowledge retrieval

- [Document ingestion](https://github.com/chinmaye5/converso/blob/main/backend/controllers/document.controller.ts): `backend/controllers/document.controller.ts`
- [PDF text processing](https://github.com/chinmaye5/converso/blob/main/backend/utils/pdf.utils.ts): `backend/utils/pdf.utils.ts`
- [Embedding generation](https://github.com/chinmaye5/converso/blob/main/backend/utils/embedding.utils.ts): `backend/utils/embedding.utils.ts`
- [Knowledge search route](https://github.com/chinmaye5/converso/blob/main/backend/routes/search.route.ts): `backend/routes/search.route.ts`
- [Semantic search](https://github.com/chinmaye5/converso/blob/main/backend/utils/search.utils.ts): `backend/utils/search.utils.ts`

### Persistence

- [PostgreSQL data access](https://github.com/chinmaye5/converso/blob/main/backend/db/index.ts): `backend/db/index.ts`
- [Product data model](https://github.com/chinmaye5/converso/blob/main/backend/db/schema.ts): `backend/db/schema.ts`

### Other components

- **Workspace operator**
- **Chat visitor**
- [Supabase file storage](https://github.com/chinmaye5/converso/blob/main/backend/db/supabase.ts): `backend/db/supabase.ts`
- **Jina embeddings API**

## Connections

- Express API server → Workspace routes: mounts routes (evidence: `backend/server.ts`)
- Express API server → Chatbot routes: mounts routes (evidence: `backend/server.ts`)
- Express API server → Authenticated chat routes: mounts routes (evidence: `backend/server.ts`)
- Express API server → Public chat routes: mounts routes (evidence: `backend/server.ts`)
- Express API server → Ticket routes: mounts routes (evidence: `backend/server.ts`)
- Express API server → Knowledge search route: mounts routes (evidence: `backend/server.ts`)
- Express API server → Document ingestion: mounts document routes (evidence: `backend/server.ts`)
- Chatbot routes → Chatbot configuration: dispatches requests (evidence: `backend/routes/chatbot.routes.ts`)
- Workspace routes → Workspace management: dispatches requests (evidence: `backend/routes/workspace.route.ts`)
- Authenticated chat routes → Authenticated chat handling: dispatches requests (evidence: `backend/routes/chat.route.ts`)
- Public chat routes → Public chat handling: dispatches requests (evidence: `backend/routes/public-chat.route.ts`)
- Ticket routes → Ticket management: dispatches requests (evidence: `backend/routes/ticket.route.ts`)
- Authenticated chat handling → Answer generation: generates answers (evidence: `backend/controllers/chat.controller.ts`)
- Public chat handling → Answer generation: generates answers (evidence: `backend/controllers/public-chat.controller.ts`)
- Authenticated chat handling → Human handoff detection: checks handoff (evidence: `backend/controllers/chat.controller.ts`)
- Public chat handling → Human handoff detection: checks handoff (evidence: `backend/controllers/public-chat.controller.ts`)
- Answer generation → Semantic search: retrieves context (evidence: `backend/ai/chat.graph.ts`)
- Knowledge search route → Semantic search: runs search (evidence: `backend/routes/search.route.ts`)
- Document ingestion → PDF text processing: extracts and chunks (evidence: `backend/controllers/document.controller.ts`)
- Document ingestion → Embedding generation: embeds chunks (evidence: `backend/controllers/document.controller.ts`)
- Embedding generation → Jina embeddings API: requests vectors (evidence: `backend/utils/embedding.utils.ts`)
- Document ingestion → Supabase file storage: stores PDF files (evidence: `backend/controllers/document.controller.ts`)
- Semantic search → Embedding generation: embeds query (evidence: `backend/utils/search.utils.ts`)
- Document ingestion → PostgreSQL data access: stores documents (evidence: `backend/controllers/document.controller.ts`)
- Authenticated chat handling → PostgreSQL data access: reads and writes chats (evidence: `backend/controllers/chat.controller.ts`)
- Public chat handling → PostgreSQL data access: reads and writes chats (evidence: `backend/controllers/public-chat.controller.ts`)
- Chatbot configuration → PostgreSQL data access: manages chatbot records (evidence: `backend/controllers/chatbot.controller.ts`)
- Ticket management → PostgreSQL data access: manages tickets (evidence: `backend/controllers/ticket.controller.ts`)
- Semantic search → PostgreSQL data access: queries stored chunks (evidence: `backend/utils/search.utils.ts`)
- PostgreSQL data access → Product data model: uses schema (evidence: `backend/db/index.ts`)
- Workspace operator → Landing page: visits product site
- Landing page → Landing visual: renders visual (evidence: `frontend/components/landing/LandingPage.tsx`)
- Workspace operator → Authenticated app shell: opens workspace
- Authenticated app shell → Workspace selection: provides workspace state (evidence: `frontend/components/layout/AppShell.tsx`)
- Workspace dashboard → Workspace selection: reads workspace state (evidence: `frontend/components/dashboard/DashboardOverview.tsx`)
- Workspace dashboard → API client: loads dashboard data (evidence: `frontend/components/dashboard/DashboardOverview.tsx`)
- Conversation history → Workspace selection: reads workspace state (evidence: `frontend/components/conversations/ConversationsHistoryView.tsx`)
- Conversation history → API client: loads conversations (evidence: `frontend/components/conversations/ConversationsHistoryView.tsx`)
- Authenticated app shell → Operator feature views: hosts feature pages (evidence: `frontend/components/layout/AppShell.tsx`)
- Chat visitor → Public chat page: starts conversation (evidence: `frontend/app/chat/[chatbotId]/page.tsx`)
- Public chat page → Express API server: sends chat requests
- API client → Express API server: calls API
