# shivatarunkumar/datadesk architecture

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

- Interactive diagram: https://gitdiagram.com/shivatarunkumar/datadesk
- Repository: https://github.com/shivatarunkumar/datadesk

## Overview

DataDesk is a governed data workspace: users manage and version personal files, validate submissions against onboarded table schemas and contracts, then receive admin approval before loading to PostgreSQL or BigQuery. Data Studio offers a second route for querying onboarded tables and submitting small edits through the same checks and approvals. The map combines README-documented capabilities with relationships shown in excerpts and the SOURCE INDEX; unsampled implementations are represented at their supported paths, and uncertain connections are omitted.

Main entry points: [`backend/app/services/reviews.py`](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/reviews.py) (Admin approvals), [`backend/app/api/v1/router.py`](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/router.py) (API routes), [`frontend/App.tsx`](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/App.tsx) (Mobile app shell), [`backend/app/api/v1/admin.py`](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/admin.py) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_app["Mobile app shell<br/>[App.tsx]"]
  node_workspace_ui["Workspace screens"]
  node_admin_ui["Admin screens<br/>[AdminScreen.tsx]"]
  node_auth_context["Session context<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["API and identity"]
  node_api_entry["FastAPI entry<br/>[main.py]"]
  node_api_routes["API routes<br/>[router.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_workspace_routes["Workspace routes<br/>[workspace.py]"]
  node_studio_routes["Studio routes<br/>[studio.py]"]
  node_admin_routes["Admin routes<br/>[admin.py]"]
  node_auth_service["Authentication service<br/>[auth.py]"]
  node_users[("User records<br/>[user.py]")]
end

subgraph group_workspace["Files and submissions"]
  node_workspace_service["File workspace<br/>[workspace.py]"]
  node_file_parser["File parsing<br/>[file_parser.py]"]
  node_storage["Versioned file storage<br/>[storage.py]"]
  node_requests_service["Load requests<br/>[requests.py]"]
end

subgraph group_governance["Governance and review"]
  node_onboarding_service["Target onboarding<br/>[onboarding.py]"]
  node_validators["Schema and contract checks<br/>[validators.py]"]
  node_reviews["Admin approvals<br/>[reviews.py]"]
  node_targets_model[("Target definitions<br/>[targets.py]")]
  node_studio_changes["Studio change checks<br/>[studio_changes.py]"]
end

subgraph group_targets["Target data systems"]
  node_postgres[("PostgreSQL targets<br/>[target_postgres.py]")]
  node_bigquery[("BigQuery targets<br/>[bigquery.py]")]
  node_gcs[("Google Cloud Storage")]
  node_bq_service["BigQuery identity<br/>[gcp.py]"]
end

node_user(("Workspace user"))
node_admin(("Administrator"))

node_user -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"provides session"| node_auth_context
node_app -->|"routes to"| node_workspace_ui
node_app -->|"routes to"| node_admin_ui
node_workspace_ui -->|"calls"| node_api_client
node_admin_ui -->|"calls"| node_api_client
node_api_client -->|"HTTP requests"| node_api_entry
node_api_entry -->|"mounts"| node_api_routes
node_api_routes -->|"registers"| node_auth_routes
node_api_routes -->|"registers"| node_workspace_routes
node_api_routes -->|"registers"| node_studio_routes
node_api_routes -->|"registers"| node_admin_routes
node_auth_routes -->|"calls"| node_auth_service
node_auth_routes -->|"reads and writes"| node_users
node_admin_routes -->|"calls"| node_reviews
node_admin_routes -->|"reads and writes"| node_users
node_workspace_routes -.->|"calls"| node_workspace_service
node_workspace_service -.->|"parses files"| node_file_parser
node_workspace_service -.->|"stores versions"| node_storage
node_storage -->|"reads and writes"| node_gcs
node_workspace_routes -.->|"submits loads"| node_requests_service
node_studio_routes -.->|"handles edits"| node_studio_changes
node_studio_changes -.->|"validates changes"| node_validators
node_admin_routes -->|"onboards targets"| node_onboarding_service
node_onboarding_service -.->|"records contracts"| node_targets_model
node_reviews -->|"revalidates loads"| node_validators
node_reviews -->|"parses submitted file"| node_file_parser
node_reviews -->|"checks current contract"| node_targets_model
node_reviews -->|"reads file version"| node_storage
node_reviews -.->|"loads approved data"| node_postgres
node_reviews -.->|"loads approved data"| node_bigquery
node_onboarding_service -.->|"tests and lists tables"| node_postgres
node_onboarding_service -.->|"tests and lists tables"| node_bigquery
node_bigquery -->|"gets identity"| node_bq_service

click node_app "https://github.com/shivatarunkumar/datadesk/blob/master/frontend/App.tsx"
click node_workspace_ui "https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/screens/DataWorkspaceScreen.tsx"
click node_admin_ui "https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/screens/AdminScreen.tsx"
click node_auth_context "https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/context/AuthContext.tsx"
click node_api_client "https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/services/api.ts"
click node_api_entry "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/main.py"
click node_api_routes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/router.py"
click node_auth_routes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/auth.py"
click node_workspace_routes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/workspace.py"
click node_studio_routes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/studio.py"
click node_admin_routes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/admin.py"
click node_auth_service "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/auth.py"
click node_users "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/models/user.py"
click node_workspace_service "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/workspace.py"
click node_file_parser "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/file_parser.py"
click node_storage "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/storage.py"
click node_requests_service "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/requests.py"
click node_onboarding_service "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/onboarding.py"
click node_validators "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/validators.py"
click node_reviews "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/reviews.py"
click node_targets_model "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/models/targets.py"
click node_studio_changes "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/studio_changes.py"
click node_postgres "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/target_postgres.py"
click node_bigquery "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/bigquery.py"
click node_bq_service "https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/gcp.py"

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_workspace_ui,node_admin_ui,node_auth_context,node_api_client,node_user toneBlue
class node_api_entry,node_api_routes,node_auth_routes,node_workspace_routes,node_studio_routes,node_admin_routes,node_auth_service,node_users toneAmber
class node_workspace_service,node_file_parser,node_storage,node_requests_service toneMint
class node_onboarding_service,node_validators,node_reviews,node_targets_model,node_studio_changes toneRose
class node_postgres,node_bigquery,node_gcs,node_bq_service,node_admin toneIndigo
```

## Components

### User interface

- [Mobile app shell](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/App.tsx): `frontend/App.tsx`
- [Workspace screens](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/screens/DataWorkspaceScreen.tsx): `frontend/src/screens/DataWorkspaceScreen.tsx`
- [Admin screens](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/screens/AdminScreen.tsx): `frontend/src/screens/AdminScreen.tsx`
- [Session context](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [API client](https://github.com/shivatarunkumar/datadesk/blob/master/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and identity

- [FastAPI entry](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Authentication routes](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Workspace routes](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/workspace.py): `backend/app/api/v1/workspace.py`
- [Studio routes](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/studio.py): `backend/app/api/v1/studio.py`
- [Admin routes](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/api/v1/admin.py): `backend/app/api/v1/admin.py`
- [Authentication service](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/auth.py): `backend/app/services/auth.py`
- [User records](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/models/user.py): `backend/app/models/user.py`

### Files and submissions

- [File workspace](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/workspace.py): `backend/app/services/workspace.py`
- [File parsing](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/file_parser.py): `backend/app/services/file_parser.py`
- [Versioned file storage](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/storage.py): `backend/app/adapters/storage.py`
- [Load requests](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/requests.py): `backend/app/services/requests.py`

### Governance and review

- [Target onboarding](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/onboarding.py): `backend/app/services/onboarding.py`
- [Schema and contract checks](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/validators.py): `backend/app/services/validators.py`
- [Admin approvals](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/reviews.py): `backend/app/services/reviews.py`
- [Target definitions](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/models/targets.py): `backend/app/models/targets.py`
- [Studio change checks](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/services/studio_changes.py): `backend/app/services/studio_changes.py`

### Target data systems

- [PostgreSQL targets](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/target_postgres.py): `backend/app/adapters/target_postgres.py`
- [BigQuery targets](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/bigquery.py): `backend/app/adapters/bigquery.py`
- **Google Cloud Storage**
- [BigQuery identity](https://github.com/shivatarunkumar/datadesk/blob/master/backend/app/adapters/gcp.py): `backend/app/adapters/gcp.py`

### Other components

- **Workspace user**
- **Administrator**

## Connections

- Workspace user → Mobile app shell: uses (evidence: `README.md`)
- Administrator → Mobile app shell: uses (evidence: `README.md`)
- Mobile app shell → Session context: provides session (evidence: `frontend/App.tsx`)
- Mobile app shell → Workspace screens: routes to (evidence: `frontend/App.tsx`)
- Mobile app shell → Admin screens: routes to (evidence: `frontend/App.tsx`)
- Workspace screens → API client: calls (evidence: `frontend/src/screens/DataWorkspaceScreen.tsx`)
- Admin screens → API client: calls (evidence: `frontend/src/screens/AdminScreen.tsx`)
- API client → FastAPI entry: HTTP requests (evidence: `frontend/src/services/api.ts`)
- FastAPI entry → API routes: mounts (evidence: `backend/app/main.py`)
- API routes → Authentication routes: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Workspace routes: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Studio routes: registers (evidence: `backend/app/api/v1/router.py`)
- API routes → Admin routes: registers (evidence: `backend/app/api/v1/router.py`)
- Authentication routes → Authentication service: calls (evidence: `backend/app/api/v1/auth.py`)
- Authentication routes → User records: reads and writes (evidence: `backend/app/api/v1/auth.py`)
- Admin routes → Admin approvals: calls (evidence: `backend/app/api/v1/admin.py`)
- Admin routes → User records: reads and writes (evidence: `backend/app/api/v1/admin.py`)
- Workspace routes → File workspace: calls
- File workspace → File parsing: parses files
- File workspace → Versioned file storage: stores versions
- Versioned file storage → Google Cloud Storage: reads and writes (evidence: `backend/app/adapters/storage.py`)
- Workspace routes → Load requests: submits loads
- Studio routes → Studio change checks: handles edits
- Studio change checks → Schema and contract checks: validates changes
- Admin routes → Target onboarding: onboards targets (evidence: `backend/app/api/v1/admin.py`)
- Target onboarding → Target definitions: records contracts
- Admin approvals → Schema and contract checks: revalidates loads (evidence: `backend/app/services/reviews.py`)
- Admin approvals → File parsing: parses submitted file (evidence: `backend/app/services/reviews.py`)
- Admin approvals → Target definitions: checks current contract (evidence: `backend/app/services/reviews.py`)
- Admin approvals → Versioned file storage: reads file version (evidence: `backend/app/services/reviews.py`)
- Admin approvals → PostgreSQL targets: loads approved data
- Admin approvals → BigQuery targets: loads approved data
- Target onboarding → PostgreSQL targets: tests and lists tables
- Target onboarding → BigQuery targets: tests and lists tables
- BigQuery targets → BigQuery identity: gets identity (evidence: `backend/app/adapters/bigquery.py`)
