# khayatisri25/cognitrap-ai architecture

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

- Interactive diagram: https://gitdiagram.com/khayatisri25/cognitrap-ai
- Repository: https://github.com/khayatisri25/cognitrap-ai

## Overview

CogniTrap AI is presented as an insider-threat detection SOC dashboard, but the sampled runtime is a client-side demonstration: it renders simulated users, decoys, and logs rather than showing integrations with identity, endpoint, or storage services. The main user path is landing page → dashboard route → dashboard views for network activity, logs, deception assets, and analytics. TanStack Start supplies routing and server rendering; the server entry also normalizes certain SSR failures. Several dashboard subcomponents and routes are unsampled, so their relationships are included only where the source index or excerpts support them.

Main entry points: [`src/components/cognitrap/Dashboard.tsx`](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/Dashboard.tsx) (SOC dashboard), [`src/routeTree.gen.ts`](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routeTree.gen.ts) (Route registry), [`src/server.ts`](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/server.ts) (Server entry), [`src/components/cognitrap/data.ts`](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/data.ts) (Demo data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Product interface"]
  node_landing["Landing page<br/>[index.tsx]"]
  node_dashboard["SOC dashboard<br/>[Dashboard.tsx]"]
  node_network["Behavior map<br/>[NetworkMap.tsx]"]
  node_logs["Event stream<br/>[LogStream.tsx]"]
  node_vault["Deception vault<br/>[DeceptionVault.tsx]"]
  node_simdata["Demo data<br/>[data.ts]"]
end

subgraph group_routing["Routing and rendering"]
  node_dashboard_route["Dashboard route<br/>[dashboard.tsx]"]
  node_demo_route["Demo route<br/>[demo.tsx]"]
  node_root_route["Root route<br/>[__root.tsx]"]
  node_route_tree["Route registry<br/>[routeTree.gen.ts]"]
  node_router["Router setup<br/>[router.tsx]"]
end

subgraph group_runtime["Server resilience"]
  node_server["Server entry<br/>[server.ts]"]
  node_start_server["Start server runtime"]
  node_error_capture["Error capture<br/>[error-capture.ts]"]
  node_error_page["Fallback error page<br/>[error-page.ts]"]
  node_reporting["Error reporting"]
end

node_visitor(("SOC user"))
node_http_client(("HTTP caller"))

node_visitor -->|"opens"| node_landing
node_visitor -.->|"navigates to"| node_dashboard_route
node_dashboard_route -->|"renders"| node_dashboard
node_dashboard -->|"renders"| node_network
node_dashboard -->|"renders"| node_logs
node_dashboard -->|"renders"| node_vault
node_dashboard -->|"uses demo data"| node_simdata
node_network -->|"uses demo data"| node_simdata
node_logs -->|"uses demo data"| node_simdata
node_vault -->|"uses demo data"| node_simdata
node_root_route -->|"configures"| node_reporting
node_route_tree -->|"registers"| node_root_route
node_route_tree -->|"registers"| node_landing
node_route_tree -->|"registers"| node_dashboard_route
node_route_tree -->|"registers"| node_demo_route
node_router -->|"uses route tree"| node_route_tree
node_http_client -->|"sends request"| node_server
node_server -->|"dispatches to"| node_start_server
node_server -->|"consumes captured error"| node_error_capture
node_server -->|"renders fallback"| node_error_page

click node_landing "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/index.tsx"
click node_dashboard_route "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/dashboard.tsx"
click node_dashboard "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/Dashboard.tsx"
click node_network "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/NetworkMap.tsx"
click node_logs "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/LogStream.tsx"
click node_vault "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/DeceptionVault.tsx"
click node_simdata "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/data.ts"
click node_demo_route "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/demo.tsx"
click node_root_route "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/__root.tsx"
click node_route_tree "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routeTree.gen.ts"
click node_router "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/router.tsx"
click node_server "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/server.ts"
click node_error_capture "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/error-capture.ts"
click node_error_page "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/error-page.ts"
click node_reporting "https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/lovable-error-reporting.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_dashboard,node_network,node_logs,node_vault,node_simdata,node_visitor toneBlue
class node_dashboard_route,node_demo_route,node_root_route,node_route_tree,node_router toneAmber
class node_server,node_start_server,node_error_capture,node_error_page,node_reporting toneMint
class node_http_client toneIndigo
```

## Components

### Product interface

- [Landing page](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [SOC dashboard](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/Dashboard.tsx): `src/components/cognitrap/Dashboard.tsx`
- [Behavior map](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/NetworkMap.tsx): `src/components/cognitrap/NetworkMap.tsx`
- [Event stream](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/LogStream.tsx): `src/components/cognitrap/LogStream.tsx`
- [Deception vault](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/DeceptionVault.tsx): `src/components/cognitrap/DeceptionVault.tsx`
- [Demo data](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/components/cognitrap/data.ts): `src/components/cognitrap/data.ts`

### Routing and rendering

- [Dashboard route](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`
- [Demo route](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/demo.tsx): `src/routes/demo.tsx`
- [Root route](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Route registry](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Router setup](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/router.tsx): `src/router.tsx`

### Server resilience

- [Server entry](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/server.ts): `src/server.ts`
- **Start server runtime**
- [Error capture](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Fallback error page](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`
- [Error reporting](https://github.com/khayatisri25/cognitrap-ai/blob/main/src/lib/lovable-error-reporting.ts): `src/lib/lovable-error-reporting.ts`

### Other components

- **SOC user**
- **HTTP caller**

## Connections

- SOC user → Landing page: opens (evidence: `src/routes/index.tsx`)
- SOC user → Dashboard route: navigates to
- Dashboard route → SOC dashboard: renders (evidence: `src/routes/dashboard.tsx`)
- SOC dashboard → Behavior map: renders (evidence: `src/components/cognitrap/Dashboard.tsx`)
- SOC dashboard → Event stream: renders (evidence: `src/components/cognitrap/Dashboard.tsx`)
- SOC dashboard → Deception vault: renders (evidence: `src/components/cognitrap/Dashboard.tsx`)
- SOC dashboard → Demo data: uses demo data (evidence: `src/components/cognitrap/Dashboard.tsx`)
- Behavior map → Demo data: uses demo data (evidence: `src/components/cognitrap/NetworkMap.tsx`)
- Event stream → Demo data: uses demo data (evidence: `src/components/cognitrap/LogStream.tsx`)
- Deception vault → Demo data: uses demo data (evidence: `src/components/cognitrap/DeceptionVault.tsx`)
- Root route → Error reporting: configures (evidence: `src/routes/__root.tsx`)
- Route registry → Root route: registers (evidence: `src/routeTree.gen.ts`)
- Route registry → Landing page: registers (evidence: `src/routeTree.gen.ts`)
- Route registry → Dashboard route: registers (evidence: `src/routeTree.gen.ts`)
- Route registry → Demo route: registers (evidence: `src/routeTree.gen.ts`)
- Router setup → Route registry: uses route tree (evidence: `src/router.tsx`)
- HTTP caller → Server entry: sends request (evidence: `src/server.ts`)
- Server entry → Start server runtime: dispatches to (evidence: `src/server.ts`)
- Server entry → Error capture: consumes captured error (evidence: `src/server.ts`)
- Server entry → Fallback error page: renders fallback (evidence: `src/server.ts`)
