# mehuljain2003/chiru2 architecture

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

- Interactive diagram: https://gitdiagram.com/mehuljain2003/chiru2
- Repository: https://github.com/mehuljain2003/chiru2

## Overview

##### Project type and purpose
- This is a single‐service Python backend application (no separate frontend) packaged for Heroku (docker/heroku.yml/Procfile present) whose job is to fetch and process video information (see get_video_info.py, subscription_data.txt).
- It exposes HTTP endpoints (likely via app.py) and/or can be invoked as a CLI (main.py, p_bar.py).

##### File structure
- Top level:
- Dockerfile, heroku.yml, Procfile: deployment and runtime descriptions
- runtime.txt, requirements.txt: Python runtime & dependencies
- app.py: HTTP entry point
- main.py + helper.py + get_video_info.py + p_bar.py: business logic modules
- config.py: environment/config management
- logger.py: logging abstraction
- subscription_data.txt: lightweight storage for subscriptions
- No separate “frontend” or database directory: this is a single‐service API tool.

##### README
- Only a “Deploy to Heroku” button—no further architectural details provided.

##### Detail
- Every Python module as a sub‐component of the app
- Config.py feeding settings into all modules
- Where and how subscription_data.txt is accessed
- Logging pipeline to Heroku Logs
- Don’t omit even small utilities (p_bar.py) – these are part of your service boundary

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Layer
    subgraph "Heroku Platform / Deployment"
        direction TB
        Dockerfile["Dockerfile"]:::platform
        Procfile["Procfile"]:::platform
        HerokuYML["heroku.yml"]:::platform
        AppJSON["app.json"]:::platform
    end
    subgraph "Runtime Environment"
        direction TB
        WebServerDyno["Web Server Dyno"]:::platform
    end

    %% Application Layer
    subgraph "Python Application"
        direction TB
        HTTPEntry["app.py (HTTP Layer)"]:::internal
        Controller["main.py (Controller)"]:::internal
        VideoService["get_video_info.py (Video Service)"]:::internal
        Helper["helper.py (Utility)"]:::internal
        ProgressBar["p_bar.py (Utility)"]:::internal
        ConfigManager["config.py (Config Manager)"]:::internal
        LoggerModule["logger.py (Logging Module)"]:::internal
    end

    %% Storage and External
    Storage["subscription_data.txt"]:::storage
    ExternalAPI["YouTube Data API"]:::external
    HerokuLogs["Heroku Logs"]:::external

    %% Connections
    Dockerfile -->|deploys on| WebServerDyno
    Procfile -->|defines process| WebServerDyno
    HerokuYML -->|configures apps| WebServerDyno
    AppJSON -->|app manifest| WebServerDyno

    WebServerDyno -->|routes HTTP requests| HTTPEntry
    HTTPEntry -->|invokes| Controller
    Controller -->|calls| VideoService
    VideoService -->|requests metadata| ExternalAPI
    ExternalAPI -->|returns metadata| VideoService
    Controller -->|reads/writes| Storage
    Controller -->|uses| Helper
    Controller -->|uses| ProgressBar
    ConfigManager -->|provides settings| HTTPEntry
    ConfigManager -->|provides settings| Controller
    ConfigManager -->|provides settings| VideoService
    ConfigManager -->|provides settings| Helper
    ConfigManager -->|provides settings| ProgressBar
    ConfigManager -->|provides settings| LoggerModule
    LoggerModule -->|sends logs to| HerokuLogs

    %% Click Events
    click Dockerfile "https://github.com/mehuljain2003/chiru2/tree/main/Dockerfile"
    click Procfile "https://github.com/mehuljain2003/chiru2/tree/main/Procfile"
    click HerokuYML "https://github.com/mehuljain2003/chiru2/blob/main/heroku.yml"
    click AppJSON "https://github.com/mehuljain2003/chiru2/blob/main/app.json"
    click HTTPEntry "https://github.com/mehuljain2003/chiru2/blob/main/app.py"
    click Controller "https://github.com/mehuljain2003/chiru2/blob/main/main.py"
    click VideoService "https://github.com/mehuljain2003/chiru2/blob/main/get_video_info.py"
    click Helper "https://github.com/mehuljain2003/chiru2/blob/main/helper.py"
    click ProgressBar "https://github.com/mehuljain2003/chiru2/blob/main/p_bar.py"
    click ConfigManager "https://github.com/mehuljain2003/chiru2/blob/main/config.py"
    click LoggerModule "https://github.com/mehuljain2003/chiru2/blob/main/logger.py"
    click Storage "https://github.com/mehuljain2003/chiru2/blob/main/subscription_data.txt"

    %% Styles
    classDef internal fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef external fill:#90EE90,stroke:#000,stroke-width:1px
    classDef storage fill:#FFA500,stroke:#000,stroke-width:1px
    classDef platform fill:#D3D3D3,stroke:#000,stroke-width:1px
```
