# anthonyy616/antlyst architecture

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

- Interactive diagram: https://gitdiagram.com/anthonyy616/antlyst
- Repository: https://github.com/anthonyy616/antlyst

## Overview

Antlyst is a web-based data visualization product: users upload CSV data, then explore generated dashboards in different styles. The repository also includes data-source integrations, dataset profiling and analysis, AI assistance, and project collaboration features. The graph emphasizes the documented upload-to-dashboard workflow and the sampled route/service relationships; unsampled branches are represented at their existing directories, and their internal wiring is not inferred.

Main entry points: [`src/lib/prisma.ts`](https://github.com/anthonyy616/antlyst/blob/main/src/lib/prisma.ts) (Application database), [`src/app/api/ai/chat/route.ts`](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/ai/chat/route.ts) (AI chat endpoint), [`src/components/dashboard/engine-wrapper.tsx`](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/engine-wrapper.tsx) (Dashboard engine selector), [`src/lib/dataset-profiler.ts`](https://github.com/anthonyy616/antlyst/blob/main/src/lib/dataset-profiler.ts) (Dataset profiler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_project_ui["Project workspace<br/>[page.tsx]"]
  node_dashboard_ui["Dashboard views<br/>[page.tsx]"]
end

subgraph group_ingestion["Data ingestion"]
  node_data_connector["Data connector<br/>[DataConnector.tsx]"]
  node_upload_api["Upload endpoint<br/>[route.ts]"]
  node_file_processing["File processing endpoint<br/>[route.ts]"]
  node_datasources_api["Data-source API<br/>[route.ts]"]
  node_background_fetch["Background data fetch"]
end

subgraph group_visualization["Analysis and dashboards"]
  node_engine_wrapper["Dashboard engine selector<br/>[engine-wrapper.tsx]"]
  node_simple_engine["Simple charts<br/>[simple-engine.tsx]"]
  node_ml_engine["ML plots<br/>[MLPlotsEngine.tsx]"]
  node_powerbi_engine["Power BI dashboards<br/>[PowerBIEngine.tsx]"]
end

subgraph group_intelligence["AI and insights"]
  node_profiling_api["Dataset profiling API<br/>[route.ts]"]
  node_column_validation["Column classification"]
  node_dataset_profiler["Dataset profiler"]
  node_insight_engine["Automated insights<br/>[insight-engine.ts]"]
  node_ai_chat_api["AI chat endpoint<br/>[route.ts]"]
  node_ai_context["AI context builder"]
  node_ai_service["AI service<br/>[ai-service.ts]"]
end

subgraph group_platform["Platform services"]
  node_project_api["Project API<br/>[route.ts]"]
  node_organization_api["Organization API<br/>[route.ts]"]
  node_organization_service["Organization service<br/>[org.service.ts]"]
  node_database[("Application database<br/>[prisma.ts]")]
  node_object_storage[("R2 object storage<br/>[r2.ts]")]
end

node_analyst(("Analyst"))

node_analyst -->|"uploads data"| node_project_ui
node_project_ui -->|"opens dashboard"| node_dashboard_ui
node_dashboard_ui -.->|"selects style"| node_engine_wrapper
node_engine_wrapper -->|"renders"| node_simple_engine
node_engine_wrapper -->|"renders"| node_ml_engine
node_engine_wrapper -->|"renders"| node_powerbi_engine
node_engine_wrapper -->|"renders"| node_data_connector
node_data_connector -.->|"submits upload"| node_upload_api
node_upload_api -->|"records upload"| node_database
node_upload_api -->|"stores file"| node_object_storage
node_file_processing -->|"reads and updates"| node_database
node_file_processing -->|"reads file"| node_object_storage
node_file_processing -->|"validates columns"| node_column_validation
node_datasources_api -->|"reads and writes"| node_database
node_datasources_api -->|"starts fetch"| node_background_fetch
node_profiling_api -->|"loads dataset"| node_database
node_profiling_api -->|"reads dataset"| node_object_storage
node_profiling_api -->|"profiles rows"| node_dataset_profiler
node_dataset_profiler -->|"classifies columns"| node_column_validation
node_insight_engine -->|"profiles rows"| node_dataset_profiler
node_ai_chat_api -->|"loads project"| node_database
node_ai_chat_api -->|"loads dataset"| node_object_storage
node_ai_chat_api -->|"profiles dataset"| node_dataset_profiler
node_ai_chat_api -->|"builds context"| node_ai_context
node_ai_chat_api -->|"selects model"| node_ai_service
node_project_api -->|"uses persistence"| node_database
node_organization_api -->|"delegates"| node_organization_service
node_organization_service -->|"uses persistence"| node_database

click node_project_ui "https://github.com/anthonyy616/antlyst/blob/main/src/app/(protected)/(dashboard)/%5BorgId%5D/projects/%5BprojectId%5D/page.tsx"
click node_dashboard_ui "https://github.com/anthonyy616/antlyst/blob/main/src/app/(protected)/(dashboard)/%5BorgId%5D/projects/%5BprojectId%5D/dashboard/%5Bstyle%5D/page.tsx"
click node_engine_wrapper "https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/engine-wrapper.tsx"
click node_simple_engine "https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/simple-engine.tsx"
click node_ml_engine "https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/MLPlotsEngine.tsx"
click node_powerbi_engine "https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/PowerBIEngine.tsx"
click node_data_connector "https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/DataConnector.tsx"
click node_upload_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/upload/route.ts"
click node_file_processing "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/files/process/route.ts"
click node_datasources_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/datasources/route.ts"
click node_profiling_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/datasets/profile/route.ts"
click node_column_validation "https://github.com/anthonyy616/antlyst/blob/main/src/lib/column-validator.ts"
click node_dataset_profiler "https://github.com/anthonyy616/antlyst/blob/main/src/lib/dataset-profiler.ts"
click node_insight_engine "https://github.com/anthonyy616/antlyst/blob/main/src/lib/insight-engine.ts"
click node_ai_chat_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/ai/chat/route.ts"
click node_ai_context "https://github.com/anthonyy616/antlyst/blob/main/src/lib/ai-context-builder.ts"
click node_ai_service "https://github.com/anthonyy616/antlyst/blob/main/src/lib/ai-service.ts"
click node_project_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/projects/route.ts"
click node_organization_api "https://github.com/anthonyy616/antlyst/blob/main/src/app/api/org/route.ts"
click node_organization_service "https://github.com/anthonyy616/antlyst/blob/main/src/lib/services/org.service.ts"
click node_database "https://github.com/anthonyy616/antlyst/blob/main/src/lib/prisma.ts"
click node_object_storage "https://github.com/anthonyy616/antlyst/blob/main/src/lib/r2.ts"
click node_background_fetch "https://github.com/anthonyy616/antlyst/blob/main/src/lib/background-fetch.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_project_ui,node_dashboard_ui toneBlue
class node_data_connector,node_upload_api,node_file_processing,node_datasources_api,node_background_fetch toneAmber
class node_engine_wrapper,node_simple_engine,node_ml_engine,node_powerbi_engine toneMint
class node_profiling_api,node_column_validation,node_dataset_profiler,node_insight_engine,node_ai_chat_api,node_ai_context,node_ai_service toneRose
class node_project_api,node_organization_api,node_organization_service,node_database,node_object_storage,node_analyst toneIndigo
```

## Components

### User experience

- [Project workspace](https://github.com/anthonyy616/antlyst/blob/main/src/app/(protected)/(dashboard)/%5BorgId%5D/projects/%5BprojectId%5D/page.tsx): `src/app/(protected)/(dashboard)/[orgId]/projects/[projectId]/page.tsx`
- [Dashboard views](https://github.com/anthonyy616/antlyst/blob/main/src/app/(protected)/(dashboard)/%5BorgId%5D/projects/%5BprojectId%5D/dashboard/%5Bstyle%5D/page.tsx): `src/app/(protected)/(dashboard)/[orgId]/projects/[projectId]/dashboard/[style]/page.tsx`

### Data ingestion

- [Data connector](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/DataConnector.tsx): `src/components/dashboard/DataConnector.tsx`
- [Upload endpoint](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/upload/route.ts): `src/app/api/upload/route.ts`
- [File processing endpoint](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/files/process/route.ts): `src/app/api/files/process/route.ts`
- [Data-source API](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/datasources/route.ts): `src/app/api/datasources/route.ts`
- [Background data fetch](https://github.com/anthonyy616/antlyst/blob/main/src/lib/background-fetch.ts): `src/lib/background-fetch.ts`

### Analysis and dashboards

- [Dashboard engine selector](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/engine-wrapper.tsx): `src/components/dashboard/engine-wrapper.tsx`
- [Simple charts](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/simple-engine.tsx): `src/components/dashboard/simple-engine.tsx`
- [ML plots](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/MLPlotsEngine.tsx): `src/components/dashboard/MLPlotsEngine.tsx`
- [Power BI dashboards](https://github.com/anthonyy616/antlyst/blob/main/src/components/dashboard/PowerBIEngine.tsx): `src/components/dashboard/PowerBIEngine.tsx`

### AI and insights

- [Dataset profiling API](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/datasets/profile/route.ts): `src/app/api/datasets/profile/route.ts`
- [Column classification](https://github.com/anthonyy616/antlyst/blob/main/src/lib/column-validator.ts): `src/lib/column-validator.ts`
- [Dataset profiler](https://github.com/anthonyy616/antlyst/blob/main/src/lib/dataset-profiler.ts): `src/lib/dataset-profiler.ts`
- [Automated insights](https://github.com/anthonyy616/antlyst/blob/main/src/lib/insight-engine.ts): `src/lib/insight-engine.ts`
- [AI chat endpoint](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/ai/chat/route.ts): `src/app/api/ai/chat/route.ts`
- [AI context builder](https://github.com/anthonyy616/antlyst/blob/main/src/lib/ai-context-builder.ts): `src/lib/ai-context-builder.ts`
- [AI service](https://github.com/anthonyy616/antlyst/blob/main/src/lib/ai-service.ts): `src/lib/ai-service.ts`

### Platform services

- [Project API](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/projects/route.ts): `src/app/api/projects/route.ts`
- [Organization API](https://github.com/anthonyy616/antlyst/blob/main/src/app/api/org/route.ts): `src/app/api/org/route.ts`
- [Organization service](https://github.com/anthonyy616/antlyst/blob/main/src/lib/services/org.service.ts): `src/lib/services/org.service.ts`
- [Application database](https://github.com/anthonyy616/antlyst/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- [R2 object storage](https://github.com/anthonyy616/antlyst/blob/main/src/lib/r2.ts): `src/lib/r2.ts`

### Other components

- **Analyst**

## Connections

- Analyst → Project workspace: uploads data
- Project workspace → Dashboard views: opens dashboard
- Dashboard views → Dashboard engine selector: selects style
- Dashboard engine selector → Simple charts: renders (evidence: `src/components/dashboard/engine-wrapper.tsx`)
- Dashboard engine selector → ML plots: renders (evidence: `src/components/dashboard/engine-wrapper.tsx`)
- Dashboard engine selector → Power BI dashboards: renders (evidence: `src/components/dashboard/engine-wrapper.tsx`)
- Dashboard engine selector → Data connector: renders (evidence: `src/components/dashboard/engine-wrapper.tsx`)
- Data connector → Upload endpoint: submits upload
- Upload endpoint → Application database: records upload (evidence: `src/app/api/upload/route.ts`)
- Upload endpoint → R2 object storage: stores file (evidence: `src/app/api/upload/route.ts`)
- File processing endpoint → Application database: reads and updates (evidence: `src/app/api/files/process/route.ts`)
- File processing endpoint → R2 object storage: reads file (evidence: `src/app/api/files/process/route.ts`)
- File processing endpoint → Column classification: validates columns (evidence: `src/app/api/files/process/route.ts`)
- Data-source API → Application database: reads and writes (evidence: `src/app/api/datasources/route.ts`)
- Data-source API → Background data fetch: starts fetch (evidence: `src/app/api/datasources/route.ts`)
- Dataset profiling API → Application database: loads dataset (evidence: `src/app/api/datasets/profile/route.ts`)
- Dataset profiling API → R2 object storage: reads dataset (evidence: `src/app/api/datasets/profile/route.ts`)
- Dataset profiling API → Dataset profiler: profiles rows (evidence: `src/app/api/datasets/profile/route.ts`)
- Dataset profiler → Column classification: classifies columns (evidence: `src/lib/dataset-profiler.ts`)
- Automated insights → Dataset profiler: profiles rows (evidence: `src/lib/insight-engine.ts`)
- AI chat endpoint → Application database: loads project (evidence: `src/app/api/ai/chat/route.ts`)
- AI chat endpoint → R2 object storage: loads dataset (evidence: `src/app/api/ai/chat/route.ts`)
- AI chat endpoint → Dataset profiler: profiles dataset (evidence: `src/app/api/ai/chat/route.ts`)
- AI chat endpoint → AI context builder: builds context (evidence: `src/app/api/ai/chat/route.ts`)
- AI chat endpoint → AI service: selects model (evidence: `src/app/api/ai/chat/route.ts`)
- Project API → Application database: uses persistence (evidence: `src/app/api/projects/route.ts`)
- Organization API → Organization service: delegates (evidence: `src/app/api/org/route.ts`)
- Organization service → Application database: uses persistence (evidence: `src/lib/services/org.service.ts`)
