# skyrhrg/ranger2 architecture

> Architecture diagram of the GitHub repository skyrhrg/ranger2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skyrhrg/ranger2
- Repository: https://github.com/skyrhrg/ranger2

## Overview

This is a Windows desktop railway-ticketing application. The apparent user workflow is to sign in, find a train, enter passenger and ticket details, then use configured payment, identity, and OTP-related features. The sampled code also shows shared startup/data utilities and railway-site interactions. The README is empty, and much of the source is unsampled, so several product branches and their connections are represented only where the source index or excerpts support them.

Main entry points: [`Freecharge_ByRanger_1.cs`](https://github.com/skyrhrg/ranger2/blob/main/Freecharge_ByRanger_1.cs) (Freecharge flow), [`Class332.cs`](https://github.com/skyrhrg/ranger2/blob/main/Class332.cs) (Data bootstrap), [`Program.cs`](https://github.com/skyrhrg/ranger2/blob/main/Program.cs) (Application startup), [`frmAddTkt.cs`](https://github.com/skyrhrg/ranger2/blob/main/frmAddTkt.cs) (Ticket entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workflow"]
  node_login["Sign-in<br/>[frmLogin_1.cs]"]
  node_app["Application startup<br/>[Program.cs]"]
end

subgraph group_booking["Rail booking"]
  node_ticketform["Ticket entry<br/>[frmAddTkt.cs]"]
  node_trainsearch["Train search<br/>[frmSerch_Train.cs]"]
  node_bookingcontrol["Booking controls<br/>[TCntrl.cs]"]
  node_railservice["Railway services<br/>[Class264.cs]"]
end

subgraph group_accounts["Accounts and payments"]
  node_idcreate["ID creation<br/>[CreateId.cs]"]
  node_paymentflow["Freecharge flow"]
  node_upi["UPI PIN support<br/>[PinUpi.cs]"]
  node_upibalance["UPI balance<br/>[UpiBalnce.cs]"]
  node_banklist["Bank data<br/>[BankList.cs]"]
  node_banksettings["Bank settings<br/>[tabSbiSetting.cs]"]
end

subgraph group_shared["Shared services"]
  node_bootstrap["Data bootstrap<br/>[Class332.cs]"]
  node_sharedlogic["Application utilities<br/>[Class333.cs]"]
  node_validation["Input validation<br/>[Class260.cs]"]
  node_config["Runtime configuration<br/>[GClass48.cs]"]
end

node_user(("User"))
node_railsite["Railway website"]

node_user -->|"signs in"| node_login
node_login -.->|"continues into"| node_app
node_app -->|"initializes"| node_bootstrap
node_app -->|"uses utilities"| node_sharedlogic
node_user -->|"enters ticket"| node_ticketform
node_ticketform -->|"validates fields"| node_validation
node_ticketform -.->|"uses controls"| node_bookingcontrol
node_user -->|"searches trains"| node_trainsearch
node_trainsearch -.->|"uses rail queries"| node_railservice
node_bookingcontrol -.->|"uses rail logic"| node_railservice
node_railservice -->|"sends requests"| node_railsite
node_user -->|"creates account"| node_idcreate
node_idcreate -->|"validates input"| node_validation
node_idcreate -->|"stores account"| node_bootstrap
node_user -->|"configures payment"| node_paymentflow
node_paymentflow -.->|"uses UPI support"| node_upi
node_paymentflow -.->|"uses balance support"| node_upibalance
node_paymentflow -->|"reads bank data"| node_banklist
node_user -->|"sets bank options"| node_banksettings
node_bootstrap -->|"references"| node_validation
node_config -->|"prepares database"| node_bootstrap

click node_login "https://github.com/skyrhrg/ranger2/blob/main/frmLogin_1.cs"
click node_app "https://github.com/skyrhrg/ranger2/blob/main/Program.cs"
click node_ticketform "https://github.com/skyrhrg/ranger2/blob/main/frmAddTkt.cs"
click node_trainsearch "https://github.com/skyrhrg/ranger2/blob/main/frmSerch_Train.cs"
click node_bookingcontrol "https://github.com/skyrhrg/ranger2/blob/main/TCntrl.cs"
click node_railservice "https://github.com/skyrhrg/ranger2/blob/main/Class264.cs"
click node_idcreate "https://github.com/skyrhrg/ranger2/blob/main/CreateId.cs"
click node_paymentflow "https://github.com/skyrhrg/ranger2/blob/main/Freecharge_ByRanger_1.cs"
click node_upi "https://github.com/skyrhrg/ranger2/blob/main/PinUpi.cs"
click node_upibalance "https://github.com/skyrhrg/ranger2/blob/main/UpiBalnce.cs"
click node_banklist "https://github.com/skyrhrg/ranger2/blob/main/BankList.cs"
click node_banksettings "https://github.com/skyrhrg/ranger2/blob/main/tabSbiSetting.cs"
click node_bootstrap "https://github.com/skyrhrg/ranger2/blob/main/Class332.cs"
click node_sharedlogic "https://github.com/skyrhrg/ranger2/blob/main/Class333.cs"
click node_validation "https://github.com/skyrhrg/ranger2/blob/main/Class260.cs"
click node_config "https://github.com/skyrhrg/ranger2/blob/main/GClass48.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_app,node_user toneBlue
class node_ticketform,node_trainsearch,node_bookingcontrol,node_railservice toneAmber
class node_idcreate,node_paymentflow,node_upi,node_upibalance,node_banklist,node_banksettings toneMint
class node_bootstrap,node_sharedlogic,node_validation,node_config toneRose
class node_railsite toneIndigo
```

## Components

### Desktop workflow

- [Sign-in](https://github.com/skyrhrg/ranger2/blob/main/frmLogin_1.cs): `frmLogin_1.cs`
- [Application startup](https://github.com/skyrhrg/ranger2/blob/main/Program.cs): `Program.cs`

### Rail booking

- [Ticket entry](https://github.com/skyrhrg/ranger2/blob/main/frmAddTkt.cs): `frmAddTkt.cs`
- [Train search](https://github.com/skyrhrg/ranger2/blob/main/frmSerch_Train.cs): `frmSerch_Train.cs`
- [Booking controls](https://github.com/skyrhrg/ranger2/blob/main/TCntrl.cs): `TCntrl.cs`
- [Railway services](https://github.com/skyrhrg/ranger2/blob/main/Class264.cs): `Class264.cs`

### Accounts and payments

- [ID creation](https://github.com/skyrhrg/ranger2/blob/main/CreateId.cs): `CreateId.cs`
- [Freecharge flow](https://github.com/skyrhrg/ranger2/blob/main/Freecharge_ByRanger_1.cs): `Freecharge_ByRanger_1.cs`
- [UPI PIN support](https://github.com/skyrhrg/ranger2/blob/main/PinUpi.cs): `PinUpi.cs`
- [UPI balance](https://github.com/skyrhrg/ranger2/blob/main/UpiBalnce.cs): `UpiBalnce.cs`
- [Bank data](https://github.com/skyrhrg/ranger2/blob/main/BankList.cs): `BankList.cs`
- [Bank settings](https://github.com/skyrhrg/ranger2/blob/main/tabSbiSetting.cs): `tabSbiSetting.cs`

### Shared services

- [Data bootstrap](https://github.com/skyrhrg/ranger2/blob/main/Class332.cs): `Class332.cs`
- [Application utilities](https://github.com/skyrhrg/ranger2/blob/main/Class333.cs): `Class333.cs`
- [Input validation](https://github.com/skyrhrg/ranger2/blob/main/Class260.cs): `Class260.cs`
- [Runtime configuration](https://github.com/skyrhrg/ranger2/blob/main/GClass48.cs): `GClass48.cs`

### Other components

- **User**
- **Railway website**

## Connections

- User → Sign-in: signs in
- Sign-in → Application startup: continues into (evidence: `frmLogin_1.cs`)
- Application startup → Data bootstrap: initializes (evidence: `Program.cs`)
- Application startup → Application utilities: uses utilities (evidence: `Program.cs`)
- User → Ticket entry: enters ticket
- Ticket entry → Input validation: validates fields (evidence: `frmAddTkt.cs`)
- Ticket entry → Booking controls: uses controls
- User → Train search: searches trains
- Train search → Railway services: uses rail queries (evidence: `frmSerch_Train.cs`)
- Booking controls → Railway services: uses rail logic (evidence: `TCntrl.cs`)
- Railway services → Railway website: sends requests (evidence: `Class264.cs`)
- User → ID creation: creates account
- ID creation → Input validation: validates input (evidence: `CreateId.cs`)
- ID creation → Data bootstrap: stores account (evidence: `CreateId.cs`)
- User → Freecharge flow: configures payment
- Freecharge flow → UPI PIN support: uses UPI support (evidence: `Freecharge_ByRanger_1.cs`)
- Freecharge flow → UPI balance: uses balance support (evidence: `Freecharge_ByRanger_1.cs`)
- Freecharge flow → Bank data: reads bank data (evidence: `Freecharge_ByRanger_1.cs`)
- User → Bank settings: sets bank options
- Data bootstrap → Input validation: references (evidence: `Class332.cs`)
- Runtime configuration → Data bootstrap: prepares database (evidence: `GClass48.cs`)
