# prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking- architecture

> Architecture diagram of the GitHub repository prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-
- Repository: https://github.com/prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-

## Overview

##### Project type and purpose
- This is a small, monolithic desktop automation tool written in Python.
- Its sole purpose is to automate IRCTC Tatkal or General ticket booking via a GUI and Selenium.

##### File structure
- Top-level files:
- README.md – project description and instructions
- irctc_automation.py – the entire application code
- No separate frontend/backend folders, databases, or microservices—everything lives in one script.

##### README for architectural hints
- Uses a GUI form (likely Tkinter or similar) for user input.
- Uses Selenium + Chrome WebDriver to drive an external web application (IRCTC website).
- Interacts directly with the IRCTC website over HTTP via the browser automation layer.
- User provides input at runtime; the script executes at a scheduled time (11 AM or 10 AM).

##### Main components and interactions
a. Components:
1. GUI Layer (User input form)
2. Automation Engine (Booking logic coded in Python)
3. Selenium Library (Python bindings)
4. Chrome WebDriver (chromedriver executable)
5. External IRCTC Website (target system)
6. OS Scheduler/Manual Trigger (launches script at the appropriate time)
b. Relationships:
- User → GUI Layer: inputs credentials, stations, date, passenger details
- GUI Layer → Automation Engine: passes the filled-in values
- Automation Engine → Selenium Library: calls methods to locate page elements, fill forms, and click buttons
- Selenium Library → Chrome WebDriver: communicates via the WebDriver protocol
- Chrome WebDriver → IRCTC Website: drives a real Chrome browser to perform HTTP requests and render pages
- IRCTC Website → WebDriver → Selenium → Automation Engine: returns page state (e.g., next form, CAPTCHA prompt, booking confirmation)
- OS Scheduler/Manual Trigger → starts the Python process at the designated time
c. Architectural patterns/design principles:
- Single-process, event-driven desktop application
- Layered separation (UI layer vs. automation logic vs. browser driver vs. external system)
d. Technologies and frameworks:
- Python 3
- GUI library (e.g., Tkinter)
- Selenium Python bindings
- Chrome WebDriver (chromedriver)
- External HTTP/Web application (IRCTC website)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Actors
    User(("User")):::actor
    Scheduler(("OS Scheduler/Manual Trigger")):::actor

    %% Desktop Application Layer
    subgraph "Desktop Application"
        GUI["GUI Layer (Python)"]:::local
        Engine["Automation Engine (Python)"]:::local
    end

    %% Libraries and External Systems
    Selenium["Selenium Library"]:::lib
    WebDriver["Chrome WebDriver"]:::lib
    IRCTC["IRCTC Website"]:::external

    %% Documentation
    Doc["Project Documentation"]:::doc

    %% Connections
    User -->|"fills form"| GUI
    Scheduler -->|"starts app"| GUI
    GUI -->|"pass input"| Engine
    Engine -->|"Selenium API calls"| Selenium
    Selenium -->|"WebDriver protocol"| WebDriver
    WebDriver -->|"HTTP interactions / DOM manipulation"| IRCTC
    IRCTC -->|"page state"| WebDriver
    WebDriver -->|"response"| Selenium
    Selenium -->|"response"| Engine

    %% Click Events
    click GUI "https://github.com/prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-/blob/master/irctc_automation.py"
    click Engine "https://github.com/prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-/blob/master/irctc_automation.py"
    click Doc "https://github.com/prajinkyapimpalghare/irctc-automation-tatkal-and-general-ticket-booking-/blob/master/README.md"

    %% Styles
    classDef local fill:#ADD8E6,stroke:#0000FF,color:#000;
    classDef lib fill:#90EE90,stroke:#008000,color:#000;
    classDef external fill:#FFA500,stroke:#FF8C00,color:#000;
    classDef actor fill:#CCCCCC,stroke:#333333,color:#000;
    classDef doc fill:#FFFFE0,stroke:#CCCC00,color:#000;
```
