# belachojomia-beep/rlearn-hub architecture

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

- Interactive diagram: https://gitdiagram.com/belachojomia-beep/rlearn-hub
- Repository: https://github.com/belachojomia-beep/rlearn-hub

## Overview

RLearnHub is a learning-resource portal with student, teacher, and administrator views for browsing and uploading materials, announcements, notifications, and dashboard activity. The tree shows both a frontend and a gateway, a consolidated Backend application, and separate auth, resource, dashboard, and notification services; the excerpts do not establish how these backends are wired together at runtime. The graph therefore shows documented component calls within sampled controllers and frontend routing, while leaving cross-service deployment relationships out.

Main entry points: [`frontend/src/App.jsx`](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/App.jsx) (App routing and login), [`Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java`](https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java) (Dashboard statistics), [`services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java`](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java) (Authentication endpoints), [`services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java`](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java) (Resource and downloads)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App routing and login<br/>[App.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_dashboard_ui["Dashboard view<br/>[Dashboard.jsx]"]
  node_resources_ui["Resource browsing<br/>[Resources.jsx]"]
  node_resource_detail_ui["Resource details"]
  node_upload_ui["Resource upload<br/>[UploadResource.jsx]"]
  node_courses_ui["Course browsing<br/>[Courses.jsx]"]
  node_announcements_ui["Announcements view<br/>[Announcements.jsx]"]
  node_create_announcement_ui["Announcement creation"]
end

subgraph group_access["Identity and access"]
  node_gateway_filter["JWT request filter"]
  node_gateway_jwt["Gateway JWT service<br/>[JwtService.java]"]
  node_auth_controller["Authentication endpoints"]
  node_auth_jwt["Auth JWT service<br/>[JwtService.java]"]
  node_auth_users[("Auth user repository")]
end

subgraph group_learning["Learning resources"]
  node_resource_controller["Resource and downloads"]
  node_resource_service["Resource operations"]
  node_resource_store[("Resource repository")]
  node_resource_records["Resource and download models<br/>[Resource.java]"]
  node_subject_controller["Subject endpoints"]
  node_backend_resources["Backend resource records<br/>[Resource.java]"]
  node_backend_downloads[("Download repository")]
  node_backend_subjects[("Subject repository")]
end

subgraph group_engagement["Engagement and insights"]
  node_notification_controller["Notification endpoints"]
  node_notification_store["Notification records<br/>[Notification.java]"]
  node_announcement_controller["Announcement endpoints"]
  node_announcement_store["Announcement records<br/>[Announcement.java]"]
  node_dashboard_controller["Dashboard statistics"]
end

node_learner(("Portal user"))

node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_admin_ui
node_app -->|"routes to"| node_resources_ui
node_app -->|"routes to"| node_upload_ui
node_app -->|"routes to"| node_announcements_ui
node_resources_ui -->|"uses"| node_resource_detail_ui
node_auth_controller -->|"queries"| node_auth_users
node_auth_controller -->|"generates token"| node_auth_jwt
node_resource_controller -->|"reads and writes"| node_resource_store
node_resource_controller -->|"creates records"| node_resource_records
node_resource_service -->|"reads and writes"| node_resource_store
node_notification_controller -->|"reads and writes"| node_notification_store
node_announcement_controller -->|"reads and writes"| node_announcement_store
node_dashboard_controller -->|"counts and lists"| node_backend_resources
node_dashboard_controller -->|"counts downloads"| node_backend_downloads
node_dashboard_controller -->|"counts subjects"| node_backend_subjects

click node_app "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/App.jsx"
click node_admin_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_dashboard_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Dashboard.jsx"
click node_resources_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Resources.jsx"
click node_resource_detail_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/ResourceDetails.jsx"
click node_upload_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/UploadResource.jsx"
click node_courses_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Courses.jsx"
click node_announcements_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Announcements.jsx"
click node_create_announcement_ui "https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/CreateAnnouncement.jsx"
click node_gateway_filter "https://github.com/belachojomia-beep/rlearn-hub/blob/main/gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtAuthenticationFilter.java"
click node_gateway_jwt "https://github.com/belachojomia-beep/rlearn-hub/blob/main/gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtService.java"
click node_auth_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java"
click node_auth_jwt "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/JwtService.java"
click node_auth_users "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/repository/UserRepository.java"
click node_resource_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java"
click node_resource_service "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/service/ResourceService.java"
click node_resource_store "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/repository/ResourceRepository.java"
click node_resource_records "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/entity/Resource.java"
click node_subject_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/controller/SubjectController.java"
click node_notification_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/controller/NotificationController.java"
click node_notification_store "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/entity/Notification.java"
click node_announcement_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/controller/AnnouncementController.java"
click node_announcement_store "https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/entity/Announcement.java"
click node_dashboard_controller "https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java"
click node_backend_resources "https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/entity/Resource.java"
click node_backend_downloads "https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/repository/DownloadRepository.java"
click node_backend_subjects "https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/repository/SubjectRepository.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_app,node_admin_ui,node_dashboard_ui,node_resources_ui,node_resource_detail_ui,node_upload_ui,node_courses_ui,node_announcements_ui,node_create_announcement_ui,node_learner toneBlue
class node_gateway_filter,node_gateway_jwt,node_auth_controller,node_auth_jwt,node_auth_users toneAmber
class node_resource_controller,node_resource_service,node_resource_store,node_resource_records,node_subject_controller,node_backend_resources,node_backend_downloads,node_backend_subjects toneMint
class node_notification_controller,node_notification_store,node_announcement_controller,node_announcement_store,node_dashboard_controller toneRose
```

## Components

### Web client

- [App routing and login](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin dashboard](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [Dashboard view](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Resource browsing](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Resources.jsx): `frontend/src/pages/Resources.jsx`
- [Resource details](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/ResourceDetails.jsx): `frontend/src/pages/ResourceDetails.jsx`
- [Resource upload](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/UploadResource.jsx): `frontend/src/pages/UploadResource.jsx`
- [Course browsing](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Courses.jsx): `frontend/src/pages/Courses.jsx`
- [Announcements view](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/Announcements.jsx): `frontend/src/pages/Announcements.jsx`
- [Announcement creation](https://github.com/belachojomia-beep/rlearn-hub/blob/main/frontend/src/pages/CreateAnnouncement.jsx): `frontend/src/pages/CreateAnnouncement.jsx`

### Identity and access

- [JWT request filter](https://github.com/belachojomia-beep/rlearn-hub/blob/main/gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtAuthenticationFilter.java): `gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtAuthenticationFilter.java`
- [Gateway JWT service](https://github.com/belachojomia-beep/rlearn-hub/blob/main/gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtService.java): `gateway/api-gateway/src/main/java/com/rlearnhub/gateway/security/JwtService.java`
- [Authentication endpoints](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java): `services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java`
- [Auth JWT service](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/JwtService.java): `services/auth-service/src/main/java/com/rlearnhub/auth/JwtService.java`
- [Auth user repository](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/auth-service/src/main/java/com/rlearnhub/auth/repository/UserRepository.java): `services/auth-service/src/main/java/com/rlearnhub/auth/repository/UserRepository.java`

### Learning resources

- [Resource and downloads](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java): `services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java`
- [Resource operations](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/service/ResourceService.java): `services/resource-service/src/main/java/com/rlearnhub/resource/service/ResourceService.java`
- [Resource repository](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/repository/ResourceRepository.java): `services/resource-service/src/main/java/com/rlearnhub/resource/repository/ResourceRepository.java`
- [Resource and download models](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/entity/Resource.java): `services/resource-service/src/main/java/com/rlearnhub/resource/entity/Resource.java`
- [Subject endpoints](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/resource-service/src/main/java/com/rlearnhub/resource/controller/SubjectController.java): `services/resource-service/src/main/java/com/rlearnhub/resource/controller/SubjectController.java`
- [Backend resource records](https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/entity/Resource.java): `Backend/src/main/java/com/rlearnhub/backend/entity/Resource.java`
- [Download repository](https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/repository/DownloadRepository.java): `Backend/src/main/java/com/rlearnhub/backend/repository/DownloadRepository.java`
- [Subject repository](https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/repository/SubjectRepository.java): `Backend/src/main/java/com/rlearnhub/backend/repository/SubjectRepository.java`

### Engagement and insights

- [Notification endpoints](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/controller/NotificationController.java): `services/notification-service/src/main/java/com/rlearnhub/notification/controller/NotificationController.java`
- [Notification records](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/entity/Notification.java): `services/notification-service/src/main/java/com/rlearnhub/notification/entity/Notification.java`
- [Announcement endpoints](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/controller/AnnouncementController.java): `services/notification-service/src/main/java/com/rlearnhub/notification/controller/AnnouncementController.java`
- [Announcement records](https://github.com/belachojomia-beep/rlearn-hub/blob/main/services/notification-service/src/main/java/com/rlearnhub/notification/entity/Announcement.java): `services/notification-service/src/main/java/com/rlearnhub/notification/entity/Announcement.java`
- [Dashboard statistics](https://github.com/belachojomia-beep/rlearn-hub/blob/main/Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java): `Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java`

### Other components

- **Portal user**

## Connections

- App routing and login → Dashboard view: routes to (evidence: `frontend/src/App.jsx`)
- App routing and login → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routing and login → Resource browsing: routes to (evidence: `frontend/src/App.jsx`)
- App routing and login → Resource upload: routes to (evidence: `frontend/src/App.jsx`)
- App routing and login → Announcements view: routes to (evidence: `frontend/src/App.jsx`)
- Resource browsing → Resource details: uses (evidence: `frontend/src/pages/Resources.jsx`)
- Authentication endpoints → Auth user repository: queries (evidence: `services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java`)
- Authentication endpoints → Auth JWT service: generates token (evidence: `services/auth-service/src/main/java/com/rlearnhub/auth/controller/AuthController.java`)
- Resource and downloads → Resource repository: reads and writes (evidence: `services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java`)
- Resource and downloads → Resource and download models: creates records (evidence: `services/resource-service/src/main/java/com/rlearnhub/resource/controller/ResourceController.java`)
- Resource operations → Resource repository: reads and writes (evidence: `services/resource-service/src/main/java/com/rlearnhub/resource/service/ResourceService.java`)
- Notification endpoints → Notification records: reads and writes (evidence: `services/notification-service/src/main/java/com/rlearnhub/notification/controller/NotificationController.java`)
- Announcement endpoints → Announcement records: reads and writes (evidence: `services/notification-service/src/main/java/com/rlearnhub/notification/controller/AnnouncementController.java`)
- Dashboard statistics → Backend resource records: counts and lists (evidence: `Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java`)
- Dashboard statistics → Download repository: counts downloads (evidence: `Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java`)
- Dashboard statistics → Subject repository: counts subjects (evidence: `Backend/src/main/java/com/rlearnhub/backend/controller/DashboardController.java`)
