# raghav-code-repo/primus architecture

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

- Interactive diagram: https://gitdiagram.com/raghav-code-repo/primus
- Repository: https://github.com/raghav-code-repo/primus

## Overview

Primus is a multi-service learning platform: identity and course enrollment support learners, while curriculum, lesson content, and live classrooms provide learning experiences. A typical enrollment request travels from the identity UI through the Student Service, which checks the Course Service and persists enrollment. Other major branches include catalog management, content storage, and live-class recording/realtime interaction. The README contains no capability detail; several subsystem links are therefore omitted or marked unverified where source excerpts do not establish the connection.

Main entry points: [`student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java`](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java) (Enrollment workflow), [`live-class-service/src/main/java/com/olympiad/liveclass/controller`](https://github.com/raghav-code-repo/primus/tree/main/live-class-service/src/main/java/com/olympiad/liveclass/controller) (Live-class APIs), [`identity-service/src/main/java/com/olympiad/identity/service/AuthService.java`](https://github.com/raghav-code-repo/primus/blob/main/identity-service/src/main/java/com/olympiad/identity/service/AuthService.java) (Authentication), [`student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java`](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java) (Enrollment API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_identity_api["Identity API"]
  node_auth_service["Authentication<br/>[AuthService.java]"]
  node_rbac["Authority resolution"]
  node_identity_data[("Identity records")]
end

subgraph group_learning["Catalog and enrollment"]
  node_course_api["Course API"]
  node_course_service["Course management<br/>[CourseService.java]"]
  node_course_data[("Course records")]
  node_curriculum_api["Curriculum APIs"]
  node_curriculum_services["Curriculum services"]
  node_academic_catalog["Academic catalog"]
  node_student_api["Enrollment API"]
  node_enrollment_service["Enrollment workflow"]
  node_enrollment_data[("Enrollment records")]
  node_course_client["Course lookup client"]
end

subgraph group_content["Learning content"]
  node_lesson_service["Lesson management<br/>[LessonService.java]"]
  node_lesson_data[("Lesson records")]
  node_resource_api["Resource API"]
  node_resource_service["Resource management"]
  node_object_storage["Object storage"]
end

subgraph group_classroom["Live classroom"]
  node_live_api["Live-class APIs"]
  node_live_service["Live-class lifecycle"]
  node_recording_service["Recording lifecycle"]
  node_classroom_node["Realtime classroom<br/>[server.ts]"]
end

subgraph group_experience["Learner interface"]
  node_enrollment_ui["Enrollment hook"]
end

node_learner(("Learner or staff"))
node_livekit["LiveKit"]

node_learner -.->|"uses"| node_enrollment_ui
node_enrollment_ui -.->|"requests enrollment"| node_student_api
node_student_api -->|"delegates"| node_enrollment_service
node_enrollment_service -->|"checks course"| node_course_client
node_enrollment_service -->|"reads and saves"| node_enrollment_data
node_course_service -->|"queries and saves"| node_course_data
node_auth_service -->|"manages accounts"| node_identity_data
node_rbac -->|"loads authorities"| node_identity_data
node_identity_api -.->|"handles authentication"| node_auth_service
node_curriculum_api -.->|"delegates"| node_curriculum_services
node_lesson_service -->|"reads and writes"| node_lesson_data
node_resource_api -.->|"delegates"| node_resource_service
node_resource_service -.->|"stores resources"| node_object_storage
node_live_api -.->|"delegates"| node_live_service
node_live_api -.->|"manages recordings"| node_recording_service
node_recording_service -->|"requests recording operations"| node_classroom_node
node_classroom_node -->|"controls rooms and egress"| node_livekit

click node_identity_api "https://github.com/raghav-code-repo/primus/tree/main/identity-service/src/main/java/com/olympiad/identity/controller"
click node_auth_service "https://github.com/raghav-code-repo/primus/blob/main/identity-service/src/main/java/com/olympiad/identity/service/AuthService.java"
click node_rbac "https://github.com/raghav-code-repo/primus/blob/main/identity-service/src/main/java/com/olympiad/identity/service/RbacAuthorityService.java"
click node_identity_data "https://github.com/raghav-code-repo/primus/tree/main/identity-service/src/main/java/com/olympiad/identity/entity"
click node_course_api "https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/controller/CourseController.java"
click node_course_service "https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/service/CourseService.java"
click node_course_data "https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/repository/CourseRepository.java"
click node_curriculum_api "https://github.com/raghav-code-repo/primus/tree/main/curriculum-catalog-service/src/main/java/com/primus/catalog/controller"
click node_curriculum_services "https://github.com/raghav-code-repo/primus/tree/main/curriculum-catalog-service/src/main/java/com/primus/catalog/service"
click node_academic_catalog "https://github.com/raghav-code-repo/primus/tree/main/academic-catalog-service/src/main/java/com/primus/catalog/service"
click node_enrollment_ui "https://github.com/raghav-code-repo/primus/blob/main/olympiad-identity-ui/src/hooks/useMyEnrollments.ts"
click node_student_api "https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java"
click node_enrollment_service "https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java"
click node_enrollment_data "https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/repository/EnrollmentRepository.java"
click node_course_client "https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/client/CourseServiceClient.java"
click node_lesson_service "https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/LessonService.java"
click node_lesson_data "https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/repository/LessonRepository.java"
click node_resource_api "https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/controller/ContentResourceController.java"
click node_resource_service "https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/ContentResourceService.java"
click node_object_storage "https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/ObjectStorageService.java"
click node_live_api "https://github.com/raghav-code-repo/primus/tree/main/live-class-service/src/main/java/com/olympiad/liveclass/controller"
click node_live_service "https://github.com/raghav-code-repo/primus/blob/main/live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassService.java"
click node_recording_service "https://github.com/raghav-code-repo/primus/blob/main/live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassRecordingService.java"
click node_classroom_node "https://github.com/raghav-code-repo/primus/blob/main/olympiad-live-classroom-node/src/server.ts"

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_identity_api,node_auth_service,node_rbac,node_identity_data toneBlue
class node_course_api,node_course_service,node_course_data,node_curriculum_api,node_curriculum_services,node_academic_catalog,node_student_api,node_enrollment_service,node_enrollment_data,node_course_client toneAmber
class node_lesson_service,node_lesson_data,node_resource_api,node_resource_service,node_object_storage toneMint
class node_live_api,node_live_service,node_recording_service,node_classroom_node toneRose
class node_enrollment_ui,node_learner,node_livekit toneIndigo
```

## Components

### Identity and access

- [Identity API](https://github.com/raghav-code-repo/primus/tree/main/identity-service/src/main/java/com/olympiad/identity/controller): `identity-service/src/main/java/com/olympiad/identity/controller`
- [Authentication](https://github.com/raghav-code-repo/primus/blob/main/identity-service/src/main/java/com/olympiad/identity/service/AuthService.java): `identity-service/src/main/java/com/olympiad/identity/service/AuthService.java`
- [Authority resolution](https://github.com/raghav-code-repo/primus/blob/main/identity-service/src/main/java/com/olympiad/identity/service/RbacAuthorityService.java): `identity-service/src/main/java/com/olympiad/identity/service/RbacAuthorityService.java`
- [Identity records](https://github.com/raghav-code-repo/primus/tree/main/identity-service/src/main/java/com/olympiad/identity/entity): `identity-service/src/main/java/com/olympiad/identity/entity`

### Catalog and enrollment

- [Course API](https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/controller/CourseController.java): `course-service/src/main/java/com/olympiad/course/controller/CourseController.java`
- [Course management](https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/service/CourseService.java): `course-service/src/main/java/com/olympiad/course/service/CourseService.java`
- [Course records](https://github.com/raghav-code-repo/primus/blob/main/course-service/src/main/java/com/olympiad/course/repository/CourseRepository.java): `course-service/src/main/java/com/olympiad/course/repository/CourseRepository.java`
- [Curriculum APIs](https://github.com/raghav-code-repo/primus/tree/main/curriculum-catalog-service/src/main/java/com/primus/catalog/controller): `curriculum-catalog-service/src/main/java/com/primus/catalog/controller`
- [Curriculum services](https://github.com/raghav-code-repo/primus/tree/main/curriculum-catalog-service/src/main/java/com/primus/catalog/service): `curriculum-catalog-service/src/main/java/com/primus/catalog/service`
- [Academic catalog](https://github.com/raghav-code-repo/primus/tree/main/academic-catalog-service/src/main/java/com/primus/catalog/service): `academic-catalog-service/src/main/java/com/primus/catalog/service`
- [Enrollment API](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java): `student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java`
- [Enrollment workflow](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java): `student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java`
- [Enrollment records](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/repository/EnrollmentRepository.java): `student-service/src/main/java/com/olympiad/student/repository/EnrollmentRepository.java`
- [Course lookup client](https://github.com/raghav-code-repo/primus/blob/main/student-service/src/main/java/com/olympiad/student/client/CourseServiceClient.java): `student-service/src/main/java/com/olympiad/student/client/CourseServiceClient.java`

### Learning content

- [Lesson management](https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/LessonService.java): `content-service/src/main/java/com/olympiad/content/service/LessonService.java`
- [Lesson records](https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/repository/LessonRepository.java): `content-service/src/main/java/com/olympiad/content/repository/LessonRepository.java`
- [Resource API](https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/controller/ContentResourceController.java): `content-service/src/main/java/com/olympiad/content/controller/ContentResourceController.java`
- [Resource management](https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/ContentResourceService.java): `content-service/src/main/java/com/olympiad/content/service/ContentResourceService.java`
- [Object storage](https://github.com/raghav-code-repo/primus/blob/main/content-service/src/main/java/com/olympiad/content/service/ObjectStorageService.java): `content-service/src/main/java/com/olympiad/content/service/ObjectStorageService.java`

### Live classroom

- [Live-class APIs](https://github.com/raghav-code-repo/primus/tree/main/live-class-service/src/main/java/com/olympiad/liveclass/controller): `live-class-service/src/main/java/com/olympiad/liveclass/controller`
- [Live-class lifecycle](https://github.com/raghav-code-repo/primus/blob/main/live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassService.java): `live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassService.java`
- [Recording lifecycle](https://github.com/raghav-code-repo/primus/blob/main/live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassRecordingService.java): `live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassRecordingService.java`
- [Realtime classroom](https://github.com/raghav-code-repo/primus/blob/main/olympiad-live-classroom-node/src/server.ts): `olympiad-live-classroom-node/src/server.ts`

### Learner interface

- [Enrollment hook](https://github.com/raghav-code-repo/primus/blob/main/olympiad-identity-ui/src/hooks/useMyEnrollments.ts): `olympiad-identity-ui/src/hooks/useMyEnrollments.ts`

### Other components

- **Learner or staff**
- **LiveKit**

## Connections

- Learner or staff → Enrollment hook: uses
- Enrollment hook → Enrollment API: requests enrollment
- Enrollment API → Enrollment workflow: delegates (evidence: `student-service/src/main/java/com/olympiad/student/controller/EnrollmentController.java`)
- Enrollment workflow → Course lookup client: checks course (evidence: `student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java`)
- Enrollment workflow → Enrollment records: reads and saves (evidence: `student-service/src/main/java/com/olympiad/student/service/EnrollmentService.java`)
- Course management → Course records: queries and saves (evidence: `course-service/src/main/java/com/olympiad/course/service/CourseService.java`)
- Authentication → Identity records: manages accounts (evidence: `identity-service/src/main/java/com/olympiad/identity/service/AuthService.java`)
- Authority resolution → Identity records: loads authorities (evidence: `identity-service/src/main/java/com/olympiad/identity/service/RbacAuthorityService.java`)
- Identity API → Authentication: handles authentication
- Curriculum APIs → Curriculum services: delegates
- Lesson management → Lesson records: reads and writes (evidence: `content-service/src/main/java/com/olympiad/content/service/LessonService.java`)
- Resource API → Resource management: delegates
- Resource management → Object storage: stores resources
- Live-class APIs → Live-class lifecycle: delegates
- Live-class APIs → Recording lifecycle: manages recordings
- Recording lifecycle → Realtime classroom: requests recording operations (evidence: `live-class-service/src/main/java/com/olympiad/liveclass/service/LiveClassRecordingService.java`)
- Realtime classroom → LiveKit: controls rooms and egress (evidence: `olympiad-live-classroom-node/src/server.ts`)
