# raghavulu111/reservation_system_train_ticket architecture

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

- Interactive diagram: https://gitdiagram.com/raghavulu111/reservation_system_train_ticket
- Repository: https://github.com/raghavulu111/reservation_system_train_ticket

## Overview

##### Project type and purpose
- This is a monolithic full-stack web application built on Java J2EE (Servlets + JDBC) with a static HTML/CSS/Bootstrap front-end and an Oracle relational database back-end.
- Purpose: Allow admins and users to view and manage train schedules, check availability, perform fare enquiries, book tickets, and manage user accounts.

##### File structure
- Top-level:
- pom.xml – Maven build descriptor
- WebContent/ – Static front-end assets (HTML, CSS, Bootstrap) and the web.xml deployment descriptor
- src/ – Java source tree
- Under src/:
- com.shashi.servlets – HTTP controllers handling incoming requests and dispatching to views
- com.shashi.service (and impl) – Business/service layer interfaces and implementations
- com.shashi.beans – Plain Old Java Objects (POJOs) modeling domain entities (User, Train, Booking, etc.)
- com.shashi.utility – Helpers for database connections (DBUtil) and common transformations
- com.shashi.constant – Application-wide constants (response codes, user roles)
- application.properties – Externalized configuration (e.g., DB URL/credentials)
- Deployment:
- WebContent/WEB-INF/lib – ojdbc8.jar for Oracle connectivity
- WebContent/WEB-INF/web.xml – Servlet mappings

##### Key insights from README
- Two actor types: Admin and User, each with a distinct set of use-cases
- Core functionalities: search/view trains, fare enquiry, seat availability, booking, history, profile management, payment gateway integration
- Technology stack: HTML/CSS/Bootstrap, Java Servlets, JDBC, Oracle SQL

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client (Browser)"
        direction TB
        StaticPages["HTML/CSS/Bootstrap Pages"]:::frontend
        CSS["UserHome_Css.css"]:::frontend
    end

    %% Configuration & Deployment
    subgraph "Configuration & Deployment"
        direction TB
        pom["pom.xml"]:::config
        props["application.properties"]:::config
        schema["Dummy-Database.md"]:::config
        readme["README.md"]:::config
    end

    %% Servlet Container
    subgraph "Web Server / Servlet Container"
        direction TB
        webxml["web.xml"]:::backend
        ojdbc["ojdbc8.jar"]:::backend
    end

    %% Presentation Layer
    subgraph "Presentation Layer (Servlets)" 
        direction TB
        servlets["Servlet Controllers"]:::backend
    end

    %% Business Layer
    subgraph "Business Layer (Services)"
        direction TB
        svcIntf["Service Interfaces"]:::backend
        svcImpl["Service Implementations"]:::backend
    end

    %% Data Access Layer
    subgraph "Data Access Layer (JDBC Utilities)"
        direction TB
        dbutil["DBUtil.java"]:::backend
        trainutil["TrainUtil.java"]:::backend
    end

    %% Domain Model & Constants
    subgraph "Domain Model & Constants"
        direction TB
        beans["Domain Beans (POJOs)"]:::backend
        constants["Application Constants"]:::backend
    end

    %% External Services
    subgraph "External Services"
        direction TB
        payment["Payment Gateway"]:::external
    end

    %% Database
    oracle["Oracle Database"]:::database

    %% Connections
    StaticPages -->|HTTP Request| webxml
    CSS -->|HTTP Request| webxml
    webxml -->|deploy mappings| servlets
    servlets -->|"calls"| svcIntf
    svcIntf -->|"implemented by"| svcImpl
    svcImpl -->|"uses"| dbutil
    svcImpl -->|"uses"| trainutil
    dbutil -->|"JDBC SQL"| oracle
    trainutil -->|"JDBC SQL"| oracle
    servlets -->|"for payment call"| payment
    payment -->|"confirmation"| servlets

    %% Configuration Links
    pom -.-> servlets
    props -.-> dbutil
    schema -.-> oracle
    readme -.-> servlets

    %% Click Events
    click StaticPages "https://github.com/raghavulu111/reservation_system_train_ticket/tree/master/WebContent/"
    click CSS "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/WebContent/UserHome_Css.css"
    click webxml "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/WebContent/WEB-INF/web.xml"
    click ojdbc "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/WebContent/WEB-INF/lib/ojdbc8.jar"
    click servlets "https://github.com/raghavulu111/reservation_system_train_ticket/tree/master/src/com/shashi/servlets/"
    click svcIntf "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/service/BookingService.java"
    click svcImpl "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/service/impl/BookingServiceImpl.java"
    click dbutil "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/utility/DBUtil.java"
    click trainutil "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/utility/TrainUtil.java"
    click beans "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/beans/AdminBean.java"
    click constants "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/com/shashi/constant/ResponseCode.java"
    click props "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/src/application.properties"
    click pom "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/pom.xml"
    click schema "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/Dummy-Database.md"
    click readme "https://github.com/raghavulu111/reservation_system_train_ticket/blob/master/README.md"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#66b0ff,color:#004085
    classDef backend fill:#d4edda,stroke:#28a745,color:#155724
    classDef database fill:#fff3cd,stroke:#ffcd39,color:#856404
    classDef external fill:#e2e3e5,stroke:#6c757d,color:#1b1e21
    classDef config fill:#f8d7da,stroke:#dc3545,color:#721c24
```
