# bihari2007/rawaniboy architecture

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

- Interactive diagram: https://gitdiagram.com/bihari2007/rawaniboy
- Repository: https://github.com/bihari2007/rawaniboy

## Overview

##### Project type and purpose
- This is a purely front-end, static “music streaming” website named “rawaniboy.”
- It consists of a single HTML entrypoint (index.html), a CSS file, a JavaScript file, a collection of MP3s organized by genre, and a CNAME for custom DNS.
- There is no dynamic backend or database—everything is served as static assets.

##### File structure
- Top-level:
- CNAME (custom domain)
- README.md
- ads.txt (advertising compliance)
- images/ (static images folder)
- index.html (SPA entrypoint)
- song.css (site styling)
- song.js (UI logic + song playback)
- songs/ (static MP3 repository)
- Under songs/, three genre subfolders: bhojpuri/, romantic/, sad/, each containing dozens of .mp3 files.

##### Key insights from the README
- README.md only states the project name “rawaniboy.”
- No additional architecture notes or dependencies—reinforces that this is a zero-backend, static site.

##### Main components
a. Client Browser (User Agent)
b. DNS / Custom Domain (CNAME record)
c. Static Hosting Platform (e.g., GitHub Pages, Netlify, AWS S3 + CloudFront)
d. Static Asset Store:
– index.html, song.css, song.js, images/
– songs/ (MP3 files)
e. External Services (optional): analytics, ad networks (ads.txt)

##### Relationships and data flows
1. User enters custom domain → DNS resolves to hosting platform.
2. Browser requests index.html → hosted by static server / CDN.
3. Browser downloads CSS, JS, images.
4. song.js reads the static folder structure (hard-coded list or pre-generated JSON) and displays genres + song list.
5. On user click → browser issues HTTP GET for chosen .mp3 file → streamed from static asset store / CDN to audio element.
6. Optionally, analytics / ad network beacons fire via JavaScript.

##### Architectural patterns and design principles
- Single–Page Application (SPA) pattern for the front end.
- Static-only architecture: minimal maintenance, high scalability via CDN.
- Folder-per-resource: MP3s organized by genre.
- Separation of concerns: index.html deals with layout, song.css handles styling, song.js manages playback & UI.

- Inside that cloud, place two sub-components: “Web Origin (S3 / GitHub Pages)” and “Edge Cache (CDN).”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and DNS
    U["User (Client Browser)"]:::browser
    DNS["Custom Domain / DNS Resolver"]:::network

    U -->|"1. DNS Lookup via CNAME"| DNS

    %% CDN and Origin
    subgraph "Static Hosting / CDN"
        direction TB
        EC["Edge Cache (CDN)"]:::network
        Origin["Web Origin (S3 / GitHub Pages)"]:::static
        EC -->|"Cache Miss"| Origin
    end

    DNS -->|"2. Resolve to CDN"| EC

    %% Browser requests static assets
    Browser["Client Browser"]:::browser
    EC -->|"3. Serve index.html, CSS, JS, images"| Browser

    %% Static Asset Store within Origin
    subgraph "Web Origin Static Assets"
        direction TB
        HTML["index.html"]:::static
        CSS["song.css"]:::static
        JS["song.js"]:::static
        Images["images/"]:::static
        subgraph "MP3 Files"
            direction TB
            Songs["songs/"]:::static
            Bhojpuri["bhojpuri/"]:::static
            Romantic["romantic/"]:::static
            Sad["sad/"]:::static
            Songs --> Bhojpuri
            Songs --> Romantic
            Songs --> Sad
        end
        Origin --> HTML
        Origin --> CSS
        Origin --> JS
        Origin --> Images
        Origin --> Songs
    end

    %% Browser fetches MP3s
    Browser -->|"4. HTTP GET MP3"| EC

    %% Analytics and Ads
    Analytics["Analytics / Ad Network"]:::external
    Browser -->|"5. Analytics Beacons / ads.txt"| Analytics

    %% Click Events
    click HTML "https://github.com/bihari2007/rawaniboy/blob/main/index.html"
    click CSS "https://github.com/bihari2007/rawaniboy/blob/main/song.css"
    click JS "https://github.com/bihari2007/rawaniboy/blob/main/song.js"
    click DNS "https://github.com/bihari2007/rawaniboy/tree/main/CNAME"
    click Images "https://github.com/bihari2007/rawaniboy/tree/main/images/"
    click Songs "https://github.com/bihari2007/rawaniboy/tree/main/songs/"
    click Bhojpuri "https://github.com/bihari2007/rawaniboy/tree/main/songs/bhojpuri/"
    click Romantic "https://github.com/bihari2007/rawaniboy/tree/main/songs/romantic/"
    click Sad "https://github.com/bihari2007/rawaniboy/tree/main/songs/sad/"
    click Analytics "https://github.com/bihari2007/rawaniboy/blob/main/ads.txt"
    click README "https://github.com/bihari2007/rawaniboy/blob/main/README.md"

    %% Styles
    classDef browser fill:#aaf,stroke:#333,stroke-width:1px
    classDef network fill:#f9f,stroke:#333,stroke-width:1px
    classDef static fill:#afa,stroke:#333,stroke-width:1px
    classDef external fill:#cff,stroke:#333,stroke-width:1px
```
