# prajwal-v-naik/movie_ticket_booking architecture

> Architecture diagram of the GitHub repository prajwal-v-naik/movie_ticket_booking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prajwal-v-naik/movie_ticket_booking
- Repository: https://github.com/prajwal-v-naik/movie_ticket_booking

## Overview

##### Main Components
- User Interface (UI) Pages:
- LoginPage.java – The entry point for user login.
- SignUpPage.java – Registration page for new users.
- MovieSelectionPage.java – Allows users to browse and select movies.
- PaymentPage.java – Handles payment interactions and transactions.
- Core Logic and Utilities:
- Main.java – Likely the central driver or initialization class.
- AuthUtil.java – Contains authentication/authorization related functionality.
- Data Layer:
- CSV Files (movies.csv, users.csv, booked_seats.csv, receipt.csv) – Serve as the persistent storage for different entities such as user data, movie listings, bookings, and receipts.

##### Diagramming the Relationships and Interactions
- UI components as the primary interaction points. They should be grouped visually to indicate the “front-end” or user-facing side.
- Flow from LoginPage → (via AuthUtil) → SignUpPage (if registration is needed) → MovieSelectionPage → PaymentPage.
- Main.java as the component that initiates the application and may coordinate the interaction between multiple UI components.

##### Highlighting Architectural Patterns
- The “View” is represented by the different Page classes (LoginPage, SignUpPage, etc.).
- The “Model” is the CSV-based data store.
- The “Controller” role is implicitly played by Main.java and AuthUtil.java coordinating application flow.
- Stress the importance of clear data flow and dependencies—especially how data movement happens between the UI and the CSV storage.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Core Logic & Utilities
    subgraph "Core Logic & Utilities"
        M("Application Launcher"):::controller
        AU("User Auth Utility"):::controller
    end

    %% User Interface (UI) Pages
    subgraph "User Interface (UI) Pages"
        L("Login Page"):::ui
        S("Sign Up Page"):::ui
        MS("Movie Selection Page"):::ui
        P("Payment Page"):::ui
    end

    %% Data Layer
    subgraph "Data Layer"
        Movies("Movies CSV Data"):::data
        Users("Users CSV Data"):::data
        Booked("Booked Seats CSV Data"):::data
        Receipt("Receipt CSV Data"):::data
    end

    %% Application Flow
    M -->|"launches"| L
    L -->|"authenticate"| AU
    AU -->|"redirect_signup"| S
    L -->|"login_success"| MS
    S -->|"registration_complete"| MS
    MS -->|"proceed_payment"| P

    %% Data Interactions
    L -->|"reads_users"| Users
    S -->|"writes_users"| Users
    AU -->|"reads_users"| Users
    MS -->|"reads_movies"| Movies
    MS -->|"writes_bookings"| Booked
    P -->|"writes_receipt"| Receipt

    %% Click Events
    click L "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/LoginPage.java"
    click S "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/SignUpPage.java"
    click MS "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/MovieSelectionPage.java"
    click P "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/PaymentPage.java"
    click M "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/Main.java"
    click AU "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/AuthUtil.java"
    click Movies "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/movies.csv"
    click Users "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/users.csv"
    click Booked "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/booked_seats.csv"
    click Receipt "https://github.com/prajwal-v-naik/movie_ticket_booking/blob/main/receipt.csv"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef controller fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
    classDef data fill:#A9DFBF,stroke:#229954,stroke-width:2px;
```
