# paarth-goela/nexusflow-ticket-triager architecture

> Architecture diagram of the GitHub repository paarth-goela/nexusflow-ticket-triager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paarth-goela/nexusflow-ticket-triager
- Repository: https://github.com/paarth-goela/nexusflow-ticket-triager

## Overview

NexusFlow is a multi-team ticket-management web app: customers submit and track issues, while operations, factory, and logistics teams review and act on shared tickets. The sampled ticket context loads demo data or authenticated Supabase records and persists changes; its creation path explicitly uses simulated triage rather than a real AI service. The README also describes AI-powered routing and AWS, but no sampled implementation establishes those integrations, so they are shown only as unverified. Several page implementations were not sampled, so some portal links rely on README claims.

Main entry points: [`nexusflow/apps/web/src/lib/ticket-context.tsx`](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/ticket-context.tsx) (Ticket state), [`nexusflow/apps/web/src/app/page.tsx`](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/page.tsx) (Portal entry), [`nexusflow/apps/web/src/lib/supabase/client.ts`](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/supabase/client.ts) (Browser client), [`nexusflow/apps/web/src/components/portal/department-portal.tsx`](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/portal/department-portal.tsx) (Department views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Portals &amp; dashboards"]
  node_home["Portal entry<br/>[page.tsx]"]
  node_customer_portal["Customer portal<br/>[page.tsx]"]
  node_operations["Operations hub<br/>[page.tsx]"]
  node_factory["Factory hub<br/>[page.tsx]"]
  node_logistics["Logistics hub<br/>[page.tsx]"]
  node_department_portal["Department views"]
end

subgraph group_ticket_ops["Ticket workflow"]
  node_ticket_table["Ticket queue<br/>[ticket-table.tsx]"]
  node_ticket_detail["Ticket details"]
  node_ticket_state["Ticket state<br/>[ticket-context.tsx]"]
  node_ai_triage["Simulated triage<br/>[ticket-context.tsx]"]
end

subgraph group_identity["Authentication"]
  node_auth_pages["Sign-in &amp; signup<br/>[auth-form.tsx]"]
  node_auth_gate["Access gate<br/>[auth-gate.tsx]"]
  node_session_proxy["Session proxy<br/>[proxy.ts]"]
  node_callback["Auth callback<br/>[route.ts]"]
end

subgraph group_data["Data &amp; integrations"]
  node_demo_data["Demo tickets<br/>[mock-data.ts]"]
  node_supabase_client["Browser client<br/>[client.ts]"]
  node_supabase_server["Server client<br/>[server.ts]"]
end

node_customer(("Customer"))
node_staff(("Internal teams"))
node_supabase[("Supabase")]
node_openai["OpenAI service"]
node_aws["AWS services"]

node_customer -->|"opens"| node_home
node_staff -->|"opens"| node_home
node_home -->|"links to"| node_customer_portal
node_home -->|"links to"| node_operations
node_home -->|"links to"| node_factory
node_home -->|"links to"| node_logistics
node_customer_portal -.->|"uses tickets"| node_ticket_state
node_operations -.->|"shows queue"| node_ticket_table
node_factory -.->|"renders"| node_department_portal
node_logistics -.->|"renders"| node_department_portal
node_department_portal -->|"opens details"| node_ticket_detail
node_ticket_table -->|"opens details"| node_ticket_detail
node_ticket_detail -->|"updates tickets"| node_ticket_state
node_ticket_state -->|"initializes from"| node_demo_data
node_ticket_state -->|"creates client"| node_supabase_client
node_ticket_state -->|"reads and writes"| node_supabase
node_ticket_state -->|"sets simulated summary"| node_ai_triage
node_auth_pages -.->|"uses"| node_supabase_client
node_auth_gate -->|"checks user"| node_supabase_client
node_session_proxy -->|"checks claims"| node_supabase
node_callback -.->|"uses"| node_supabase_server
node_supabase_client -->|"connects to"| node_supabase
node_supabase_server -->|"connects to"| node_supabase
node_ticket_state -.->|"future integration"| node_openai
node_ticket_state -.->|"possible hosting"| node_aws

click node_home "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/page.tsx"
click node_customer_portal "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/customer/page.tsx"
click node_operations "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/operations/page.tsx"
click node_factory "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/factory/page.tsx"
click node_logistics "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/logistics/page.tsx"
click node_department_portal "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/portal/department-portal.tsx"
click node_ticket_table "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/dashboard/ticket-table.tsx"
click node_ticket_detail "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/tickets/ticket-detail-panel.tsx"
click node_ticket_state "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/ticket-context.tsx"
click node_ai_triage "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/ticket-context.tsx"
click node_auth_pages "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/auth/auth-form.tsx"
click node_auth_gate "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/auth/auth-gate.tsx"
click node_session_proxy "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/proxy.ts"
click node_callback "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/auth/callback/route.ts"
click node_demo_data "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/mock-data.ts"
click node_supabase_client "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/supabase/client.ts"
click node_supabase_server "https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/supabase/server.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_home,node_customer_portal,node_operations,node_factory,node_logistics,node_department_portal toneBlue
class node_ticket_table,node_ticket_detail,node_ticket_state,node_ai_triage,node_supabase toneAmber
class node_auth_pages,node_auth_gate,node_session_proxy,node_callback toneMint
class node_demo_data,node_supabase_client,node_supabase_server toneRose
class node_customer,node_staff,node_openai,node_aws toneIndigo
```

## Components

### Portals & dashboards

- [Portal entry](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/page.tsx): `nexusflow/apps/web/src/app/page.tsx`
- [Customer portal](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/customer/page.tsx): `nexusflow/apps/web/src/app/customer/page.tsx`
- [Operations hub](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/operations/page.tsx): `nexusflow/apps/web/src/app/operations/page.tsx`
- [Factory hub](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/factory/page.tsx): `nexusflow/apps/web/src/app/factory/page.tsx`
- [Logistics hub](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/logistics/page.tsx): `nexusflow/apps/web/src/app/logistics/page.tsx`
- [Department views](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/portal/department-portal.tsx): `nexusflow/apps/web/src/components/portal/department-portal.tsx`

### Ticket workflow

- [Ticket queue](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/dashboard/ticket-table.tsx): `nexusflow/apps/web/src/components/dashboard/ticket-table.tsx`
- [Ticket details](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/tickets/ticket-detail-panel.tsx): `nexusflow/apps/web/src/components/tickets/ticket-detail-panel.tsx`
- [Ticket state](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/ticket-context.tsx): `nexusflow/apps/web/src/lib/ticket-context.tsx`
- [Simulated triage](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/ticket-context.tsx): `nexusflow/apps/web/src/lib/ticket-context.tsx`

### Authentication

- [Sign-in & signup](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/auth/auth-form.tsx): `nexusflow/apps/web/src/components/auth/auth-form.tsx`
- [Access gate](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/components/auth/auth-gate.tsx): `nexusflow/apps/web/src/components/auth/auth-gate.tsx`
- [Session proxy](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/proxy.ts): `nexusflow/apps/web/src/proxy.ts`
- [Auth callback](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/app/auth/callback/route.ts): `nexusflow/apps/web/src/app/auth/callback/route.ts`

### Data & integrations

- [Demo tickets](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/mock-data.ts): `nexusflow/apps/web/src/lib/mock-data.ts`
- [Browser client](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/supabase/client.ts): `nexusflow/apps/web/src/lib/supabase/client.ts`
- [Server client](https://github.com/paarth-goela/nexusflow-ticket-triager/blob/main/nexusflow/apps/web/src/lib/supabase/server.ts): `nexusflow/apps/web/src/lib/supabase/server.ts`

### Other components

- **Customer**
- **Internal teams**
- **Supabase**
- **OpenAI service**
- **AWS services**

## Connections

- Customer → Portal entry: opens (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Internal teams → Portal entry: opens (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Portal entry → Customer portal: links to (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Portal entry → Operations hub: links to (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Portal entry → Factory hub: links to (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Portal entry → Logistics hub: links to (evidence: `nexusflow/apps/web/src/app/page.tsx`)
- Customer portal → Ticket state: uses tickets
- Operations hub → Ticket queue: shows queue
- Factory hub → Department views: renders
- Logistics hub → Department views: renders
- Department views → Ticket details: opens details (evidence: `nexusflow/apps/web/src/components/portal/department-portal.tsx`)
- Ticket queue → Ticket details: opens details (evidence: `nexusflow/apps/web/src/components/dashboard/ticket-table.tsx`)
- Ticket details → Ticket state: updates tickets (evidence: `nexusflow/apps/web/src/components/tickets/ticket-detail-panel.tsx`)
- Ticket state → Demo tickets: initializes from (evidence: `nexusflow/apps/web/src/lib/ticket-context.tsx`)
- Ticket state → Browser client: creates client (evidence: `nexusflow/apps/web/src/lib/ticket-context.tsx`)
- Ticket state → Supabase: reads and writes (evidence: `nexusflow/apps/web/src/lib/ticket-context.tsx`)
- Ticket state → Simulated triage: sets simulated summary (evidence: `nexusflow/apps/web/src/lib/ticket-context.tsx`)
- Sign-in & signup → Browser client: uses
- Access gate → Browser client: checks user (evidence: `nexusflow/apps/web/src/components/auth/auth-gate.tsx`)
- Session proxy → Supabase: checks claims (evidence: `nexusflow/apps/web/src/proxy.ts`)
- Auth callback → Server client: uses
- Browser client → Supabase: connects to (evidence: `nexusflow/apps/web/src/lib/supabase/client.ts`)
- Server client → Supabase: connects to (evidence: `nexusflow/apps/web/src/lib/supabase/server.ts`)
- Ticket state → OpenAI service: future integration
- Ticket state → AWS services: possible hosting
