# amghalcyon/mrt-information-system architecture

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

- Interactive diagram: https://gitdiagram.com/amghalcyon/mrt-information-system
- Repository: https://github.com/amghalcyon/mrt-information-system

## Overview

MRT Information System is a terminal-based Singapore rail journey planner. Its principal workflow loads station and fare data, resolves the user's start and destination, computes a route, then reports journey details and optionally draws the path. The README documents separate distance- and time-optimising searches, fare and timetable queries, reachability, and interchange reporting. The implementation is concentrated in one Python file; these nodes represent its distinct responsibilities, not separate modules. Some relationships rely on the README because the source excerpt is partial.

Main entry points: [`source/dec_mini_project.py`](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py) (Interactive menu), [`data-files/raw-data/MRT.txt`](https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/MRT.txt) (Station data), [`data-files/raw-data/FareStructure.txt`](https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/FareStructure.txt) (Fare tables)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_menu["Interactive menu"]
  node_station_lookup["Station lookup"]
end

subgraph group_network["Network and routing"]
  node_station_data["Station data<br/>[MRT.txt]"]
  node_data_loader["Data loading"]
  node_graph_builder["Graph builder"]
  node_distance_search["Distance search"]
  node_time_search["Time search"]
end

subgraph group_analysis["Journey analysis"]
  node_fare_data["Fare tables<br/>[FareStructure.txt]"]
  node_route_summary["Route summary"]
  node_travel_time["Travel time"]
  node_fare_lookup["Fare lookup"]
  node_last_train["Last-train check"]
  node_first_train["First-train timing"]
  node_reachability["Time reachability"]
  node_interchanges["Interchange report"]
end

subgraph group_display["Route display"]
  node_path_layout["Path layout"]
  node_turtle_view["Turtle renderer"]
end

node_traveller(("Traveller"))

node_traveller -->|"chooses option"| node_menu
node_menu -->|"loads data"| node_data_loader
node_data_loader -->|"reads stations"| node_station_data
node_data_loader -->|"reads fares"| node_fare_data
node_menu -->|"resolves stations"| node_station_lookup
node_station_lookup -->|"returns matches"| node_menu
node_data_loader -->|"provides stations"| node_graph_builder
node_menu -->|"requests route"| node_distance_search
node_menu -->|"requests time route"| node_time_search
node_menu -->|"requests fare"| node_fare_lookup
node_menu -->|"checks feasibility"| node_last_train
node_menu -->|"requests timing"| node_first_train
node_menu -->|"requests reachable stops"| node_reachability
node_menu -->|"requests changes"| node_interchanges
node_distance_search -->|"searches graph"| node_graph_builder
node_time_search -->|"searches graph"| node_graph_builder
node_menu -->|"reports route"| node_route_summary
node_route_summary -->|"computes duration"| node_travel_time
node_route_summary -->|"draws route"| node_path_layout
node_path_layout -->|"renders path"| node_turtle_view

click node_menu "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_station_data "https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/MRT.txt"
click node_fare_data "https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/FareStructure.txt"
click node_data_loader "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_station_lookup "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_graph_builder "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_distance_search "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_time_search "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_route_summary "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_travel_time "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_fare_lookup "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_last_train "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_first_train "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_reachability "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_interchanges "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_path_layout "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"
click node_turtle_view "https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py"

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_menu,node_station_lookup toneBlue
class node_station_data,node_data_loader,node_graph_builder,node_distance_search,node_time_search toneAmber
class node_fare_data,node_route_summary,node_travel_time,node_fare_lookup,node_last_train,node_first_train,node_reachability,node_interchanges toneMint
class node_path_layout,node_turtle_view toneRose
class node_traveller toneIndigo
```

## Components

### User interaction

- [Interactive menu](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Station lookup](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`

### Network and routing

- [Station data](https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/MRT.txt): `data-files/raw-data/MRT.txt`
- [Data loading](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Graph builder](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Distance search](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Time search](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`

### Journey analysis

- [Fare tables](https://github.com/amghalcyon/mrt-information-system/blob/main/data-files/raw-data/FareStructure.txt): `data-files/raw-data/FareStructure.txt`
- [Route summary](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Travel time](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Fare lookup](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Last-train check](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [First-train timing](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Time reachability](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Interchange report](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`

### Route display

- [Path layout](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`
- [Turtle renderer](https://github.com/amghalcyon/mrt-information-system/blob/main/source/dec_mini_project.py): `source/dec_mini_project.py`

### Other components

- **Traveller**

## Connections

- Traveller → Interactive menu: chooses option (evidence: `README.md`)
- Interactive menu → Data loading: loads data (evidence: `source/dec_mini_project.py`)
- Data loading → Station data: reads stations (evidence: `README.md`)
- Data loading → Fare tables: reads fares (evidence: `README.md`)
- Interactive menu → Station lookup: resolves stations (evidence: `README.md`)
- Station lookup → Interactive menu: returns matches (evidence: `source/dec_mini_project.py`)
- Data loading → Graph builder: provides stations (evidence: `README.md`)
- Interactive menu → Distance search: requests route (evidence: `README.md`)
- Interactive menu → Time search: requests time route (evidence: `source/dec_mini_project.py`)
- Interactive menu → Fare lookup: requests fare (evidence: `README.md`)
- Interactive menu → Last-train check: checks feasibility (evidence: `README.md`)
- Interactive menu → First-train timing: requests timing (evidence: `README.md`)
- Interactive menu → Time reachability: requests reachable stops (evidence: `README.md`)
- Interactive menu → Interchange report: requests changes (evidence: `source/dec_mini_project.py`)
- Distance search → Graph builder: searches graph (evidence: `README.md`)
- Time search → Graph builder: searches graph (evidence: `README.md`)
- Interactive menu → Route summary: reports route (evidence: `source/dec_mini_project.py`)
- Route summary → Travel time: computes duration (evidence: `source/dec_mini_project.py`)
- Route summary → Path layout: draws route (evidence: `source/dec_mini_project.py`)
- Path layout → Turtle renderer: renders path (evidence: `README.md`)
