# aryansrivastava1709/event-management-system architecture

> Architecture diagram of the GitHub repository aryansrivastava1709/event-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aryansrivastava1709/event-management-system
- Repository: https://github.com/aryansrivastava1709/event-management-system

## Overview

##### Project Type and Purpose
- This is a full-stack, microservices-based Event Management System.
- Frontend: Angular SPA.
- Backend: A set of Spring Boot microservices managing registration, login, events, bookings, payments, notifications, images, user lookups, plus an API Gateway and Eureka Service Registry.
- Each microservice exposes REST endpoints, uses JWT for security, communicates via Feign, and persists data to its own MySQL schema.

##### File Structure Analysis
- Top-level “backend” directory contains:
- eureka‐server – service registry
- gateway-api – Spring Cloud Gateway for routing + JWT filtering
- registration-service, login-service, user-service, event-service, booking-service, payment-service, notification-service, image-service – each a standalone Spring Boot app (controller, service, repository, config, dto, exception, tests)
- “frontend” directory contains an Angular project (app module, components, services, guards).
- Build and config files: `pom.xml`, `application.properties`, `.mvn`, Maven wrappers in each service; `angular.json`, `package.json` for frontend.

##### Key Architecture Insights from README
- A classical microservices architecture with:
- Service Registry (Eureka)
- API Gateway for routing and cross-cutting concerns (JWT, CORS, logging)
- Dedicated microservices for domain functions (users, auth, events, bookings, payments, notifications, images)
- Each service registers with Eureka, discovers peers via Feign, and secures endpoints using JWT.

- Frontend (Angular SPA)
- API Gateway
- Eureka Service Registry
- Microservices:
- Registration Service
- Login Service
- User Service
- Event Service
- Booking Service
- Payment Service
- Notification Service
- Image Service
- Datastores (MySQL) – one per service
- External Services: Mail SMTP (Notification), Cloudinary (Image), Razorpay (Payment)
- User’s browser → HTTP(S) → API Gateway
- Gateway → Eureka lookup → Route to appropriate microservice
- Booking Service ↔ Payment Service (via Feign)
- Booking Service ↔ Event Service, User Service (via Feign)
- Payment Service ↔ Razorpay API
- Notification Service → Mail server
- Image Service → Cloudinary API
c. Architectural Patterns & Principles:
- Microservices with single responsibility
- Service Discovery (Eureka) + Client-side load balancing
- API Gateway Pattern for authentication, routing, logging, CORS
- JWT-based stateless security
- Inter-service comm via Feign (REST)
d. Key Technologies & Frameworks:
- Spring Boot, Spring Cloud Netflix (Eureka, Feign), Spring Security (JWT)
- MySQL (persistent store)
- Angular, TypeScript (frontend)
- External APIs: Razorpay, Cloudinary, SMTP Mail

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        Browser["Angular SPA"]:::ui
    end

    %% API Layer
    subgraph "API Layer"
        Gateway["API Gateway"]:::gateway
        Eureka["Eureka Service Registry"]:::gateway
    end

    Browser -->|"HTTPS Request"| Gateway
    Gateway -->|"Service Discovery"| Eureka

    %% Microservices Layer
    subgraph "Microservices"
        Registration["Registration Service"]:::ms
        Login["Login Service"]:::ms
        UserService["User Service"]:::ms
        EventService["Event Service"]:::ms
        Booking["Booking Service"]:::ms
        Payment["Payment Service"]:::ms
        Notification["Notification Service"]:::ms
        ImageService["Image Service"]:::ms
    end

    Gateway -->|"POST /register"| Registration
    Gateway -->|"POST /login"| Login
    Gateway -->|"GET /users"| UserService
    Gateway -->|"GET /events"| EventService
    Gateway -->|"POST /bookings"| Booking
    Gateway -->|"POST /payments"| Payment
    Gateway -->|"POST /notifications"| Notification
    Gateway -->|"POST /images"| ImageService

    %% Inter-service Calls
    Booking -.->|"Feign: fetch-user"| UserService
    Booking -.->|"Feign: fetch-event"| EventService
    Booking -.->|"Feign: process-payment"| Payment
    Payment -.->|"Razorpay API"| Razorpay
    Notification -->|"SMTP"| SMTP
    ImageService -->|"Cloudinary API"| Cloudinary

    %% Data Layer
    subgraph "Datastores"
        RegDB["MySQL (Registration)"]:::db
        LoginDB["MySQL (Login)"]:::db
        UserDB["MySQL (User)"]:::db
        EventDB["MySQL (Event)"]:::db
        BookingDB["MySQL (Booking)"]:::db
        PaymentDB["MySQL (Payment)"]:::db
        NotificationDB["MySQL (Notification)"]:::db
        ImageDB["MySQL (Image)"]:::db
    end

    Registration -->|CRUD| RegDB
    Login -->|CRUD| LoginDB
    UserService -->|CRUD| UserDB
    EventService -->|CRUD| EventDB
    Booking -->|CRUD| BookingDB
    Payment -->|CRUD| PaymentDB
    Notification -->|CRUD| NotificationDB
    ImageService -->|CRUD| ImageDB

    %% External Services
    subgraph "External Services"
        SMTP["Mail SMTP"]:::ext
        Razorpay["Razorpay API"]:::ext
        Cloudinary["Cloudinary API"]:::ext
    end

    Notification -->|Send Email| SMTP
    Payment -->|Process Payment| Razorpay
    ImageService -->|Upload| Cloudinary

    %% Click Events
    click Browser "https://github.com/aryansrivastava1709/event-management-system/tree/master/frontend/"
    click Eureka "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/eureka-server/"
    click Gateway "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/gateway-api/"
    click Registration "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/registration-service/"
    click Login "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/login-service/"
    click UserService "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/user-service/"
    click EventService "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/event-service/"
    click Booking "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/booking-service/"
    click Payment "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/payment-service/"
    click Notification "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/notification-service/"
    click ImageService "https://github.com/aryansrivastava1709/event-management-system/tree/master/backend/image-service/"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0066CC,color:#003366;
    classDef gateway fill:#DFF2D8,stroke:#2E7D32,color:#1B5E20;
    classDef ms fill:#FFE0B2,stroke:#EF6C00,color:#E65100;
    classDef db fill:#F5F5F5,stroke:#9E9E9E,color:#424242;
    classDef ext fill:#E1BEE7,stroke:#8E24AA,color:#6A1B9A;
```
