# kush788/classhub architecture

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

- Interactive diagram: https://gitdiagram.com/kush788/classhub
- Repository: https://github.com/kush788/classhub

## Overview

ClassHub is a virtual-classroom platform whose main workflow runs from teacher/student use of the React app, through classroom and learning services, to submissions, grading, and performance tracking. The README documents the service topology and key integrations; sampled source confirms workspace and notification controller-to-service delegation. The source excerpts do not expose most service internals or frontend API calls, so those links are limited to documented relationships.

Main entry points: [`discovery-server/src/main/java/com/classhub/discovery/DiscoveryServerApplication.java`](https://github.com/kush788/classhub/blob/main/discovery-server/src/main/java/com/classhub/discovery/DiscoveryServerApplication.java) (Service discovery), [`submission-service/src/main/java/com/classhub/submission/service/SubmissionService.java`](https://github.com/kush788/classhub/blob/main/submission-service/src/main/java/com/classhub/submission/service/SubmissionService.java) (Submission and grading), [`auth-service/src/main/java/com/classhub/auth/service/AuthService.java`](https://github.com/kush788/classhub/blob/main/auth-service/src/main/java/com/classhub/auth/service/AuthService.java) (Authentication), [`resource-service/src/main/java/com/classhub/resource/service/ResourceService.java`](https://github.com/kush788/classhub/blob/main/resource-service/src/main/java/com/classhub/resource/service/ResourceService.java) (Course resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_frontend["React application<br/>[App.tsx]"]
end

subgraph group_platform["Platform access"]
  node_gateway["API gateway"]
  node_discovery["Service discovery"]
  node_auth["Authentication<br/>[AuthService.java]"]
end

subgraph group_classroom["Classroom learning"]
  node_workspace["Workspaces"]
  node_resources["Course resources"]
  node_assignments["Assignments"]
  node_submissions["Submission and grading"]
  node_playground["Coding playground"]
end

subgraph group_performance["Engagement and performance"]
  node_leaderboard["Leaderboard"]
  node_notifications["Email notifications"]
end

subgraph group_operations["External services"]
  node_postgres[("PostgreSQL")]
  node_cloudinary[("Cloudinary")]
  node_mail["Email / SMTP"]
  node_judge0["Judge0"]
end

node_teacher(("Teacher"))
node_student(("Student"))

node_teacher -->|"uses"| node_frontend
node_student -->|"uses"| node_frontend
node_frontend -->|"sends requests"| node_gateway
node_gateway -->|"resolves services"| node_discovery
node_discovery -->|"registers services"| node_auth
node_discovery -->|"registers services"| node_workspace
node_discovery -->|"registers services"| node_resources
node_discovery -->|"registers services"| node_assignments
node_discovery -->|"registers services"| node_submissions
node_discovery -->|"registers services"| node_leaderboard
node_discovery -->|"registers services"| node_notifications
node_auth -->|"stores accounts"| node_postgres
node_workspace -->|"stores classroom data"| node_postgres
node_resources -->|"stores resource data"| node_postgres
node_resources -->|"stores files"| node_cloudinary
node_assignments -->|"stores assignments"| node_postgres
node_submissions -->|"stores submissions"| node_postgres
node_leaderboard -->|"stores rankings"| node_postgres
node_auth -->|"sends verification email"| node_mail
node_notifications -->|"sends updates"| node_mail
node_submissions -->|"requests graded alerts"| node_notifications
node_submissions -.->|"supplies score updates"| node_leaderboard
node_playground -.->|"runs code"| node_judge0

click node_frontend "https://github.com/kush788/classhub/blob/main/classhub-frontend/src/App.tsx"
click node_gateway "https://github.com/kush788/classhub/blob/main/api-gateway/src/main/java/com/classhub/gateway/ApiGatewayApplication.java"
click node_discovery "https://github.com/kush788/classhub/blob/main/discovery-server/src/main/java/com/classhub/discovery/DiscoveryServerApplication.java"
click node_auth "https://github.com/kush788/classhub/blob/main/auth-service/src/main/java/com/classhub/auth/service/AuthService.java"
click node_workspace "https://github.com/kush788/classhub/blob/main/workspace-service/src/main/java/com/classhub/workspace/controller/WorkspaceController.java"
click node_resources "https://github.com/kush788/classhub/blob/main/resource-service/src/main/java/com/classhub/resource/service/ResourceService.java"
click node_assignments "https://github.com/kush788/classhub/blob/main/assignment-service/src/main/java/com/classhub/assignment/service/AssignmentService.java"
click node_submissions "https://github.com/kush788/classhub/blob/main/submission-service/src/main/java/com/classhub/submission/service/SubmissionService.java"
click node_playground "https://github.com/kush788/classhub/blob/main/playground-service/src/main/java/com/classhub/playground/service/CodeExecutionService.java"
click node_leaderboard "https://github.com/kush788/classhub/blob/main/leaderboard-service/src/main/java/com/classhub/leaderboard/service/LeaderboardService.java"
click node_notifications "https://github.com/kush788/classhub/blob/main/notification-service/src/main/java/com/classhub/notification/controller/NotificationController.java"

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_frontend toneBlue
class node_gateway,node_discovery,node_auth toneAmber
class node_workspace,node_resources,node_assignments,node_submissions,node_playground toneMint
class node_leaderboard,node_notifications toneRose
class node_postgres,node_cloudinary,node_mail,node_judge0,node_teacher,node_student toneIndigo
```

## Components

### User interface

- [React application](https://github.com/kush788/classhub/blob/main/classhub-frontend/src/App.tsx): `classhub-frontend/src/App.tsx`

### Platform access

- [API gateway](https://github.com/kush788/classhub/blob/main/api-gateway/src/main/java/com/classhub/gateway/ApiGatewayApplication.java): `api-gateway/src/main/java/com/classhub/gateway/ApiGatewayApplication.java`
- [Service discovery](https://github.com/kush788/classhub/blob/main/discovery-server/src/main/java/com/classhub/discovery/DiscoveryServerApplication.java): `discovery-server/src/main/java/com/classhub/discovery/DiscoveryServerApplication.java`
- [Authentication](https://github.com/kush788/classhub/blob/main/auth-service/src/main/java/com/classhub/auth/service/AuthService.java): `auth-service/src/main/java/com/classhub/auth/service/AuthService.java`

### Classroom learning

- [Workspaces](https://github.com/kush788/classhub/blob/main/workspace-service/src/main/java/com/classhub/workspace/controller/WorkspaceController.java): `workspace-service/src/main/java/com/classhub/workspace/controller/WorkspaceController.java`
- [Course resources](https://github.com/kush788/classhub/blob/main/resource-service/src/main/java/com/classhub/resource/service/ResourceService.java): `resource-service/src/main/java/com/classhub/resource/service/ResourceService.java`
- [Assignments](https://github.com/kush788/classhub/blob/main/assignment-service/src/main/java/com/classhub/assignment/service/AssignmentService.java): `assignment-service/src/main/java/com/classhub/assignment/service/AssignmentService.java`
- [Submission and grading](https://github.com/kush788/classhub/blob/main/submission-service/src/main/java/com/classhub/submission/service/SubmissionService.java): `submission-service/src/main/java/com/classhub/submission/service/SubmissionService.java`
- [Coding playground](https://github.com/kush788/classhub/blob/main/playground-service/src/main/java/com/classhub/playground/service/CodeExecutionService.java): `playground-service/src/main/java/com/classhub/playground/service/CodeExecutionService.java`

### Engagement and performance

- [Leaderboard](https://github.com/kush788/classhub/blob/main/leaderboard-service/src/main/java/com/classhub/leaderboard/service/LeaderboardService.java): `leaderboard-service/src/main/java/com/classhub/leaderboard/service/LeaderboardService.java`
- [Email notifications](https://github.com/kush788/classhub/blob/main/notification-service/src/main/java/com/classhub/notification/controller/NotificationController.java): `notification-service/src/main/java/com/classhub/notification/controller/NotificationController.java`

### External services

- **PostgreSQL**
- **Cloudinary**
- **Email / SMTP**
- **Judge0**

### Other components

- **Teacher**
- **Student**

## Connections

- Teacher → React application: uses
- Student → React application: uses
- React application → API gateway: sends requests
- API gateway → Service discovery: resolves services
- Service discovery → Authentication: registers services
- Service discovery → Workspaces: registers services
- Service discovery → Course resources: registers services
- Service discovery → Assignments: registers services
- Service discovery → Submission and grading: registers services
- Service discovery → Leaderboard: registers services
- Service discovery → Email notifications: registers services
- Authentication → PostgreSQL: stores accounts
- Workspaces → PostgreSQL: stores classroom data
- Course resources → PostgreSQL: stores resource data
- Course resources → Cloudinary: stores files
- Assignments → PostgreSQL: stores assignments
- Submission and grading → PostgreSQL: stores submissions
- Leaderboard → PostgreSQL: stores rankings
- Authentication → Email / SMTP: sends verification email
- Email notifications → Email / SMTP: sends updates
- Submission and grading → Email notifications: requests graded alerts
- Submission and grading → Leaderboard: supplies score updates
- Coding playground → Judge0: runs code
