# keerthana-089/gstnexus architecture

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

- Interactive diagram: https://gitdiagram.com/keerthana-089/gstnexus
- Repository: https://github.com/keerthana-089/gstnexus

## Overview

GSTNexus is a browser-based GST reconciliation product: users sign in, then use the console to upload return data and review reconciliation, graph, vendor-risk, audit, and assistant features. The sampled code confirms authentication, session gating, and sidebar navigation; README feature descriptions supply the domain capabilities. Most feature-page implementations and backend wiring were not sampled, so those links are shown only as documented or unverified rather than as inferred calls.

Main entry points: [`src/components/AppSidebar.tsx`](https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppSidebar.tsx) (Console Navigation), [`src/App.tsx`](https://github.com/keerthana-089/gstnexus/blob/main/src/App.tsx) (React App), [`src/components/AppLayout.tsx`](https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppLayout.tsx) (Signed-in Layout), [`src/integrations/supabase/client.ts`](https://github.com/keerthana-089/gstnexus/blob/main/src/integrations/supabase/client.ts) (Supabase Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application Shell"]
  node_app["React App<br/>[App.tsx]"]
  node_layout["Signed-in Layout<br/>[AppLayout.tsx]"]
  node_sidebar["Console Navigation<br/>[AppSidebar.tsx]"]
  node_landing["Landing Page<br/>[Index.tsx]"]
end

subgraph group_gst["GST Workflows"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_upload["GST Data Upload<br/>[Upload.tsx]"]
  node_reconcile["Reconciliation<br/>[Reconciliation.tsx]"]
  node_graph["Graph Explorer<br/>[Graph.tsx]"]
  node_vendors["Vendor Risk<br/>[Vendors.tsx]"]
  node_audit["Audit Trails<br/>[Audit.tsx]"]
  node_settings["Settings<br/>[Settings.tsx]"]
end

subgraph group_identity["Identity and Data"]
  node_authpage["Login and Register<br/>[Auth.tsx]"]
  node_session["Session Hook<br/>[auth.ts]"]
  node_supabase["Supabase Client<br/>[client.ts]"]
  node_database[("Supabase Postgres")]
end

subgraph group_assistant["AI Assistance"]
  node_assistantpage["GST Assistant<br/>[Assistant.tsx]"]
  node_chatfunction["Chat Function<br/>[index.ts]"]
  node_ai["AI Gateway"]
end

node_user(("GST User"))

node_user -->|"uses"| node_app
node_app -.->|"presents"| node_landing
node_app -.->|"routes"| node_layout
node_user -->|"signs in"| node_authpage
node_authpage -->|"authenticates"| node_supabase
node_layout -->|"checks session"| node_session
node_session -->|"reads auth state"| node_supabase
node_layout -->|"renders"| node_sidebar
node_sidebar -->|"routes"| node_dashboard
node_sidebar -->|"routes"| node_upload
node_sidebar -->|"routes"| node_reconcile
node_sidebar -->|"routes"| node_graph
node_sidebar -->|"routes"| node_vendors
node_sidebar -->|"routes"| node_audit
node_sidebar -->|"routes"| node_assistantpage
node_sidebar -->|"routes"| node_settings
node_supabase -.->|"connects"| node_database
node_assistantpage -.->|"sends prompts"| node_chatfunction
node_chatfunction -.->|"requests answers"| node_ai
node_upload -.->|"stores returns"| node_database
node_reconcile -.->|"matches return data"| node_database
node_graph -.->|"visualizes trade data"| node_database
node_vendors -.->|"assesses vendors"| node_database
node_audit -.->|"records actions"| node_database

click node_app "https://github.com/keerthana-089/gstnexus/blob/main/src/App.tsx"
click node_layout "https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppLayout.tsx"
click node_sidebar "https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppSidebar.tsx"
click node_landing "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Index.tsx"
click node_authpage "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Auth.tsx"
click node_session "https://github.com/keerthana-089/gstnexus/blob/main/src/lib/auth.ts"
click node_supabase "https://github.com/keerthana-089/gstnexus/blob/main/src/integrations/supabase/client.ts"
click node_dashboard "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Dashboard.tsx"
click node_upload "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Upload.tsx"
click node_reconcile "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Reconciliation.tsx"
click node_graph "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Graph.tsx"
click node_vendors "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Vendors.tsx"
click node_audit "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Audit.tsx"
click node_settings "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Settings.tsx"
click node_assistantpage "https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Assistant.tsx"
click node_chatfunction "https://github.com/keerthana-089/gstnexus/blob/main/supabase/functions/gst-chat/index.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_layout,node_sidebar,node_landing,node_user toneBlue
class node_dashboard,node_upload,node_reconcile,node_graph,node_vendors,node_audit,node_settings toneAmber
class node_authpage,node_session,node_supabase,node_database toneMint
class node_assistantpage,node_chatfunction,node_ai toneRose
```

## Components

### Application Shell

- [React App](https://github.com/keerthana-089/gstnexus/blob/main/src/App.tsx): `src/App.tsx`
- [Signed-in Layout](https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppLayout.tsx): `src/components/AppLayout.tsx`
- [Console Navigation](https://github.com/keerthana-089/gstnexus/blob/main/src/components/AppSidebar.tsx): `src/components/AppSidebar.tsx`
- [Landing Page](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`

### GST Workflows

- [Dashboard](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [GST Data Upload](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Upload.tsx): `src/pages/Upload.tsx`
- [Reconciliation](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Reconciliation.tsx): `src/pages/Reconciliation.tsx`
- [Graph Explorer](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Graph.tsx): `src/pages/Graph.tsx`
- [Vendor Risk](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Vendors.tsx): `src/pages/Vendors.tsx`
- [Audit Trails](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Audit.tsx): `src/pages/Audit.tsx`
- [Settings](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`

### Identity and Data

- [Login and Register](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [Session Hook](https://github.com/keerthana-089/gstnexus/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Supabase Client](https://github.com/keerthana-089/gstnexus/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- **Supabase Postgres**

### AI Assistance

- [GST Assistant](https://github.com/keerthana-089/gstnexus/blob/main/src/pages/Assistant.tsx): `src/pages/Assistant.tsx`
- [Chat Function](https://github.com/keerthana-089/gstnexus/blob/main/supabase/functions/gst-chat/index.ts): `supabase/functions/gst-chat/index.ts`
- **AI Gateway**

### Other components

- **GST User**

## Connections

- GST User → React App: uses
- React App → Landing Page: presents
- React App → Signed-in Layout: routes
- GST User → Login and Register: signs in (evidence: `src/pages/Auth.tsx`)
- Login and Register → Supabase Client: authenticates (evidence: `src/pages/Auth.tsx`)
- Signed-in Layout → Session Hook: checks session (evidence: `src/components/AppLayout.tsx`)
- Session Hook → Supabase Client: reads auth state (evidence: `src/lib/auth.ts`)
- Signed-in Layout → Console Navigation: renders (evidence: `src/components/AppLayout.tsx`)
- Console Navigation → Dashboard: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → GST Data Upload: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → Reconciliation: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → Graph Explorer: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → Vendor Risk: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → Audit Trails: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → GST Assistant: routes (evidence: `src/components/AppSidebar.tsx`)
- Console Navigation → Settings: routes (evidence: `src/components/AppSidebar.tsx`)
- Supabase Client → Supabase Postgres: connects
- GST Assistant → Chat Function: sends prompts
- Chat Function → AI Gateway: requests answers
- GST Data Upload → Supabase Postgres: stores returns
- Reconciliation → Supabase Postgres: matches return data
- Graph Explorer → Supabase Postgres: visualizes trade data
- Vendor Risk → Supabase Postgres: assesses vendors
- Audit Trails → Supabase Postgres: records actions
