# chandanc5525/streamlit_demo architecture

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

- Interactive diagram: https://gitdiagram.com/chandanc5525/streamlit_demo
- Repository: https://github.com/chandanc5525/streamlit_demo

## Overview

This is a small Streamlit railway-reservation app. A passenger selects a train, passenger and journey details, and an available seat; the app stores the booking and displays a confirmation. The other main workflows retrieve a booking by PNR and list all bookings. The excerpts show SQLite-backed booking operations and the booking table, but omit some definitions and wiring details; the graph therefore includes only the visible calls and documented UI capabilities.

Main entry points: [`app.py`](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py) (Streamlit app), [`railway.db`](https://github.com/chandanc5525/streamlit_demo/blob/main/railway.db) (Railway database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Reservation workflows"]
  node_app["Streamlit app<br/>[app.py]"]
  node_train_data["Train catalog<br/>[app.py]"]
  node_booking_form["Booking details<br/>[app.py]"]
  node_seat_check["Seat availability<br/>[app.py]"]
  node_booking_write["Save booking<br/>[app.py]"]
  node_confirmation["Ticket confirmation<br/>[app.py]"]
  node_pnr_lookup["PNR retrieval<br/>[app.py]"]
  node_all_bookings["Booking list<br/>[app.py]"]
end

subgraph group_data["Booking data"]
  node_db_helpers["SQLite operations<br/>[app.py]"]
  node_booking_table[("Bookings table<br/>[app.py]")]
  node_sqlite_file[("Railway database<br/>[railway.db]")]
end

node_passenger(("Passenger"))

node_passenger -->|"uses"| node_app
node_app -->|"reads"| node_train_data
node_app -->|"collects"| node_booking_form
node_app -->|"checks seats"| node_seat_check
node_seat_check -->|"queries"| node_db_helpers
node_db_helpers -->|"reads"| node_booking_table
node_booking_table -->|"stored in"| node_sqlite_file
node_app -->|"submits"| node_booking_write
node_booking_write -->|"inserts"| node_db_helpers
node_app -->|"displays"| node_confirmation
node_app -->|"searches"| node_pnr_lookup
node_pnr_lookup -->|"queries by PNR"| node_db_helpers
node_app -->|"loads"| node_all_bookings
node_all_bookings -->|"queries all"| node_db_helpers

click node_app "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_train_data "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_booking_form "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_seat_check "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_booking_write "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_confirmation "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_pnr_lookup "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_all_bookings "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_db_helpers "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_booking_table "https://github.com/chandanc5525/streamlit_demo/blob/main/app.py"
click node_sqlite_file "https://github.com/chandanc5525/streamlit_demo/blob/main/railway.db"

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_app,node_train_data,node_booking_form,node_seat_check,node_booking_write,node_confirmation,node_pnr_lookup,node_all_bookings toneBlue
class node_db_helpers,node_booking_table,node_sqlite_file toneAmber
class node_passenger toneIndigo
```

## Components

### Reservation workflows

- [Streamlit app](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Train catalog](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Booking details](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Seat availability](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Save booking](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Ticket confirmation](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [PNR retrieval](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Booking list](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`

### Booking data

- [SQLite operations](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Bookings table](https://github.com/chandanc5525/streamlit_demo/blob/main/app.py): `app.py`
- [Railway database](https://github.com/chandanc5525/streamlit_demo/blob/main/railway.db): `railway.db`

### Other components

- **Passenger**

## Connections

- Passenger → Streamlit app: uses
- Streamlit app → Train catalog: reads
- Streamlit app → Booking details: collects
- Streamlit app → Seat availability: checks seats
- Seat availability → SQLite operations: queries
- SQLite operations → Bookings table: reads
- Bookings table → Railway database: stored in
- Streamlit app → Save booking: submits
- Save booking → SQLite operations: inserts
- Streamlit app → Ticket confirmation: displays
- Streamlit app → PNR retrieval: searches
- PNR retrieval → SQLite operations: queries by PNR
- Streamlit app → Booking list: loads
- Booking list → SQLite operations: queries all
