# neptune-glitch/the-hackher-squad architecture

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

- Interactive diagram: https://gitdiagram.com/neptune-glitch/the-hackher-squad
- Repository: https://github.com/neptune-glitch/the-hackher-squad

## Overview

Helix is a Flask-based income-protection platform for gig workers. A worker registers, selects a weekly plan, and views local disruption conditions and predictive guidance; a detected disruption can lead to an automatically triggered claim and simulated UPI payout. The app also provides fraud and risk analysis, dynamic premiums, and administrative financial reporting. The excerpts show a monolithic implementation in app.py; several feature links and integrations are therefore supported only by README documentation.

Main entry points: [`app.py`](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py) (Flask App), [`gigshield.db`](https://github.com/neptune-glitch/the-hackher-squad/blob/main/gigshield.db) (SQLite Database), [`models/risk.pkl`](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/risk.pkl) (Risk Model), [`models/fraud.pkl`](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/fraud.pkl) (Fraud Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_worker_flow["Worker Protection"]
  node_flask_app["Flask App<br/>[app.py]"]
  node_registration["Worker Registration<br/>[app.py]"]
  node_plans["Weekly Plans<br/>[app.py]"]
  node_claims["Disruption Claims<br/>[app.py]"]
  node_payout["Simulated Payout<br/>[app.py]"]
end

subgraph group_intelligence["Risk Intelligence"]
  node_weather["Weather &amp; AQI<br/>[app.py]"]
  node_weather_api["OpenWeatherMap"]
  node_risk["Risk Profiling<br/>[app.py]"]
  node_premium["Premium Calculation<br/>[app.py]"]
  node_fraud["Fraud Analysis<br/>[app.py]"]
  node_prediction["Disruption Forecast<br/>[app.py]"]
  node_risk_model["Risk Model<br/>[risk.pkl]"]
  node_fraud_model["Fraud Model<br/>[fraud.pkl]"]
  node_login_model["Login Model<br/>[login.pkl]"]
  node_premium_model["Premium Model<br/>[premium.pkl]"]
end

subgraph group_operations["Operations"]
  node_database[("SQLite Database<br/>[gigshield.db]")]
  node_admin["Admin Reporting<br/>[app.py]"]
end

subgraph group_interfaces["Web Interface"]
  node_worker_ui["Worker Pages<br/>[dashboard.html]"]
  node_claims_ui["Claims Pages<br/>[claims.html]"]
  node_payout_ui["Payout Pages"]
  node_admin_ui["Admin Pages<br/>[admin.html]"]
  node_registration_ui["Registration Page<br/>[register.html]"]
end

node_worker(("Gig Worker"))

node_worker -->|"uses platform"| node_flask_app
node_flask_app -.->|"routes registration"| node_registration
node_registration -->|"stores worker"| node_database
node_worker -->|"chooses plan"| node_plans
node_flask_app -->|"gets conditions"| node_weather
node_weather -->|"requests weather"| node_weather_api
node_flask_app -->|"calculates risk"| node_risk
node_flask_app -->|"calculates premium"| node_premium
node_flask_app -->|"checks claims"| node_fraud
node_flask_app -->|"forecasts disruption"| node_prediction
node_risk -.->|"uses model"| node_risk_model
node_fraud -.->|"uses model"| node_fraud_model
node_flask_app -.->|"uses model"| node_login_model
node_premium -.->|"uses model"| node_premium_model
node_flask_app -->|"checks disruption"| node_claims
node_claims -->|"reads history"| node_database
node_claims -->|"triggers payout"| node_payout
node_payout -->|"records claim"| node_database
node_payout -.->|"credits via UPI"| node_worker
node_flask_app -->|"serves reporting"| node_admin
node_admin -->|"reads totals"| node_database
node_flask_app -.->|"renders dashboard"| node_worker_ui
node_flask_app -->|"renders claims"| node_claims_ui
node_flask_app -->|"renders payout"| node_payout_ui
node_flask_app -->|"renders report"| node_admin_ui
node_flask_app -.->|"renders registration"| node_registration_ui

click node_flask_app "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_registration "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_plans "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_claims "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_payout "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_weather "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_risk "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_premium "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_fraud "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_prediction "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_risk_model "https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/risk.pkl"
click node_fraud_model "https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/fraud.pkl"
click node_login_model "https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/login.pkl"
click node_premium_model "https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/premium.pkl"
click node_database "https://github.com/neptune-glitch/the-hackher-squad/blob/main/gigshield.db"
click node_admin "https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py"
click node_worker_ui "https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/dashboard.html"
click node_claims_ui "https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/claims.html"
click node_payout_ui "https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/payout_success.html"
click node_admin_ui "https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/admin.html"
click node_registration_ui "https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/register.html"

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_flask_app,node_registration,node_plans,node_claims,node_payout toneBlue
class node_weather,node_weather_api,node_risk,node_premium,node_fraud,node_prediction,node_risk_model,node_fraud_model,node_login_model,node_premium_model toneAmber
class node_database,node_admin toneMint
class node_worker_ui,node_claims_ui,node_payout_ui,node_admin_ui,node_registration_ui,node_worker toneRose
```

## Components

### Worker Protection

- [Flask App](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Worker Registration](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Weekly Plans](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Disruption Claims](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Simulated Payout](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`

### Risk Intelligence

- [Weather & AQI](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- **OpenWeatherMap**
- [Risk Profiling](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Premium Calculation](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Fraud Analysis](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Disruption Forecast](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`
- [Risk Model](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/risk.pkl): `models/risk.pkl`
- [Fraud Model](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/fraud.pkl): `models/fraud.pkl`
- [Login Model](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/login.pkl): `models/login.pkl`
- [Premium Model](https://github.com/neptune-glitch/the-hackher-squad/blob/main/models/premium.pkl): `models/premium.pkl`

### Operations

- [SQLite Database](https://github.com/neptune-glitch/the-hackher-squad/blob/main/gigshield.db): `gigshield.db`
- [Admin Reporting](https://github.com/neptune-glitch/the-hackher-squad/blob/main/app.py): `app.py`

### Web Interface

- [Worker Pages](https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Claims Pages](https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/claims.html): `templates/claims.html`
- [Payout Pages](https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/payout_success.html): `templates/payout_success.html`
- [Admin Pages](https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/admin.html): `templates/admin.html`
- [Registration Page](https://github.com/neptune-glitch/the-hackher-squad/blob/main/templates/register.html): `templates/register.html`

### Other components

- **Gig Worker**

## Connections

- Gig Worker → Flask App: uses platform (evidence: `README.md`)
- Flask App → Worker Registration: routes registration (evidence: `app.py`)
- Worker Registration → SQLite Database: stores worker (evidence: `app.py`)
- Gig Worker → Weekly Plans: chooses plan (evidence: `README.md`)
- Flask App → Weather & AQI: gets conditions (evidence: `app.py`)
- Weather & AQI → OpenWeatherMap: requests weather (evidence: `app.py`)
- Flask App → Risk Profiling: calculates risk (evidence: `app.py`)
- Flask App → Premium Calculation: calculates premium (evidence: `app.py`)
- Flask App → Fraud Analysis: checks claims (evidence: `app.py`)
- Flask App → Disruption Forecast: forecasts disruption (evidence: `README.md`)
- Risk Profiling → Risk Model: uses model
- Fraud Analysis → Fraud Model: uses model
- Flask App → Login Model: uses model
- Premium Calculation → Premium Model: uses model
- Flask App → Disruption Claims: checks disruption (evidence: `app.py`)
- Disruption Claims → SQLite Database: reads history (evidence: `app.py`)
- Disruption Claims → Simulated Payout: triggers payout (evidence: `README.md`)
- Simulated Payout → SQLite Database: records claim (evidence: `app.py`)
- Simulated Payout → Gig Worker: credits via UPI (evidence: `README.md`)
- Flask App → Admin Reporting: serves reporting (evidence: `app.py`)
- Admin Reporting → SQLite Database: reads totals (evidence: `app.py`)
- Flask App → Worker Pages: renders dashboard
- Flask App → Claims Pages: renders claims (evidence: `app.py`)
- Flask App → Payout Pages: renders payout (evidence: `app.py`)
- Flask App → Admin Pages: renders report (evidence: `app.py`)
- Flask App → Registration Page: renders registration
