# soumashree-das/team-criminallyonline architecture

> Architecture diagram of the GitHub repository soumashree-das/team-criminallyonline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/soumashree-das/team-criminallyonline
- Repository: https://github.com/soumashree-das/team-criminallyonline

## Overview

Capacity Connect is a role-based organizational learning platform. Trainees explore courses, complete diagnostics, plan availability, follow adaptive roadmaps, learn through course materials, submit assignments, and earn certificates; trainers moderate enrollment and learning, while administrators oversee analytics and PII governance. The frontend routes role-specific views, and the FastAPI backend exposes the platform API. Roadmap generation coordinates learner and curriculum state, replanning, explanations, and persistence. README capabilities are represented where source excerpts were not available; those links are not asserted as inspected call paths.

Main entry points: [`frontend/src/App.jsx`](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/App.jsx) (Role-based app), [`backend/main.py`](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/main.py) (REST API), [`frontend/src/components/views`](https://github.com/soumashree-das/team-criminallyonline/tree/main/frontend/src/components/views) (Trainee learning views), [`backend/services/planning_engine.py`](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/planning_engine.py) (Roadmap planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Role-based experience"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_auth["Session and roles<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[apiClient.js]"]
  node_trainee_views["Trainee learning views"]
  node_backend["REST API<br/>[main.py]"]
  node_auth_service["Authentication and access<br/>[auth_service.py]"]
end

subgraph group_learning["Learning and adaptation"]
  node_diagnostic["Diagnostic assessment<br/>[main.py]"]
  node_planning["Roadmap planning<br/>[planning_engine.py]"]
  node_reasoner["Plan-aware reasoning"]
  node_replanner["Dynamic replanning"]
  node_explanation["Grounded explanations"]
  node_knowledge_graph["Knowledge graph analytics<br/>[kg_engine.py]"]
  node_lms["Courses and lessons"]
  node_assignments["Assignments"]
  node_certificates["Certificates"]
end

subgraph group_governance["Educator and governance"]
  node_trainer_views["Trainer workspace"]
  node_admin_view["Admin portal"]
end

subgraph group_data["Data and integrations"]
  node_sqlite[("SQLite records<br/>[database.py]")]
  node_neo4j[("Neo4j graph<br/>[neo4j_service.py]")]
  node_gemini["Gemini service"]
end

node_trainee(("Trainee"))
node_trainer(("Trainer"))
node_admin(("Administrator"))

node_trainee -->|"uses"| node_app
node_trainer -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"provides session"| node_auth
node_app -->|"routes trainee"| node_trainee_views
node_app -->|"routes educator"| node_trainer_views
node_app -->|"routes admin"| node_admin_view
node_auth -->|"sends requests"| node_api
node_trainee_views -->|"requests platform data"| node_api
node_trainer_views -->|"requests platform data"| node_api
node_admin_view -->|"requests platform data"| node_api
node_api -->|"calls REST API"| node_backend
node_backend -->|"checks access"| node_auth_service
node_auth_service -->|"reads users"| node_sqlite
node_backend -->|"handles submissions"| node_diagnostic
node_backend -->|"generates roadmap"| node_planning
node_planning -->|"builds learner analysis"| node_reasoner
node_planning -->|"requests roadmap"| node_replanner
node_planning -->|"requests rationale"| node_explanation
node_planning -->|"stores roadmap"| node_sqlite
node_backend -->|"reads and writes records"| node_sqlite
node_backend -->|"builds graph views"| node_knowledge_graph
node_knowledge_graph -.->|"syncs course concepts"| node_neo4j
node_explanation -.->|"generates text"| node_gemini
node_trainee_views -->|"presents learning"| node_lms
node_trainee_views -->|"presents submissions"| node_assignments
node_trainee_views -->|"presents credentials"| node_certificates
node_trainer_views -->|"shows competency"| node_knowledge_graph
node_admin_view -->|"shows platform health"| node_knowledge_graph

click node_app "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/lib/apiClient.js"
click node_trainee_views "https://github.com/soumashree-das/team-criminallyonline/tree/main/frontend/src/components/views"
click node_trainer_views "https://github.com/soumashree-das/team-criminallyonline/tree/main/frontend/src/components/views/trainer"
click node_admin_view "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/AdminPortalView.jsx"
click node_backend "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/main.py"
click node_auth_service "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/auth_service.py"
click node_diagnostic "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/main.py"
click node_planning "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/planning_engine.py"
click node_reasoner "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/plan_aware_reasoner.py"
click node_replanner "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/dynamic_replanner.py"
click node_explanation "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/rag_explanation_engine.py"
click node_knowledge_graph "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/kg_engine.py"
click node_lms "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/LessonPlayerView.jsx"
click node_assignments "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/AssignmentsView.jsx"
click node_certificates "https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/CertificateView.jsx"
click node_sqlite "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/database.py"
click node_neo4j "https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/neo4j_service.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_auth,node_api,node_trainee_views,node_backend,node_auth_service toneBlue
class node_diagnostic,node_planning,node_reasoner,node_replanner,node_explanation,node_knowledge_graph,node_lms,node_assignments,node_certificates toneAmber
class node_trainer_views,node_admin_view toneMint
class node_sqlite,node_neo4j,node_gemini toneRose
class node_trainee,node_trainer,node_admin toneIndigo
```

## Components

### Role-based experience

- [Role-based app](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Session and roles](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/lib/apiClient.js): `frontend/src/lib/apiClient.js`
- [Trainee learning views](https://github.com/soumashree-das/team-criminallyonline/tree/main/frontend/src/components/views): `frontend/src/components/views`
- [REST API](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/main.py): `backend/main.py`
- [Authentication and access](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`

### Learning and adaptation

- [Diagnostic assessment](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/main.py): `backend/main.py`
- [Roadmap planning](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/planning_engine.py): `backend/services/planning_engine.py`
- [Plan-aware reasoning](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/plan_aware_reasoner.py): `backend/services/plan_aware_reasoner.py`
- [Dynamic replanning](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/dynamic_replanner.py): `backend/services/dynamic_replanner.py`
- [Grounded explanations](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/rag_explanation_engine.py): `backend/services/rag_explanation_engine.py`
- [Knowledge graph analytics](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/kg_engine.py): `backend/services/kg_engine.py`
- [Courses and lessons](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/LessonPlayerView.jsx): `frontend/src/components/views/LessonPlayerView.jsx`
- [Assignments](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/AssignmentsView.jsx): `frontend/src/components/views/AssignmentsView.jsx`
- [Certificates](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/CertificateView.jsx): `frontend/src/components/views/CertificateView.jsx`

### Educator and governance

- [Trainer workspace](https://github.com/soumashree-das/team-criminallyonline/tree/main/frontend/src/components/views/trainer): `frontend/src/components/views/trainer`
- [Admin portal](https://github.com/soumashree-das/team-criminallyonline/blob/main/frontend/src/components/views/AdminPortalView.jsx): `frontend/src/components/views/AdminPortalView.jsx`

### Data and integrations

- [SQLite records](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/database.py): `backend/database.py`
- [Neo4j graph](https://github.com/soumashree-das/team-criminallyonline/blob/main/backend/services/neo4j_service.py): `backend/services/neo4j_service.py`
- **Gemini service**

### Other components

- **Trainee**
- **Trainer**
- **Administrator**

## Connections

- Trainee → Role-based app: uses
- Trainer → Role-based app: uses
- Administrator → Role-based app: uses
- Role-based app → Session and roles: provides session
- Role-based app → Trainee learning views: routes trainee
- Role-based app → Trainer workspace: routes educator
- Role-based app → Admin portal: routes admin
- Session and roles → API client: sends requests
- Trainee learning views → API client: requests platform data
- Trainer workspace → API client: requests platform data
- Admin portal → API client: requests platform data
- API client → REST API: calls REST API
- REST API → Authentication and access: checks access
- Authentication and access → SQLite records: reads users
- REST API → Diagnostic assessment: handles submissions
- REST API → Roadmap planning: generates roadmap
- Roadmap planning → Plan-aware reasoning: builds learner analysis
- Roadmap planning → Dynamic replanning: requests roadmap
- Roadmap planning → Grounded explanations: requests rationale
- Roadmap planning → SQLite records: stores roadmap
- REST API → SQLite records: reads and writes records
- REST API → Knowledge graph analytics: builds graph views
- Knowledge graph analytics → Neo4j graph: syncs course concepts
- Grounded explanations → Gemini service: generates text
- Trainee learning views → Courses and lessons: presents learning
- Trainee learning views → Assignments: presents submissions
- Trainee learning views → Certificates: presents credentials
- Trainer workspace → Knowledge graph analytics: shows competency
- Admin portal → Knowledge graph analytics: shows platform health
