# kakinachristine/hitsongpredictor architecture

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

- Interactive diagram: https://gitdiagram.com/kakinachristine/hitsongpredictor
- Repository: https://github.com/kakinachristine/hitsongpredictor

## Overview

This repository combines a Flask-based Kenyan/Nigerian song hit predictor with exploratory and presentation-oriented music analytics. The primary web workflow accepts a track ID, retrieves audio features, scores them against thresholds, and displays a hit classification. app.py and app1.py are alternative implementations; MAIN.py is another, less clearly sampled application path. The notebooks and BI artifacts indicate additional analytics work. Source excerpts do not establish how those artifacts are run or connected, so those relationships are omitted; the bundled Bootstrap files are treated as UI dependencies.

Main entry points: [`app1.py`](https://github.com/kakinachristine/hitsongpredictor/blob/master/app1.py) (SQLite predictor), [`app.py`](https://github.com/kakinachristine/hitsongpredictor/blob/master/app.py) (In-memory predictor), [`templates`](https://github.com/kakinachristine/hitsongpredictor/tree/master/templates) (Prediction results), [`static/bootstrap/js/jquery-3.4.0.js`](https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/jquery-3.4.0.js) (jQuery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Prediction web apps"]
  node_app_py["In-memory predictor<br/>[app.py]"]
  node_app1_py["SQLite predictor<br/>[app1.py]"]
  node_main_py["Legacy predictor<br/>[MAIN.py]"]
  node_feature_lookup["Feature lookup<br/>[app.py]"]
  node_scoring["Hit scoring<br/>[app1.py]"]
  node_result_pages["Prediction results"]
  node_feedback["Feedback page<br/>[feedback.html]"]
end

subgraph group_data["Track data and storage"]
  node_track_data["Track datasets<br/>[Kenya.csv]"]
  node_naija_data["Nigeria dataset<br/>[Naija.csv]"]
  node_songs_db[("Songs database<br/>[songs.db]")]
  node_track_db[("Track database<br/>[Track.db]")]
end

subgraph group_analytics["Music analytics"]
  node_prediction_notebook["Prediction analysis"]
  node_kenya_analysis["Kenya data analysis<br/>[Kenya_DF.ipynb]"]
  node_naija_analysis["Nigeria data analysis<br/>[Naija_DF.ipynb]"]
  node_bi_dashboard["BI dashboard"]
  node_music_report["Analytics report<br/>[MusicAnalytics.pdf]"]
end

subgraph group_ui["Browser interface"]
  node_bootstrap_bundle["Bootstrap bundle"]
  node_bootstrap_js["Bootstrap components<br/>[bootstrap.js]"]
  node_jquery["jQuery<br/>[jquery-3.4.0.js]"]
end

node_visitor(("User"))

node_visitor -->|"submits track"| node_app_py
node_app_py -->|"looks up features"| node_feature_lookup
node_feature_lookup -->|"queries loaded data"| node_track_data
node_app_py -->|"scores features"| node_scoring
node_app_py -->|"renders result"| node_result_pages
node_visitor -->|"submits track"| node_app1_py
node_app1_py -->|"writes track tables"| node_songs_db
node_app1_py -->|"scores features"| node_scoring
node_app1_py -->|"renders result"| node_result_pages
node_app1_py -->|"renders page"| node_feedback
node_main_py -->|"renders classification"| node_result_pages
node_bootstrap_bundle -->|"requires"| node_jquery
node_bootstrap_js -->|"requires"| node_jquery

click node_app_py "https://github.com/kakinachristine/hitsongpredictor/blob/master/app.py"
click node_app1_py "https://github.com/kakinachristine/hitsongpredictor/blob/master/app1.py"
click node_main_py "https://github.com/kakinachristine/hitsongpredictor/blob/master/MAIN.py"
click node_feature_lookup "https://github.com/kakinachristine/hitsongpredictor/blob/master/app.py"
click node_scoring "https://github.com/kakinachristine/hitsongpredictor/blob/master/app1.py"
click node_result_pages "https://github.com/kakinachristine/hitsongpredictor/tree/master/templates"
click node_feedback "https://github.com/kakinachristine/hitsongpredictor/blob/master/templates/feedback.html"
click node_track_data "https://github.com/kakinachristine/hitsongpredictor/blob/master/Kenya.csv"
click node_naija_data "https://github.com/kakinachristine/hitsongpredictor/blob/master/Naija.csv"
click node_songs_db "https://github.com/kakinachristine/hitsongpredictor/blob/master/songs.db"
click node_track_db "https://github.com/kakinachristine/hitsongpredictor/blob/master/Track.db"
click node_prediction_notebook "https://github.com/kakinachristine/hitsongpredictor/blob/master/KenyanSongPredictionML.ipynb"
click node_kenya_analysis "https://github.com/kakinachristine/hitsongpredictor/blob/master/Kenya_DF.ipynb"
click node_naija_analysis "https://github.com/kakinachristine/hitsongpredictor/blob/master/Naija_DF.ipynb"
click node_bi_dashboard "https://github.com/kakinachristine/hitsongpredictor/blob/master/presentation/music_analytics/MusicAnalyticsBI.pbix"
click node_music_report "https://github.com/kakinachristine/hitsongpredictor/blob/master/presentation/MusicAnalytics.pdf"
click node_bootstrap_bundle "https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/bootstrap.bundle.js"
click node_bootstrap_js "https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/bootstrap.js"
click node_jquery "https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/jquery-3.4.0.js"

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_app_py,node_app1_py,node_main_py,node_feature_lookup,node_scoring,node_result_pages,node_feedback,node_visitor toneBlue
class node_track_data,node_naija_data,node_songs_db,node_track_db toneAmber
class node_prediction_notebook,node_kenya_analysis,node_naija_analysis,node_bi_dashboard,node_music_report toneMint
class node_bootstrap_bundle,node_bootstrap_js,node_jquery toneRose
```

## Components

### Prediction web apps

- [In-memory predictor](https://github.com/kakinachristine/hitsongpredictor/blob/master/app.py): `app.py`
- [SQLite predictor](https://github.com/kakinachristine/hitsongpredictor/blob/master/app1.py): `app1.py`
- [Legacy predictor](https://github.com/kakinachristine/hitsongpredictor/blob/master/MAIN.py): `MAIN.py`
- [Feature lookup](https://github.com/kakinachristine/hitsongpredictor/blob/master/app.py): `app.py`
- [Hit scoring](https://github.com/kakinachristine/hitsongpredictor/blob/master/app1.py): `app1.py`
- [Prediction results](https://github.com/kakinachristine/hitsongpredictor/tree/master/templates): `templates`
- [Feedback page](https://github.com/kakinachristine/hitsongpredictor/blob/master/templates/feedback.html): `templates/feedback.html`

### Track data and storage

- [Track datasets](https://github.com/kakinachristine/hitsongpredictor/blob/master/Kenya.csv): `Kenya.csv`
- [Nigeria dataset](https://github.com/kakinachristine/hitsongpredictor/blob/master/Naija.csv): `Naija.csv`
- [Songs database](https://github.com/kakinachristine/hitsongpredictor/blob/master/songs.db): `songs.db`
- [Track database](https://github.com/kakinachristine/hitsongpredictor/blob/master/Track.db): `Track.db`

### Music analytics

- [Prediction analysis](https://github.com/kakinachristine/hitsongpredictor/blob/master/KenyanSongPredictionML.ipynb): `KenyanSongPredictionML.ipynb`
- [Kenya data analysis](https://github.com/kakinachristine/hitsongpredictor/blob/master/Kenya_DF.ipynb): `Kenya_DF.ipynb`
- [Nigeria data analysis](https://github.com/kakinachristine/hitsongpredictor/blob/master/Naija_DF.ipynb): `Naija_DF.ipynb`
- [BI dashboard](https://github.com/kakinachristine/hitsongpredictor/blob/master/presentation/music_analytics/MusicAnalyticsBI.pbix): `presentation/music_analytics/MusicAnalyticsBI.pbix`
- [Analytics report](https://github.com/kakinachristine/hitsongpredictor/blob/master/presentation/MusicAnalytics.pdf): `presentation/MusicAnalytics.pdf`

### Browser interface

- [Bootstrap bundle](https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/bootstrap.bundle.js): `static/bootstrap/js/bootstrap.bundle.js`
- [Bootstrap components](https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/bootstrap.js): `static/bootstrap/js/bootstrap.js`
- [jQuery](https://github.com/kakinachristine/hitsongpredictor/blob/master/static/bootstrap/js/jquery-3.4.0.js): `static/bootstrap/js/jquery-3.4.0.js`

### Other components

- **User**

## Connections

- User → In-memory predictor: submits track (evidence: `app.py`)
- In-memory predictor → Feature lookup: looks up features (evidence: `app.py`)
- Feature lookup → Track datasets: queries loaded data (evidence: `app.py`)
- In-memory predictor → Hit scoring: scores features (evidence: `app.py`)
- In-memory predictor → Prediction results: renders result (evidence: `app.py`)
- User → SQLite predictor: submits track (evidence: `app1.py`)
- SQLite predictor → Songs database: writes track tables (evidence: `app1.py`)
- SQLite predictor → Hit scoring: scores features (evidence: `app1.py`)
- SQLite predictor → Prediction results: renders result (evidence: `app1.py`)
- SQLite predictor → Feedback page: renders page (evidence: `app1.py`)
- Legacy predictor → Prediction results: renders classification (evidence: `MAIN.py`)
- Bootstrap bundle → jQuery: requires (evidence: `static/bootstrap/js/bootstrap.bundle.js`)
- Bootstrap components → jQuery: requires (evidence: `static/bootstrap/js/bootstrap.js`)
