How iamhuzaifasabahuddin/hexz_automations works
Project Type and Purpose
• This is a Python-based data-integration and reporting tool that combines a lightweight “frontend” (Streamlit dashboard), a backend integration layer (Notion API, Gmail SMTP), and a scheduled automation (GitHub Actions).
• Its purpose is to let you log, view, analyze, and automatically email monthly summaries of ride/commute data, all orchestrated via Python scripts.
Key Components in the File Tree
• Budget.py → Likely the Streamlit app entrypoint for interactive charts and dashboards.
• Notion.py → Notion API client wrapper to read/write ride data in a Notion database.
• send_summary.py → Script that compiles metrics and sends the monthly summary email via Gmail SMTP.
• .github/workflows/monthly-summary.yml
→ GitHub Actions workflow that schedules and invokes send_summary.py on a monthly basis.
• requirements.txt, .gitignore, LICENSE, README.md
→ Configuration, dependency, and documentation files.
Main Architectural Components
a. Streamlit Dashboard (Budget.py)
• Interactive frontend served by Streamlit on a local or hosted server.
• Pulls ride data from Notion via Notion.py.
b. Notion Database (External Service)
• Stores raw ride/commute records.
• Exposed via the Notion API.
c. Email Service (External – Gmail SMTP)
• Receives summary payloads from send_summary.py.
• Sends monthly summary emails.
d. Automation Orchestrator (GitHub Actions)
• Triggers send_summary.py on a cron schedule (monthly).
• Runs in GitHub’s hosted runners.
e. Data Processing Layer (send_summary.py + Notion.py)
• Aggregates ride data, formats summary, and issues SMTP email calls.
Relationships and Data Flows
• User ↔ Streamlit App: HTTP client interaction for dashboards.
• Streamlit App → Notion API: Reads/writes ride records.
• GitHub Actions → send_summary.py: Scheduled execution.
• send_summary.py → Notion API: Fetches data for summaries.
• send_summary.py → Gmail SMTP: Pushes email content.
• Notion Database and Gmail SMTP sit outside your code and should be shown as “External Systems.”
Architectural Patterns and Design Principles
• Separation of Concerns:
• Budget.py for UI,
• Notion.py for data access,
• send_summary.py for reporting and notification.
• Modular Components: Each Python file encapsulates a distinct responsibility.
• “Serverless” Scheduler: Use of GitHub Actions to avoid self-hosting a cron job.
• Third-party Integration Pattern: Notion API client and SMTP as pluggable external services.