# babuganesh2000/tmobile_bill_analysis architecture

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

- Interactive diagram: https://gitdiagram.com/babuganesh2000/tmobile_bill_analysis
- Repository: https://github.com/babuganesh2000/tmobile_bill_analysis

## Overview

This is a Streamlit dashboard for exploring T-Mobile bill history. Users authenticate, upload PDF bills, and view spending, per-line, per-person, usage, and savings analyses; administrators also manage access and phone/account mappings. The main internal layer is the shared PDF parser and DuckDB loader. The app is largely monolithic, so its documented dashboard capabilities are represented as components in app.py rather than separate modules. Relationships for unsampled app sections rely on README descriptions, not inspected implementation.

Main entry points: [`app.py`](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py) (Streamlit dashboard), [`parser.py`](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/parser.py) (PDF extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_ingestion["Bill ingestion"]
  node_bill_upload["Bill uploads<br/>[app.py]"]
  node_pdf_parser["PDF extraction<br/>[parser.py]"]
  node_bill_storage[("Bill database<br/>[parser.py]")]
end

subgraph group_analytics["Analytics"]
  node_account_overview["Account overview<br/>[app.py]"]
  node_monthly_trends["Monthly trends<br/>[app.py]"]
  node_bill_splitup["Bill splitup<br/>[app.py]"]
  node_line_analysis["Line analysis<br/>[app.py]"]
  node_line_costs["Line costs<br/>[app.py]"]
  node_usage_details["Usage details<br/>[app.py]"]
  node_person_view["Person view<br/>[app.py]"]
  node_savings_reports["Savings reports<br/>[app.py]"]
  node_raw_data["SQL explorer<br/>[app.py]"]
end

subgraph group_administration["Administration"]
  node_user_management["User management<br/>[app.py]"]
  node_phone_directory["Phone directory<br/>[app.py]"]
end

node_users(("Dashboard users"))
node_google_oauth(("Google OAuth"))

node_users -->|"use"| node_dashboard
node_google_oauth -->|"authenticates"| node_dashboard
node_dashboard -->|"offers"| node_bill_upload
node_bill_upload -->|"parses PDFs"| node_pdf_parser
node_dashboard -->|"imports"| node_pdf_parser
node_pdf_parser -->|"loads records"| node_bill_storage
node_dashboard -->|"reads bill data"| node_bill_storage
node_dashboard -->|"shows KPIs"| node_account_overview
node_dashboard -->|"shows trends"| node_monthly_trends
node_dashboard -->|"shows breakdown"| node_bill_splitup
node_dashboard -->|"analyzes lines"| node_line_analysis
node_dashboard -->|"shows costs"| node_line_costs
node_dashboard -->|"shows usage"| node_usage_details
node_dashboard -->|"aggregates costs"| node_person_view
node_dashboard -->|"tracks discounts"| node_savings_reports
node_dashboard -->|"runs SQL"| node_raw_data
node_dashboard -->|"manages access"| node_user_management
node_dashboard -->|"maps numbers"| node_phone_directory

click node_dashboard "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_bill_upload "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_pdf_parser "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/parser.py"
click node_bill_storage "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/parser.py"
click node_account_overview "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_monthly_trends "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_bill_splitup "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_line_analysis "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_line_costs "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_usage_details "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_person_view "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_savings_reports "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_raw_data "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_user_management "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py"
click node_phone_directory "https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.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_dashboard,node_users toneBlue
class node_bill_upload,node_pdf_parser,node_bill_storage toneAmber
class node_account_overview,node_monthly_trends,node_bill_splitup,node_line_analysis,node_line_costs,node_usage_details,node_person_view,node_savings_reports,node_raw_data toneMint
class node_user_management,node_phone_directory toneRose
class node_google_oauth toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`

### Bill ingestion

- [Bill uploads](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [PDF extraction](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/parser.py): `parser.py`
- [Bill database](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/parser.py): `parser.py`

### Analytics

- [Account overview](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Monthly trends](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Bill splitup](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Line analysis](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Line costs](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Usage details](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Person view](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Savings reports](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [SQL explorer](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`

### Administration

- [User management](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`
- [Phone directory](https://github.com/babuganesh2000/tmobile_bill_analysis/blob/master/app.py): `app.py`

### Other components

- **Dashboard users**
- **Google OAuth**

## Connections

- Dashboard users → Streamlit dashboard: use (evidence: `README.md`)
- Google OAuth → Streamlit dashboard: authenticates (evidence: `README.md`)
- Streamlit dashboard → Bill uploads: offers (evidence: `README.md`)
- Bill uploads → PDF extraction: parses PDFs (evidence: `README.md`)
- Streamlit dashboard → PDF extraction: imports (evidence: `app.py`)
- PDF extraction → Bill database: loads records (evidence: `parser.py`)
- Streamlit dashboard → Bill database: reads bill data (evidence: `README.md`)
- Streamlit dashboard → Account overview: shows KPIs (evidence: `README.md`)
- Streamlit dashboard → Monthly trends: shows trends (evidence: `README.md`)
- Streamlit dashboard → Bill splitup: shows breakdown (evidence: `README.md`)
- Streamlit dashboard → Line analysis: analyzes lines (evidence: `README.md`)
- Streamlit dashboard → Line costs: shows costs (evidence: `README.md`)
- Streamlit dashboard → Usage details: shows usage (evidence: `README.md`)
- Streamlit dashboard → Person view: aggregates costs (evidence: `README.md`)
- Streamlit dashboard → Savings reports: tracks discounts (evidence: `README.md`)
- Streamlit dashboard → SQL explorer: runs SQL (evidence: `README.md`)
- Streamlit dashboard → User management: manages access (evidence: `README.md`)
- Streamlit dashboard → Phone directory: maps numbers (evidence: `README.md`)
