# rahul-jha-2001/annotate_it architecture

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

- Interactive diagram: https://gitdiagram.com/rahul-jha-2001/annotate_it
- Repository: https://github.com/rahul-jha-2001/annotate_it

## Overview

TaskGlass is a web platform for configuring data-annotation experiments, collecting annotations from workers, reviewing agreement, and exporting datasets. The main workflow runs from experiment setup and media upload through annotation and review to asynchronous export. The graph also includes authentication, annotation-type plugins, scoring/allocation services, and bundle ingestion. Relationships are limited to calls or references visible in excerpts and the SOURCE INDEX; unsampled UI-to-backend interactions are not asserted.

Main entry points: [`backend/main.py`](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/main.py) (API routes), [`frontend/src/App.tsx`](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/App.tsx) (App and routes), [`backend/annotation_types/__init__.py`](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/__init__.py) (Annotation registry), [`backend/services/bundle_worker.py`](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/bundle_worker.py) (Bundle ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App and routes<br/>[App.tsx]"]
  node_experiment_ui["Experiment setup"]
  node_dashboard_ui["Experiment dashboard"]
  node_annotator_ui["Annotation interface<br/>[Annotator.tsx]"]
  node_review_ui["Annotation review"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Experiment backend"]
  node_main_api["API routes<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_validation["Experiment validation"]
  node_allocation["Task allocation<br/>[allocation.py]"]
  node_qualification["Annotator qualification<br/>[qualifications.py]"]
  node_scoring["Agreement scoring<br/>[scoring.py]"]
end

subgraph group_annotation["Annotation runtime"]
end

subgraph group_data["Data and exports"]
  node_database["Database sessions<br/>[database.py]"]
  node_models[("Experiment records<br/>[models.py]")]
  node_upload_service["Multipart uploads<br/>[multipartUpload.ts]"]
  node_bundle_worker["Bundle ingestion<br/>[bundle_worker.py]"]
  node_bundle_extractor["Bundle extraction<br/>[guards.py]"]
  node_export_service["Dataset export<br/>[export_service.py]"]
  node_export_worker["Export worker<br/>[export_worker.py]"]
end

subgraph group_types["Annotation types"]
  node_annotation_registry["Annotation registry<br/>[__init__.py]"]
  node_annotation_models["Annotation type base<br/>[base_type.py]"]
  node_spatial_tasks["Spatial task types<br/>[spatial_tasks.py]"]
  node_geometry["Geometry scoring<br/>[geometry.py]"]
end

node_user(("Experiment users"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_experiment_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_annotator_ui
node_app -->|"routes to"| node_review_ui
node_review_ui -->|"fetches review"| node_api_client
node_review_ui -->|"resolves plugins"| node_annotation_registry
node_api_client -.->|"HTTP requests"| node_main_api
node_main_api -->|"uses authentication"| node_auth
node_main_api -->|"validates experiments"| node_validation
node_main_api -->|"allocates tasks"| node_allocation
node_main_api -->|"checks qualification"| node_qualification
node_main_api -->|"computes scores"| node_scoring
node_main_api -->|"lists annotation types"| node_annotation_registry
node_main_api -->|"opens sessions"| node_database
node_main_api -->|"queries records"| node_models
node_annotation_registry -->|"registers types"| node_annotation_models
node_annotation_registry -->|"registers spatial tasks"| node_spatial_tasks
node_spatial_tasks -->|"scores shapes"| node_geometry
node_upload_service -->|"uses API"| node_api_client
node_bundle_worker -->|"uses sessions"| node_database
node_bundle_worker -->|"queries records"| node_models
node_bundle_worker -->|"uses guards"| node_bundle_extractor
node_export_worker -->|"builds exports"| node_export_service
node_export_worker -->|"uses sessions"| node_database
node_export_service -->|"reads records"| node_models

click node_app "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/App.tsx"
click node_experiment_ui "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/CreateExperiment.tsx"
click node_dashboard_ui "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/ExperimentDashboard.tsx"
click node_annotator_ui "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/Annotator.tsx"
click node_review_ui "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/ReviewAnnotations.tsx"
click node_api_client "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/api.ts"
click node_main_api "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/main.py"
click node_auth "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/auth.py"
click node_validation "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/experiment_validation.py"
click node_allocation "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/allocation.py"
click node_qualification "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/qualifications.py"
click node_scoring "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/scoring.py"
click node_annotation_registry "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/__init__.py"
click node_annotation_models "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/base_type.py"
click node_spatial_tasks "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/spatial_tasks.py"
click node_geometry "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/scoring/geometry.py"
click node_database "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/database.py"
click node_models "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/models.py"
click node_upload_service "https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/services/multipartUpload.ts"
click node_bundle_worker "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/bundle_worker.py"
click node_bundle_extractor "https://github.com/rahul-jha-2001/annotate_it/blob/main/lambda/bundle_extractor/guards.py"
click node_export_service "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/export_service.py"
click node_export_worker "https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/export_worker.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_experiment_ui,node_dashboard_ui,node_annotator_ui,node_review_ui,node_api_client,node_user toneBlue
class node_main_api,node_auth,node_validation,node_allocation,node_qualification,node_scoring toneAmber
class node_database,node_models,node_upload_service,node_bundle_worker,node_bundle_extractor,node_export_service,node_export_worker toneRose
class node_annotation_registry,node_annotation_models,node_spatial_tasks,node_geometry toneIndigo
```

## Components

### Web client

- [App and routes](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Experiment setup](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/CreateExperiment.tsx): `frontend/src/components/CreateExperiment.tsx`
- [Experiment dashboard](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/ExperimentDashboard.tsx): `frontend/src/components/ExperimentDashboard.tsx`
- [Annotation interface](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/Annotator.tsx): `frontend/src/components/Annotator.tsx`
- [Annotation review](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/components/ReviewAnnotations.tsx): `frontend/src/components/ReviewAnnotations.tsx`
- [API client](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### Experiment backend

- [API routes](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/auth.py): `backend/auth.py`
- [Experiment validation](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/experiment_validation.py): `backend/services/experiment_validation.py`
- [Task allocation](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/allocation.py): `backend/services/allocation.py`
- [Annotator qualification](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/qualifications.py): `backend/services/qualifications.py`
- [Agreement scoring](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/scoring.py): `backend/services/scoring.py`

### Data and exports

- [Database sessions](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/database.py): `backend/database.py`
- [Experiment records](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/models.py): `backend/models.py`
- [Multipart uploads](https://github.com/rahul-jha-2001/annotate_it/blob/main/frontend/src/services/multipartUpload.ts): `frontend/src/services/multipartUpload.ts`
- [Bundle ingestion](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/bundle_worker.py): `backend/services/bundle_worker.py`
- [Bundle extraction](https://github.com/rahul-jha-2001/annotate_it/blob/main/lambda/bundle_extractor/guards.py): `lambda/bundle_extractor/guards.py`
- [Dataset export](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/services/export_service.py): `backend/services/export_service.py`
- [Export worker](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/export_worker.py): `backend/export_worker.py`

### Annotation types

- [Annotation registry](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/__init__.py): `backend/annotation_types/__init__.py`
- [Annotation type base](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/base_type.py): `backend/annotation_types/base_type.py`
- [Spatial task types](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/spatial_tasks.py): `backend/annotation_types/spatial_tasks.py`
- [Geometry scoring](https://github.com/rahul-jha-2001/annotate_it/blob/main/backend/annotation_types/scoring/geometry.py): `backend/annotation_types/scoring/geometry.py`

### Other components

- **Experiment users**

## Connections

- Experiment users → App and routes: uses (evidence: `frontend/src/App.tsx`)
- App and routes → Experiment setup: routes to (evidence: `frontend/src/App.tsx`)
- App and routes → Experiment dashboard: routes to (evidence: `frontend/src/App.tsx`)
- App and routes → Annotation interface: routes to (evidence: `frontend/src/App.tsx`)
- App and routes → Annotation review: routes to (evidence: `frontend/src/App.tsx`)
- Annotation review → API client: fetches review (evidence: `frontend/src/components/ReviewAnnotations.tsx`)
- Annotation review → Annotation registry: resolves plugins (evidence: `frontend/src/components/ReviewAnnotations.tsx`)
- API client → API routes: HTTP requests
- API routes → Authentication: uses authentication (evidence: `backend/main.py`)
- API routes → Experiment validation: validates experiments (evidence: `backend/main.py`)
- API routes → Task allocation: allocates tasks (evidence: `backend/main.py`)
- API routes → Annotator qualification: checks qualification (evidence: `backend/main.py`)
- API routes → Agreement scoring: computes scores (evidence: `backend/main.py`)
- API routes → Annotation registry: lists annotation types (evidence: `backend/main.py`)
- API routes → Database sessions: opens sessions (evidence: `backend/main.py`)
- API routes → Experiment records: queries records (evidence: `backend/main.py`)
- Annotation registry → Annotation type base: registers types (evidence: `backend/annotation_types/__init__.py`)
- Annotation registry → Spatial task types: registers spatial tasks (evidence: `backend/annotation_types/__init__.py`)
- Spatial task types → Geometry scoring: scores shapes (evidence: `backend/annotation_types/spatial_tasks.py`)
- Multipart uploads → API client: uses API (evidence: `frontend/src/services/multipartUpload.ts`)
- Bundle ingestion → Database sessions: uses sessions (evidence: `backend/services/bundle_worker.py`)
- Bundle ingestion → Experiment records: queries records (evidence: `backend/services/bundle_worker.py`)
- Bundle ingestion → Bundle extraction: uses guards (evidence: `backend/services/bundle_worker.py`)
- Export worker → Dataset export: builds exports (evidence: `backend/export_worker.py`)
- Export worker → Database sessions: uses sessions (evidence: `backend/export_worker.py`)
- Dataset export → Experiment records: reads records (evidence: `backend/services/export_service.py`)
