# hijisu/gs42-cluster architecture

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

- Interactive diagram: https://gitdiagram.com/hijisu/gs42-cluster
- Repository: https://github.com/hijisu/gs42-cluster

## Overview

42gs-cluster is a campus service where trainees submit meeting and room requests, manage library requests, and read or write course reviews; education staff handle those requests in a parallel interface. The README documents in-app alerts and optional web push, plus optional 42 authentication. The graph preserves these product areas and their documented user workflows. Source excerpts show notification event handling and room-staff use cases; other implementation links are documented at product level, so edges do not imply uninspected call paths.

Main entry points: [`frontend/src/app/router.tsx`](https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/app/router.tsx) (Staff interface), [`backend/notifications/application/handlers.py`](https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/handlers.py) (Event handlers), [`backend/notifications/application/service.py`](https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/service.py) (Notification service), [`backend/accounts/interfaces/authentication.py`](https://github.com/hijisu/gs42-cluster/blob/main/backend/accounts/interfaces/authentication.py) (Login and roles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_student_ui["Trainee interface<br/>[router.tsx]"]
  node_staff_ui["Staff interface<br/>[router.tsx]"]
  node_notification_ui["Notification settings<br/>[Notifications.tsx]"]
end

subgraph group_identity["Identity"]
  node_login["Login and roles<br/>[authentication.py]"]
  node_accounts[("Account records<br/>[repository.py]")]
end

subgraph group_campus["Campus services"]
  node_meetings["Meeting requests"]
  node_meeting_staff["Meeting management<br/>[staff_usecases.py]"]
  node_rooms["Room reservations<br/>[usecases.py]"]
  node_room_staff["Room management<br/>[staff_usecases.py]"]
  node_library["Oasis library"]
  node_reviews["Course reviews"]
  node_course_staff["Course administration<br/>[staff_usecases.py]"]
end

subgraph group_messaging["Notifications"]
  node_notification_handlers["Event handlers<br/>[handlers.py]"]
  node_notification_service["Notification service<br/>[service.py]"]
  node_push["Web push<br/>[push.py]"]
end

subgraph group_platform["Shared platform"]
  node_event_bus["Event dispatch<br/>[events.py]"]
  node_database[("PostgreSQL<br/>[settings.py]")]
end

node_trainee(("Trainee"))
node_staff(("Education staff"))

node_trainee -->|"uses"| node_student_ui
node_staff -->|"uses"| node_staff_ui
node_student_ui -->|"signs in"| node_login
node_staff_ui -->|"signs in"| node_login
node_login -->|"resolves account"| node_accounts
node_student_ui -->|"requests meetings"| node_meetings
node_staff_ui -->|"manages meetings"| node_meeting_staff
node_student_ui -->|"requests rooms"| node_rooms
node_staff_ui -->|"handles reservations"| node_room_staff
node_student_ui -->|"browses and requests"| node_library
node_staff_ui -->|"handles book requests"| node_library
node_student_ui -->|"reads and writes"| node_reviews
node_staff_ui -->|"manages courses"| node_course_staff
node_meeting_staff -.->|"publishes events"| node_notification_handlers
node_room_staff -->|"publishes events"| node_notification_handlers
node_notification_handlers -->|"creates alerts"| node_notification_service
node_notification_handlers -->|"registers handlers"| node_event_bus
node_notification_service -->|"delivers in-app alerts"| node_notification_ui
node_notification_service -.->|"sends web push"| node_push
node_staff_ui -->|"views alerts"| node_notification_ui
node_database -.->|"stores accounts"| node_accounts

click node_student_ui "https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/app/router.tsx"
click node_staff_ui "https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/app/router.tsx"
click node_login "https://github.com/hijisu/gs42-cluster/blob/main/backend/accounts/interfaces/authentication.py"
click node_accounts "https://github.com/hijisu/gs42-cluster/blob/main/backend/accounts/infrastructure/repository.py"
click node_meetings "https://github.com/hijisu/gs42-cluster/tree/main/backend/meetings"
click node_meeting_staff "https://github.com/hijisu/gs42-cluster/blob/main/backend/meetings/application/staff_usecases.py"
click node_rooms "https://github.com/hijisu/gs42-cluster/blob/main/backend/rooms/application/usecases.py"
click node_room_staff "https://github.com/hijisu/gs42-cluster/blob/main/backend/rooms/application/staff_usecases.py"
click node_library "https://github.com/hijisu/gs42-cluster/tree/main/backend/library"
click node_reviews "https://github.com/hijisu/gs42-cluster/tree/main/backend/reviews"
click node_course_staff "https://github.com/hijisu/gs42-cluster/blob/main/backend/reviews/application/staff_usecases.py"
click node_notification_handlers "https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/handlers.py"
click node_notification_service "https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/service.py"
click node_notification_ui "https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/features/notification/Notifications.tsx"
click node_push "https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/infrastructure/push.py"
click node_event_bus "https://github.com/hijisu/gs42-cluster/blob/main/backend/common/domain/events.py"
click node_database "https://github.com/hijisu/gs42-cluster/blob/main/backend/config/settings.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_student_ui,node_staff_ui,node_notification_ui toneBlue
class node_login,node_accounts toneAmber
class node_meetings,node_meeting_staff,node_rooms,node_room_staff,node_library,node_reviews,node_course_staff toneMint
class node_notification_handlers,node_notification_service,node_push toneRose
class node_event_bus,node_database,node_trainee,node_staff toneIndigo
```

## Components

### User interfaces

- [Trainee interface](https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Staff interface](https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Notification settings](https://github.com/hijisu/gs42-cluster/blob/main/frontend/src/features/notification/Notifications.tsx): `frontend/src/features/notification/Notifications.tsx`

### Identity

- [Login and roles](https://github.com/hijisu/gs42-cluster/blob/main/backend/accounts/interfaces/authentication.py): `backend/accounts/interfaces/authentication.py`
- [Account records](https://github.com/hijisu/gs42-cluster/blob/main/backend/accounts/infrastructure/repository.py): `backend/accounts/infrastructure/repository.py`

### Campus services

- [Meeting requests](https://github.com/hijisu/gs42-cluster/tree/main/backend/meetings): `backend/meetings`
- [Meeting management](https://github.com/hijisu/gs42-cluster/blob/main/backend/meetings/application/staff_usecases.py): `backend/meetings/application/staff_usecases.py`
- [Room reservations](https://github.com/hijisu/gs42-cluster/blob/main/backend/rooms/application/usecases.py): `backend/rooms/application/usecases.py`
- [Room management](https://github.com/hijisu/gs42-cluster/blob/main/backend/rooms/application/staff_usecases.py): `backend/rooms/application/staff_usecases.py`
- [Oasis library](https://github.com/hijisu/gs42-cluster/tree/main/backend/library): `backend/library`
- [Course reviews](https://github.com/hijisu/gs42-cluster/tree/main/backend/reviews): `backend/reviews`
- [Course administration](https://github.com/hijisu/gs42-cluster/blob/main/backend/reviews/application/staff_usecases.py): `backend/reviews/application/staff_usecases.py`

### Notifications

- [Event handlers](https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/handlers.py): `backend/notifications/application/handlers.py`
- [Notification service](https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/application/service.py): `backend/notifications/application/service.py`
- [Web push](https://github.com/hijisu/gs42-cluster/blob/main/backend/notifications/infrastructure/push.py): `backend/notifications/infrastructure/push.py`

### Shared platform

- [Event dispatch](https://github.com/hijisu/gs42-cluster/blob/main/backend/common/domain/events.py): `backend/common/domain/events.py`
- [PostgreSQL](https://github.com/hijisu/gs42-cluster/blob/main/backend/config/settings.py): `backend/config/settings.py`

### Other components

- **Trainee**
- **Education staff**

## Connections

- Trainee → Trainee interface: uses (evidence: `README.md`)
- Education staff → Staff interface: uses (evidence: `README.md`)
- Trainee interface → Login and roles: signs in (evidence: `README.md`)
- Staff interface → Login and roles: signs in (evidence: `README.md`)
- Login and roles → Account records: resolves account (evidence: `backend/accounts/infrastructure/repository.py`)
- Trainee interface → Meeting requests: requests meetings (evidence: `README.md`)
- Staff interface → Meeting management: manages meetings (evidence: `README.md`)
- Trainee interface → Room reservations: requests rooms (evidence: `README.md`)
- Staff interface → Room management: handles reservations (evidence: `README.md`)
- Trainee interface → Oasis library: browses and requests (evidence: `README.md`)
- Staff interface → Oasis library: handles book requests (evidence: `README.md`)
- Trainee interface → Course reviews: reads and writes (evidence: `README.md`)
- Staff interface → Course administration: manages courses (evidence: `README.md`)
- Meeting management → Event handlers: publishes events
- Room management → Event handlers: publishes events (evidence: `backend/rooms/application/staff_usecases.py`)
- Event handlers → Notification service: creates alerts (evidence: `backend/notifications/application/handlers.py`)
- Event handlers → Event dispatch: registers handlers (evidence: `backend/notifications/application/handlers.py`)
- Notification service → Notification settings: delivers in-app alerts (evidence: `README.md`)
- Notification service → Web push: sends web push (evidence: `README.md`)
- Staff interface → Notification settings: views alerts (evidence: `README.md`)
- PostgreSQL → Account records: stores accounts
