# gdgmit/eventx architecture

> Architecture diagram of the GitHub repository gdgmit/eventx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gdgmit/eventx
- Repository: https://github.com/gdgmit/eventx

## Overview

##### Main Components
- User Interface (UI):
- Web Application Server:
- This is where the core application logic lives. The “src/java” directory contains various Servlets (e.g., EventServlet, LoginDao, LogoutServlet) that function as controllers and business logic handlers.
- Use of Java-specific libraries from the “lib” folder (e.g., servlet API, and Oracle JDBC drivers for database connectivity).
- Database:
- The README mentions MySQL for persistent storage. This should be represented as the data layer storing event data, user authentication details, and other related information.
- Build/Deployment:
- Directories like “build”, “build/web”, “nbproject”, and “dist” indicate the project is prepared using an IDE (NetBeans) and deployed possibly on a Java EE server such as Tomcat or GlassFish (as inferred from “glassfish-web.xml”).

##### Relationships and Data Flow
- Clients (browsers) interact with the UI components (HTML/CSS/JSP) hosted by the Web Application Server.
- The Web Application Server receives requests via Servlets, which then interact with:
- The Business Logic: Handling authentication, event processing (registration, creation, event listing).
- The Data Access Layer: Here, the application uses JDBC to interact with the MySQL database.
- Responses from the database return back through the Servlets to update the UI.

##### Architectural Patterns and Design Choices
- Model-View-Controller (MVC) Pattern: Even if not formally divided, the use of Servlets as controllers, the JSP/HTML as views, and JDBC/database interactions suggest an MVC-like architecture.
- Layered Architecture: There’s a clear separation between:
- Presentation Layer (HTML, JSP, CSS)
- Business Logic Layer (Java Servlets and supporting classes)
- Data Access Layer (JDBC connectivity to MySQL)
- Deployment Separation: With source code in “src/java” and generated files in “build” or “dist”, it’s clear that the build process (via Ant scripts as seen in build.xml) is separated from source code.

##### Components
- Client / Browser: Representing end-user devices.
- Web Frontend:
- HTML, CSS and JSP Templates (UI elements).
- Application Server:
- Servlets handling various endpoints (EventServlet, EventsServlet, LoginDao, etc.).
- Java classes for business logic (e.g., AddEvent.java, ValidateAd.java).
- Technology integration (JDBC, connection management).
- Database Server:
- MySQL database for events, registrations, user data.
- External Libraries and Frameworks:
- Java Servlet API and JDBC libraries (evidenced by jar files in “lib”).
- Integration with GlassFish/Tomcat managed via configuration files (web.xml, glassfish-web.xml).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Tier"
        Browser["User Browser"]:::client
    end

    %% Presentation Tier
    subgraph "Presentation Tier"
        WebUI["Web UI (HTML, JSP, CSS)"]:::frontend
    end

    %% Application Tier
    subgraph "Application Tier"
        AppServer["Application Server (Servlets & Business Logic)"]:::backend
        ExternalLib["External Libs & Frameworks"]:::library
    end

    %% Data Tier
    subgraph "Data Tier"
        Database["Database Server (MySQL)"]:::database
    end

    %% Build/Deployment Configuration
    subgraph "Build/Deployment"
        Deployment["Deployment & Configuration"]:::deployment
    end

    %% Data Flow
    Browser -->|"HTTP_Request"| WebUI
    WebUI -->|"Submit_Data"| AppServer
    AppServer -->|"JDBC_Call"| Database
    Database -->|"Query_Response"| AppServer
    AppServer -->|"Render_Data"| WebUI
    WebUI -->|"Display_Response"| Browser

    %% Additional Relationships
    AppServer ---|"Uses"| ExternalLib
    Deployment ---|"Configured&Built"| AppServer

    %% Click Events
    click WebUI "https://github.com/gdgmit/eventx/blob/main/web/index.html"
    click AppServer "https://github.com/gdgmit/eventx/tree/main/src/java"
    click Deployment "https://github.com/gdgmit/eventx/blob/main/build.xml"
    click ExternalLib "https://github.com/gdgmit/eventx/tree/main/lib"

    %% Styles
    classDef client fill:#ffcc99,stroke:#333,stroke-width:2px;
    classDef frontend fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef database fill:#ffffcc,stroke:#333,stroke-width:2px;
    classDef deployment fill:#d3d3d3,stroke:#333,stroke-width:2px;
    classDef library fill:#ffc0cb,stroke:#333,stroke-width:2px;
```
