How aamir-0/event-management-app works
1. This repo is split into two top-level applications: a Spring Boot backend in backend/ and a React/Vite frontend in frontend/EventMangement/. The backend is the real system-of-record; the frontend is a single-page client that talks to it over HTTP.
2. The backend is a Maven-based Spring Boot app with standard layered structure: controllers → services → repositories → JPA models. The main domain is event booking, with separate modules for authentication, event management, booking, admin role changes, and scanner/validation flows.
3. The backend entry point is com.eventbooking.EventBookingApplication. The main request boundary is the controller package:
- AuthController for login/registration
- EventController for event CRUD/read operations
- BookingController for creating/managing bookings
- AdminController for privileged user/role actions
- ScannerController for scan/verification-related actions
4. Business logic lives in the service layer:
- AuthService handles identity and token issuance
- EventService manages event rules and persistence
- BookingService coordinates booking creation and lookup
- ScannerService likely validates bookings/tickets at scan time
- UserService manages user records and role-related operations
5. Persistence is handled with Spring Data repositories:
- UserRepository
- EventRepository
- BookingRepository
These map to the core entities in model/: Users, Role, Event, and Booking. That gives the architecture a straightforward relational data model centered on users, events, and bookings.
6. Security is a major architectural boundary. The backend includes JwtConfig, JwtAuthenticationFillter, SecurityConfig, and CorsConfig, which indicates:
- stateless authentication using JWTs
- protected endpoints for authenticated users and admins
- CORS configured so the React frontend can call the API from a separate origin
7. The primary data flow is: frontend action → REST controller → service logic → repository → PostgreSQL. For authentication, the flow is: register/login request → AuthService → JWT response (AuthResponse) → frontend stores token → token sent on later requests → JWT filter authenticates those requests.
8. The domain boundary appears to be role-based. Role, RoleUpdateRequest, and AdminController suggest at least two access levels: normal users who can register/book, and admins who can manage roles or event data. The scanner endpoints likely serve a third operational role for validating bookings at entry/check-in time.
9. The backend expects PostgreSQL as its external datastore. The README points to environment variables DB_URL, DB_USER, and DB_PASSWORD, so database connectivity is configured outside the codebase and should be treated as an infrastructure dependency in any architecture diagram.
10. The frontend is a lightweight Vite app with App.jsx, main.jsx, and CSS assets. There is no obvious separate frontend state-management or routing infrastructure in the tree, so it should be drawn as a client layer consuming the backend API rather than as a large multi-module frontend system.
11. There is very little ancillary infrastructure in the repository: no queue, cache, search engine, or object store is visible. That means the architecture is centered on a single backend API plus a relational database, with the frontend as the only consumer.
12. Test coverage appears minimal: there is only a basic backend application test scaffold. For diagram purposes, the important runtime components are the API layer, JWT security layer, service layer, JPA repositories, PostgreSQL, and the separate React client.
Main entry points: config Security · App.jsx React SPA · dto DTOs · BookingService.java BookingService
Components 20
Backend
Spring Boot API, security, services, and persistence
- EventBookingApp · Application bootstrap for the backend service
backend/src/main/java/com/eventbooking/EventBookingApplication.java - Security · Stateless auth, JWT filter, and cross-origin access control
backend/src/main/java/com/eventbooking/config - Auth API · Handles login and registration requests
backend/src/main/java/com/eventbooking/controller/AuthController.java - Event API · Exposes event CRUD and read operations
backend/src/main/java/com/eventbooking/controller/EventController.java - Booking API · Creates and manages bookings
backend/src/main/java/com/eventbooking/controller/BookingController.java - Admin API · Privileged role and administrative actions
backend/src/main/java/com/eventbooking/controller/AdminController.java - Scanner API · Scan and verification endpoints
backend/src/main/java/com/eventbooking/controller/ScannerController.java - AuthService · Identity handling and token issuance
backend/src/main/java/com/eventbooking/service/AuthService.java - EventService · Business rules for events and persistence
backend/src/main/java/com/eventbooking/service/EventService.java - BookingService · Coordinates booking creation and lookup
backend/src/main/java/com/eventbooking/service/BookingService.java - UserService · User records and role operations
backend/src/main/java/com/eventbooking/service/UserService.java - ScannerService · Validates bookings or tickets at scan time
backend/src/main/java/com/eventbooking/service/ScannerService.java - UserRepo · Persistence boundary for users
backend/src/main/java/com/eventbooking/repository/UserRepository.java - EventRepo · Persistence boundary for events
backend/src/main/java/com/eventbooking/repository/EventRepository.java - BookingRepo · Persistence boundary for bookings
backend/src/main/java/com/eventbooking/repository/BookingRepository.java - Domain Models · Users, Role, Event, and Booking entities
backend/src/main/java/com/eventbooking/model - DTOs · Request and response payloads for controllers
backend/src/main/java/com/eventbooking/dto - PostgreSQL · Relational database configured via environment variables
Frontend
React/Vite client that consumes the backend API
- React SPA · Single-page frontend for user interaction
frontend/EventMangement/src/App.jsx - Main entry · Client bootstrap and render entrypoint
frontend/EventMangement/src/main.jsx
Connections 34
- React SPA → Auth API: HTTP API · Calls backend endpoints for authentication
- React SPA → Event API: HTTP API · Reads and manages events through the API
- React SPA → Booking API: HTTP API · Submits booking actions
- React SPA → Admin API: HTTP API · Uses privileged admin endpoints when needed
- React SPA → Scanner API: HTTP API · Consumes verification/scan endpoints
- EventBookingApp → Security: initializes · Bootstraps the application context and security boundary
- Security → Auth API: protects · Applies authentication and CORS rules to requests
- Security → Event API: protects · Applies authentication and CORS rules to requests
- Security → Booking API: protects · Applies authentication and CORS rules to requests
- Security → Admin API: protects · Applies authentication and CORS rules to requests
- Security → Scanner API: protects · Applies authentication and CORS rules to requests
- Auth API → AuthService: delegates · Handles login and registration logic
- Event API → EventService: delegates · Handles event operations
- Booking API → BookingService: delegates · Handles booking operations
- Admin API → UserService: delegates · Handles role and user administration
- Scanner API → ScannerService: delegates · Handles scan-time verification
- AuthService → UserRepo: uses · Reads and writes user records
- EventService → EventRepo: uses · Persists event data
- BookingService → BookingRepo: uses · Persists booking data
- BookingService → EventRepo: uses · Checks event availability and relationships
- UserService → UserRepo: uses · Updates users and roles
- ScannerService → BookingRepo: uses · Validates booking or ticket status
- UserRepo → Domain Models: maps to · ORM mappings over core entities
- EventRepo → Domain Models: maps to · ORM mappings over core entities
- BookingRepo → Domain Models: maps to · ORM mappings over core entities
- Auth API → DTOs: uses · Consumes and returns auth payloads
- Event API → DTOs: uses · Consumes and returns event payloads
- Booking API → DTOs: uses · Consumes and returns booking payloads
- Admin API → DTOs: uses · Consumes role update payloads
- Scanner API → DTOs: uses · Returns scan responses
- AuthService → PostgreSQL: reads/writes · Persists identity data through repositories
- EventService → PostgreSQL: reads/writes · Persists event data through repositories
- BookingService → PostgreSQL: reads/writes · Persists booking data through repositories
- UserService → PostgreSQL: reads/writes · Persists user and role changes through repositories