# sudheer-pi/eventhub-backend architecture

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

- Interactive diagram: https://gitdiagram.com/sudheer-pi/eventhub-backend
- Repository: https://github.com/sudheer-pi/eventhub-backend

## Overview

EventHub is a Spring Boot REST backend for college event management. Clients authenticate and receive JWTs, then use role-restricted APIs for user and category administration, event creation and approval, and student registration, retrieval, and cancellation. Controllers delegate domain operations to services, which use Spring Data repositories over JPA entities backed by MySQL. The sampled service code confirms authentication, event approval, capacity and duplicate-registration checks, and cancellation. Some capabilities are documented in the README but their implementation was not sampled; those links are documented rather than inferred from unseen code.

Main entry points: [`src/main/java/com/eventhub/backend/repository`](https://github.com/sudheer-pi/eventhub-backend/tree/main/src/main/java/com/eventhub/backend/repository) (JPA repositories), [`src/main/java/com/eventhub/backend/service/AuthService.java`](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/AuthService.java) (Authentication service), [`src/main/java/com/eventhub/backend/service/EventService.java`](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/EventService.java) (Event service), [`src/main/java/com/eventhub/backend/controller/AuthController.java`](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/AuthController.java) (Authentication API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_auth_api["Authentication API"]
  node_event_api["Event API"]
  node_category_api["Category API"]
  node_registration_api["Registration API"]
  node_user_api["User API"]
end

subgraph group_identity["Identity and Security"]
  node_auth_service["Authentication service<br/>[AuthService.java]"]
  node_user_service["User service<br/>[UserService.java]"]
  node_jwt["JWT service<br/>[JwtService.java]"]
  node_jwt_security["JWT request security"]
  node_security_config["Role access configuration"]
end

subgraph group_events["Events and Registration"]
  node_event_service["Event service<br/>[EventService.java]"]
  node_category_service["Category service"]
  node_registration_service["Registration service"]
end

subgraph group_persistence["Persistence"]
  node_repos["JPA repositories"]
  node_entities["Domain entities and DTOs"]
  node_mysql[("MySQL database")]
end

node_clients(("API clients"))

node_clients -->|"calls"| node_auth_api
node_clients -->|"calls"| node_event_api
node_clients -->|"calls"| node_category_api
node_clients -->|"calls"| node_registration_api
node_clients -->|"calls"| node_user_api
node_auth_api -->|"delegates to"| node_auth_service
node_event_api -->|"delegates to"| node_event_service
node_category_api -->|"delegates to"| node_category_service
node_registration_api -->|"delegates to"| node_registration_service
node_user_api -->|"delegates to"| node_user_service
node_auth_service -->|"looks up users"| node_repos
node_auth_service -->|"generates token"| node_jwt
node_jwt_security -->|"validates tokens"| node_jwt
node_security_config -->|"configures filter"| node_jwt_security
node_user_service -->|"reads and saves"| node_repos
node_event_service -->|"reads and saves"| node_repos
node_registration_service -->|"checks and saves"| node_repos
node_repos -->|"persists"| node_entities
node_entities -->|"stored in"| node_mysql
node_event_service -.->|"uses category data"| node_category_service

click node_auth_api "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/AuthController.java"
click node_event_api "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/EventController.java"
click node_category_api "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/CategoryController.java"
click node_registration_api "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/RegistrationController.java"
click node_user_api "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/UserController.java"
click node_auth_service "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/AuthService.java"
click node_user_service "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/UserService.java"
click node_jwt "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/JwtService.java"
click node_jwt_security "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/JwtAuthenticationFilter.java"
click node_security_config "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/SecurityConfig.java"
click node_event_service "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/EventService.java"
click node_category_service "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/CategoryService.java"
click node_registration_service "https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/RegistrationService.java"
click node_repos "https://github.com/sudheer-pi/eventhub-backend/tree/main/src/main/java/com/eventhub/backend/repository"
click node_entities "https://github.com/sudheer-pi/eventhub-backend/tree/main/src/main/java/com/eventhub/backend/entity"

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_auth_api,node_event_api,node_category_api,node_registration_api,node_user_api,node_clients toneBlue
class node_auth_service,node_user_service,node_jwt,node_jwt_security,node_security_config toneAmber
class node_event_service,node_category_service,node_registration_service toneMint
class node_repos,node_entities,node_mysql toneRose
```

## Components

### REST API

- [Authentication API](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/AuthController.java): `src/main/java/com/eventhub/backend/controller/AuthController.java`
- [Event API](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/EventController.java): `src/main/java/com/eventhub/backend/controller/EventController.java`
- [Category API](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/CategoryController.java): `src/main/java/com/eventhub/backend/controller/CategoryController.java`
- [Registration API](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/RegistrationController.java): `src/main/java/com/eventhub/backend/controller/RegistrationController.java`
- [User API](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/controller/UserController.java): `src/main/java/com/eventhub/backend/controller/UserController.java`

### Identity and Security

- [Authentication service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/AuthService.java): `src/main/java/com/eventhub/backend/service/AuthService.java`
- [User service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/UserService.java): `src/main/java/com/eventhub/backend/service/UserService.java`
- [JWT service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/JwtService.java): `src/main/java/com/eventhub/backend/security/JwtService.java`
- [JWT request security](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/JwtAuthenticationFilter.java): `src/main/java/com/eventhub/backend/security/JwtAuthenticationFilter.java`
- [Role access configuration](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/security/SecurityConfig.java): `src/main/java/com/eventhub/backend/security/SecurityConfig.java`

### Events and Registration

- [Event service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/EventService.java): `src/main/java/com/eventhub/backend/service/EventService.java`
- [Category service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/CategoryService.java): `src/main/java/com/eventhub/backend/service/CategoryService.java`
- [Registration service](https://github.com/sudheer-pi/eventhub-backend/blob/main/src/main/java/com/eventhub/backend/service/RegistrationService.java): `src/main/java/com/eventhub/backend/service/RegistrationService.java`

### Persistence

- [JPA repositories](https://github.com/sudheer-pi/eventhub-backend/tree/main/src/main/java/com/eventhub/backend/repository): `src/main/java/com/eventhub/backend/repository`
- [Domain entities and DTOs](https://github.com/sudheer-pi/eventhub-backend/tree/main/src/main/java/com/eventhub/backend/entity): `src/main/java/com/eventhub/backend/entity`
- **MySQL database**

### Other components

- **API clients**

## Connections

- API clients → Authentication API: calls (evidence: `README.md`)
- API clients → Event API: calls (evidence: `README.md`)
- API clients → Category API: calls (evidence: `README.md`)
- API clients → Registration API: calls (evidence: `README.md`)
- API clients → User API: calls (evidence: `README.md`)
- Authentication API → Authentication service: delegates to (evidence: `src/main/java/com/eventhub/backend/controller/AuthController.java`)
- Event API → Event service: delegates to (evidence: `src/main/java/com/eventhub/backend/controller/EventController.java`)
- Category API → Category service: delegates to (evidence: `src/main/java/com/eventhub/backend/controller/CategoryController.java`)
- Registration API → Registration service: delegates to (evidence: `src/main/java/com/eventhub/backend/controller/RegistrationController.java`)
- User API → User service: delegates to (evidence: `src/main/java/com/eventhub/backend/controller/UserController.java`)
- Authentication service → JPA repositories: looks up users (evidence: `src/main/java/com/eventhub/backend/service/AuthService.java`)
- Authentication service → JWT service: generates token (evidence: `src/main/java/com/eventhub/backend/service/AuthService.java`)
- JWT request security → JWT service: validates tokens (evidence: `src/main/java/com/eventhub/backend/security/JwtAuthenticationFilter.java`)
- Role access configuration → JWT request security: configures filter (evidence: `src/main/java/com/eventhub/backend/security/SecurityConfig.java`)
- User service → JPA repositories: reads and saves (evidence: `src/main/java/com/eventhub/backend/service/UserService.java`)
- Event service → JPA repositories: reads and saves (evidence: `src/main/java/com/eventhub/backend/service/EventService.java`)
- Registration service → JPA repositories: checks and saves (evidence: `src/main/java/com/eventhub/backend/service/RegistrationService.java`)
- JPA repositories → Domain entities and DTOs: persists (evidence: `src/main/java/com/eventhub/backend/repository/RegistrationRepository.java`)
- Domain entities and DTOs → MySQL database: stored in (evidence: `README.md`)
- Event service → Category service: uses category data
