# vajjipartisatwikraj/scope-codestats architecture

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

- Interactive diagram: https://gitdiagram.com/vajjipartisatwikraj/scope-codestats
- Repository: https://github.com/vajjipartisatwikraj/scope-codestats

## Overview

SCOPE is a competitive-programming tracker and cohort-based learning platform. Students authenticate, view aggregated platform progress and rankings, join structured cohorts, and practice through coding tests; teachers and admins manage learning content and platform operations. The repository also documents notifications, achievements, opportunities, and analytics. The graph emphasizes those product areas while showing the application, API, and data-model layers. Several feature routes and services are listed in the tree but were not sampled, so their internal connections are omitted or marked unverified.

Main entry points: [`backend/server.js`](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/server.js) (API server), [`frontend/src/App.jsx`](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/App.jsx) (Application routing), [`backend/routes/cohorts.js`](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/cohorts.js) (Cohort workflows), [`backend/routes/auth.js`](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/auth.js) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["Application routing<br/>[App.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authui["Authentication state<br/>[AuthContext.jsx]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_googleauth["Google sign-in<br/>[googleAuth.js]"]
  node_user[("User accounts<br/>[User.js]")]
end

subgraph group_tracking["Progress tracking"]
  node_profileui["Profile views<br/>[UserView.jsx]"]
  node_profileapi["Profile management<br/>[profiles.js]"]
  node_profile[("Coding profiles<br/>[Profile.js]")]
  node_platformapis["Platform aggregation<br/>[platformAPIs.js]"]
  node_dashboard["Performance dashboard<br/>[Dashboard.jsx]"]
  node_leaderboard["Leaderboards<br/>[Leaderboard.jsx]"]
  node_stats["Statistics services<br/>[statsService.js]"]
end

subgraph group_learning["Learning and practice"]
  node_cohortsui["Cohort learning<br/>[CohortDetail.jsx]"]
  node_cohortapi["Cohort workflows<br/>[cohorts.js]"]
  node_cohortusers[("Cohort enrollment<br/>[UserCohort.js]")]
  node_questions[("Learning questions<br/>[Question.js]")]
  node_cascade["Cohort cascades"]
  node_practiceui["Practice arena"]
  node_practiceapi["Practice tests<br/>[practiceArena.js]"]
  node_execution["Code execution"]
end

subgraph group_platform["Platform services"]
  node_adminui["Admin analytics<br/>[index.js]"]
  node_adminapi["Administration<br/>[admin.js]"]
  node_notifications["Notifications<br/>[notifications.js]"]
  node_opportunities["Opportunities<br/>[opportunities.js]"]
  node_server["API server<br/>[server.js]"]
  node_mongodb[("MongoDB")]
  node_judge0["Judge0"]
end

node_students(("Students and staff"))

node_students -->|"use"| node_app
node_app -->|"initializes"| node_authui
node_authui -.->|"requests identity"| node_authroutes
node_authroutes -->|"reads accounts"| node_user
node_googleauth -->|"updates accounts"| node_user
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_practiceui
node_app -->|"routes to"| node_cohortsui
node_profileui -.->|"requests profile"| node_profileapi
node_profileapi -.->|"manages profiles"| node_profile
node_platformapis -->|"aggregates scores"| node_profile
node_dashboard -.->|"requests analytics"| node_stats
node_cohortsui -.->|"requests learning data"| node_cohortapi
node_cohortapi -.->|"manages enrollment"| node_cohortusers
node_cohortapi -.->|"manages questions"| node_questions
node_cascade -->|"deletes questions"| node_questions
node_cascade -->|"cascades enrollment"| node_cohortusers
node_practiceui -.->|"requests tests"| node_practiceapi
node_practiceapi -.->|"runs submissions"| node_execution
node_execution -->|"submits code"| node_judge0
node_adminui -.->|"requests administration"| node_adminapi
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_profileapi
node_server -->|"connects"| node_mongodb
node_server -->|"mounts routes"| node_adminapi
node_server -.->|"mounts routes"| node_notifications
node_server -.->|"mounts routes"| node_opportunities

click node_app "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/App.jsx"
click node_authui "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/contexts/AuthContext.jsx"
click node_authroutes "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/auth.js"
click node_googleauth "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/auth/googleAuth.js"
click node_user "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/User.js"
click node_profileui "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/UserView.jsx"
click node_profileapi "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/profiles.js"
click node_profile "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/Profile.js"
click node_platformapis "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/platformAPIs.js"
click node_dashboard "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/Dashboard.jsx"
click node_leaderboard "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/Leaderboard.jsx"
click node_stats "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/statsService.js"
click node_cohortsui "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/cohort/CohortDetail.jsx"
click node_cohortapi "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/cohorts.js"
click node_cohortusers "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/UserCohort.js"
click node_questions "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/Question.js"
click node_cascade "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/cohortCascadeService.js"
click node_practiceui "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/PracticeArena/PracticeArenaManagement.jsx"
click node_practiceapi "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/practiceArena.js"
click node_execution "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/simpleCodeExecutionService.js"
click node_adminui "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/AdminDashboard/index.js"
click node_adminapi "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/admin.js"
click node_notifications "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/notifications.js"
click node_opportunities "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/opportunities.js"
click node_server "https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/server.js"

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 toneBlue
class node_authui,node_authroutes,node_googleauth,node_user toneAmber
class node_profileui,node_profileapi,node_profile,node_platformapis,node_dashboard,node_leaderboard,node_stats toneMint
class node_cohortsui,node_cohortapi,node_cohortusers,node_questions,node_cascade,node_practiceui,node_practiceapi,node_execution toneRose
class node_adminui,node_adminapi,node_notifications,node_opportunities,node_server,node_mongodb,node_judge0,node_students toneIndigo
```

## Components

### Web experience

- [Application routing](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/App.jsx): `frontend/src/App.jsx`

### Identity and access

- [Authentication state](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [Authentication routes](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/auth.js): `backend/routes/auth.js`
- [Google sign-in](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/auth/googleAuth.js): `backend/routes/auth/googleAuth.js`
- [User accounts](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/User.js): `backend/models/User.js`

### Progress tracking

- [Profile views](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/UserView.jsx): `frontend/src/components/UserView.jsx`
- [Profile management](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/profiles.js): `backend/routes/profiles.js`
- [Coding profiles](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/Profile.js): `backend/models/Profile.js`
- [Platform aggregation](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/platformAPIs.js): `backend/services/platformAPIs.js`
- [Performance dashboard](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Leaderboards](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/Leaderboard.jsx): `frontend/src/components/Leaderboard.jsx`
- [Statistics services](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/statsService.js): `backend/services/statsService.js`

### Learning and practice

- [Cohort learning](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/cohort/CohortDetail.jsx): `frontend/src/components/cohort/CohortDetail.jsx`
- [Cohort workflows](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/cohorts.js): `backend/routes/cohorts.js`
- [Cohort enrollment](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/UserCohort.js): `backend/models/UserCohort.js`
- [Learning questions](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/models/Question.js): `backend/models/Question.js`
- [Cohort cascades](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/cohortCascadeService.js): `backend/services/cohortCascadeService.js`
- [Practice arena](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/PracticeArena/PracticeArenaManagement.jsx): `frontend/src/components/PracticeArena/PracticeArenaManagement.jsx`
- [Practice tests](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/practiceArena.js): `backend/routes/practiceArena.js`
- [Code execution](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/services/simpleCodeExecutionService.js): `backend/services/simpleCodeExecutionService.js`

### Platform services

- [Admin analytics](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/frontend/src/components/AdminDashboard/index.js): `frontend/src/components/AdminDashboard/index.js`
- [Administration](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/admin.js): `backend/routes/admin.js`
- [Notifications](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/notifications.js): `backend/routes/notifications.js`
- [Opportunities](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/routes/opportunities.js): `backend/routes/opportunities.js`
- [API server](https://github.com/vajjipartisatwikraj/scope-codestats/blob/version-2.0.0/backend/server.js): `backend/server.js`
- **MongoDB**
- **Judge0**

### Other components

- **Students and staff**

## Connections

- Students and staff → Application routing: use
- Application routing → Authentication state: initializes (evidence: `frontend/src/App.jsx`)
- Authentication state → Authentication routes: requests identity
- Authentication routes → User accounts: reads accounts (evidence: `backend/routes/auth.js`)
- Google sign-in → User accounts: updates accounts (evidence: `backend/routes/auth/googleAuth.js`)
- Application routing → Performance dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Practice arena: routes to (evidence: `frontend/src/App.jsx`)
- Application routing → Cohort learning: routes to (evidence: `frontend/src/App.jsx`)
- Profile views → Profile management: requests profile
- Profile management → Coding profiles: manages profiles
- Platform aggregation → Coding profiles: aggregates scores (evidence: `backend/models/Profile.js`)
- Performance dashboard → Statistics services: requests analytics
- Cohort learning → Cohort workflows: requests learning data
- Cohort workflows → Cohort enrollment: manages enrollment
- Cohort workflows → Learning questions: manages questions
- Cohort cascades → Learning questions: deletes questions (evidence: `backend/services/cohortCascadeService.js`)
- Cohort cascades → Cohort enrollment: cascades enrollment (evidence: `backend/services/cohortCascadeService.js`)
- Practice arena → Practice tests: requests tests
- Practice tests → Code execution: runs submissions
- Code execution → Judge0: submits code (evidence: `backend/services/simpleCodeExecutionService.js`)
- Admin analytics → Administration: requests administration
- API server → Authentication routes: mounts routes (evidence: `backend/server.js`)
- API server → Profile management: mounts routes (evidence: `backend/server.js`)
- API server → MongoDB: connects (evidence: `backend/server.js`)
- API server → Administration: mounts routes (evidence: `backend/server.js`)
- API server → Notifications: mounts routes (evidence: `backend/server.js`)
- API server → Opportunities: mounts routes (evidence: `backend/server.js`)
