# sanchita-hasure21/streamlit_demo1 architecture

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

- Interactive diagram: https://gitdiagram.com/sanchita-hasure21/streamlit_demo1
- Repository: https://github.com/sanchita-hasure21/streamlit_demo1

## Overview

This is a Streamlit railway-reservation demo. A passenger can enter journey and passenger details to book seats and receive a PNR, look up a ticket by PNR, or view booking statistics. The sampled app.py shows database-backed booking records, seat-availability logic, ticket retrieval, and aggregate counts; omitted source limits certainty about some internal call wiring. The tree includes index.html, but the excerpts do not establish its role.

Main entry points: [`app.py`](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py) (Reservation pages), [`railway.db`](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/railway.db) (Railway database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Streamlit interface"]
  node_interface["Reservation pages<br/>[app.py]"]
end

subgraph group_booking["Reservation workflow"]
  node_seat_logic["Seat availability<br/>[app.py]"]
  node_booking_logic["Create booking<br/>[app.py]"]
  node_ticket_lookup["PNR lookup<br/>[app.py]"]
  node_booking_stats["Booking statistics<br/>[app.py]"]
end

subgraph group_records["Booking records"]
  node_database[("Railway database<br/>[railway.db]")]
end

node_passenger(("Passenger"))

node_passenger -->|"uses"| node_interface
node_interface -->|"checks seats"| node_seat_logic
node_interface -->|"submits booking"| node_booking_logic
node_booking_logic -->|"writes booking"| node_database
node_interface -->|"searches PNR"| node_ticket_lookup
node_ticket_lookup -->|"reads booking"| node_database
node_interface -->|"requests totals"| node_booking_stats
node_booking_stats -->|"reads aggregates"| node_database

click node_interface "https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py"
click node_seat_logic "https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py"
click node_booking_logic "https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py"
click node_ticket_lookup "https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py"
click node_booking_stats "https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py"
click node_database "https://github.com/sanchita-hasure21/streamlit_demo1/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_interface toneBlue
class node_seat_logic,node_booking_logic,node_ticket_lookup,node_booking_stats toneAmber
class node_database toneMint
class node_passenger toneIndigo
```

## Components

### Streamlit interface

- [Reservation pages](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py): `app.py`

### Reservation workflow

- [Seat availability](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py): `app.py`
- [Create booking](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py): `app.py`
- [PNR lookup](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py): `app.py`
- [Booking statistics](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/app.py): `app.py`

### Booking records

- [Railway database](https://github.com/sanchita-hasure21/streamlit_demo1/blob/main/railway.db): `railway.db`

### Other components

- **Passenger**

## Connections

- Passenger → Reservation pages: uses
- Reservation pages → Seat availability: checks seats
- Reservation pages → Create booking: submits booking
- Create booking → Railway database: writes booking
- Reservation pages → PNR lookup: searches PNR
- PNR lookup → Railway database: reads booking
- Reservation pages → Booking statistics: requests totals
- Booking statistics → Railway database: reads aggregates
