# danielpopoola/statify architecture

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

- Interactive diagram: https://gitdiagram.com/danielpopoola/statify
- Repository: https://github.com/danielpopoola/statify

## Overview

##### Project type and purpose
- This is a full-stack web application (Django + static JS components) that displays a Spotify user’s music summary (tracks, artists, etc.) via OAuth.
- The backend (Python/Django) handles authentication, data fetching, persistence, and template rendering. The frontend is a collection of React-style components shipped as static JS/CSS.

##### File structure
- Top-level:
– manage.py, Pipfile/Pipfile.lock/requirements.txt → Python/Django environment
– package.json, .babelrc → Node/Babel build for client-side JS
– vercel.json → deployment config (likely for static hosting or serverless functions)
- spotify_dashboard/ → Django project settings, URLs, ASGI/WSGI entry points
- spotify_oauth/ → Django app: models, migrations, views, URL routes, templates, static assets
- staticfiles/ → collected static assets (CSS/JS) ready for serving in production
- README.md describes the goal: show a Spotify user's music summary.

##### README for architecture clues
- Very high level – no explicit architectural notes.
- The project name “Statify” implies a dashboard; features correspond to playlists, top artists/tracks, theming.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User & Browser
    subgraph "Client Side"
        direction TB
        Browser["User Browser"]:::frontend
        Browser -->|"HTTP GET /dashboard"| URLRouter
        Browser -->|"Loads CSS/JS Bundles"| StaticFiles
    end

    %% Frontend Static Assets
    subgraph "Static Assets" 
        direction TB
        StaticFiles["Collected Static Assets"]:::frontend
        MainJS["main.js"]:::frontend
        ArtistCard["ArtistCard.js"]:::frontend
        ArtistsGrid["ArtistsGrid.js"]:::frontend
        DataVisualizer["DataVisualizer.js"]:::frontend
        ThemeToggle["ThemeToggle.js"]:::frontend
        TopItemsFilter["TopItemsFilter.js"]:::frontend
        TrackCard["TrackCard.js"]:::frontend
        TracksGrid["TracksGrid.js"]:::frontend
        StaticCSS["style.css"]:::frontend
        StaticFiles --> MainJS
        MainJS --> ArtistCard
        MainJS --> ArtistsGrid
        MainJS --> DataVisualizer
        MainJS --> ThemeToggle
        MainJS --> TopItemsFilter
        MainJS --> TrackCard
        MainJS --> TracksGrid
        StaticFiles --> StaticCSS
    end

    %% Backend
    subgraph "Django Backend"
        direction TB
        subgraph "spotify_dashboard/"
            direction TB
            Settings["settings.py"]:::backend
            URLsCore["urls.py"]:::backend
            ASGI["asgi.py"]:::backend
            WSGI["wsgi.py"]:::backend
            Settings --> URLsCore
            URLsCore --> URLRouter
        end
        URLRouter["Django URL Router"]:::backend
        subgraph "spotify_oauth/"
            direction TB
            Models["models.py"]:::backend
            Views["views.py"]:::backend
            URLsApp["urls.py"]:::backend
            Admin["admin.py"]:::backend
            Apps["apps.py"]:::backend
            URLRouter --> URLsApp
            URLsApp --> Views
            Views --> Models
        end
        subgraph "Migrations"
            direction TB
            Mig1["0001_initial.py"]:::backend
            Mig2["0002_usertrack.py"]:::backend
            Models --> Mig1
            Models --> Mig2
        end
        subgraph "Templates"
            direction TB
            DashboardTpl["dashboard.html"]:::backend
            LogoutTpl["logout.html"]:::backend
            Views --> DashboardTpl
            Views --> LogoutTpl
        end
        StaticFiles -->|"served by"| ASGI
        Views -->|"renders"| DashboardTpl
    end

    %% Database
    Database["Relational Database"]:::storage
    Models --> Database
    Views --> Database

    %% External Service
    SpotifyAPI["Spotify Web API"]:::external
    Views -->|"OAuth2 & Data Fetch"| SpotifyAPI
    SpotifyAPI -->|"Callback & Data"| Views

    %% Build Toolchain
    subgraph "Build Pipeline"
        direction TB
        PackageJSON["package.json"]:::build
        Babelrc[".babelrc"]:::build
        PackageJSON --> Babelrc
        Babelrc --> StaticFiles
    end

    %% Deployment
    Deployment["Vercel Deployment"]:::deploy
    ASGI --> Deployment
    StaticFiles --> Deployment

    %% Click Events
    click Settings "https://github.com/danielpopoola/statify/blob/main/spotify_dashboard/settings.py"
    click URLsCore "https://github.com/danielpopoola/statify/blob/main/spotify_dashboard/urls.py"
    click ASGI "https://github.com/danielpopoola/statify/blob/main/spotify_dashboard/asgi.py"
    click WSGI "https://github.com/danielpopoola/statify/blob/main/spotify_dashboard/wsgi.py"
    click Models "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/models.py"
    click Views "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/views.py"
    click URLsApp "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/urls.py"
    click Admin "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/admin.py"
    click Apps "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/apps.py"
    click Mig1 "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/migrations/0001_initial.py"
    click Mig2 "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/migrations/0002_usertrack.py"
    click DashboardTpl "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/templates/dashboard.html"
    click LogoutTpl "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/templates/logout.html"
    click StaticCSS "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/css/style.css"
    click ArtistCard "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/ArtistCard.js"
    click ArtistsGrid "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/ArtistsGrid.js"
    click DataVisualizer "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/DataVisualizer.js"
    click ThemeToggle "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/ThemeToggle.js"
    click TopItemsFilter "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/TopItemsFilter.js"
    click TrackCard "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/TrackCard.js"
    click TracksGrid "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/components/TracksGrid.js"
    click MainJS "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/static/js/main.js"
    click StaticFiles "https://github.com/danielpopoola/statify/tree/main/staticfiles/"
    click PackageJSON "https://github.com/danielpopoola/statify/blob/main/package.json"
    click Babelrc "https://github.com/danielpopoola/statify/blob/main/.babelrc"
    click Deployment "https://github.com/danielpopoola/statify/blob/main/vercel.json"
    click Browser "https://github.com/danielpopoola/statify/blob/main/README.md"
    click URLRouter "https://github.com/danielpopoola/statify/blob/main/spotify_oauth/urls.py"

    %% Styles
    classDef frontend fill:#ffeb99,stroke:#333,stroke-width:1px
    classDef backend fill:#add8f0,stroke:#333,stroke-width:1px
    classDef storage fill:#b2fba5,stroke:#333,stroke-width:1px
    classDef external fill:#f4c2c2,stroke:#333,stroke-width:1px
    classDef build fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef deploy fill:#ffe4b5,stroke:#333,stroke-width:1px
```
