This document explains how iOpsData is structured across the frontend, backend, data layer, and AI layer.
iOpsData is an AI-native operating system for data work. It combines a conversational workspace with structured data context, safe execution, and lineage tracking.
High-level flow:
- User asks a question in the UI.
- Backend builds schema context and calls an LLM provider.
- SQL is generated and optionally executed.
- Results, lineage, and metadata are returned to the UI.
Core components:
- FastAPI app (
src/iopsdata/api/main.py) with modular route files. - Connection manager to register and manage database connections.
- LLM router to select providers (OpenAI, Anthropic, Groq, etc.).
- Lineage parser to extract tables, columns, and CTEs from SQL.
Primary routes:
/api/chat→ NL-to-SQL generation + optional execution/api/execute→ Execute SQL on a stored connection/api/connections→ Create / inspect / delete connections/api/files/*→ Upload and profile files/api/lineage→ Parse SQL for lineage
Key concepts:
- Next.js for routing and SSR
- Component library built with Tailwind + Radix
- State management with Zustand and React Query
Responsibilities:
- Query orchestration (chat + SQL editor)
- Dataset exploration and profiling results
- Visualizations and table previews
- User settings and LLM configuration
iOpsData uses Supabase for auth and metadata storage.
Suggested tables:
user_settingsuser_id(UUID)settings(JSONB)
workspace_connectionsworkspace_id(UUID)connection_name(text)encrypted_config(text)
file_assetsid(UUID)storage_path(text)metadata(JSONB)
- User prompt is received by
/api/chat. - Backend loads schema metadata and constructs a prompt.
- Provider returns SQL + metadata.
- SQL can be executed if
auto_executeis enabled.
- User uploads a file to
/api/files/upload. - File is stored in Supabase storage.
- For profiling,
/api/files/profileuses DuckDB to return column-level stats.
- The
/api/lineageendpoint parses SQL and returns:- tables read / written
- columns used
- CTEs
- Intended to power UI lineage graphs and impact analysis.
- RLS (Supabase): Enforce row-level policies per workspace.
- Encryption: All connection configs are encrypted with
FERNET_KEY. - Least privilege: Connections are read-only by default.
- Auditability: (Planned) query logging and change tracking.