# negin-mgdm/oscars-library architecture

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

- Interactive diagram: https://gitdiagram.com/negin-mgdm/oscars-library
- Repository: https://github.com/negin-mgdm/oscars-library

## Overview

##### Project type and purpose
- This is a small full-stack web application (“Oscars Library”) built on Node.js/Express, with a single-page frontend (homepage.html + client.js) that reads and visualizes static Oscars data (oscars.json). It’s deployed as a monolith on Heroku (Procfile).

##### File structure
- Top level:
- server.js – Express-based HTTP server & API
- client.js – browser-side JS for interactivity/visualisation
- homepage.html – main UI shell
- oscars.json – embedded data store
- package.json / Procfile – dependency & deployment descriptors
- .gitignore, README.md – project metadata
- No separate “frontend” vs. “backend” repos—everything lives in one codebase. There’s no external database: oscars.json is the data source.

##### Extract architectural hints from the README
- Backend framework: Express.js on Node.js
- Frontend: vanilla HTML/CSS + client-side JS
- Data: in-repo JSON file
- Deployment target: Heroku

##### Main components & interactions
a. Client (Browser)
- Loads homepage.html
- Runs client.js to fetch data and render charts/tables
b. Server (Node.js/Express)
- Serves homepage.html + client.js + static assets
- Exposes one or more REST endpoints (e.g., GET /api/oscars) that read oscars.json and return JSON
c. Data Store (oscars.json)
- Local file; no external DB
d. Hosting Platform (Heroku)
- Procfile instructs Heroku to run `node server.js`
e. (Optional) External dependencies
- Could be npm packages (Express, etc.)

##### Architectural patterns & principles
- Monolithic server + static asset hosting
- Single-page application (SPA) style: client.js drives UI logic and data visualization
- Separation of concerns: server handles I/O & API, client handles rendering
- No microservices, no caching layer, no external DB for simplicity

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User Browser"
        HTML["homepage.html\nHTML5"]:::frontend
        JS["client.js\nvanilla JS"]:::frontend
    end

    subgraph "Server (Node.js + Express)"
        Server["server.js\nNode.js + Express"]:::backend
    end

    subgraph "Data Store"
        Data["oscars.json\nflat file"]:::datastore
    end

    subgraph "Deployment Platform"
        Heroku["Heroku\nProcfile"]:::deployment
    end

    subgraph "Repository Files"
        Package["package.json"]:::config
        Readme["README.md"]:::config
        Gitignore[".gitignore"]:::config
    end

    HTML -->|"GET /"| Server
    HTML -->|"GET /client.js"| Server
    JS -->|"GET /api/oscars"| Server
    Server -->|"Serves homepage.html"| HTML
    Server -->|"Serves client.js"| JS
    Server -->|"Reads oscars.json"| Data
    Server -->|"Returns JSON"| JS
    Heroku -->|"Runs node server.js"| Server

    click HTML "https://github.com/negin-mgdm/oscars-library/blob/main/homepage.html"
    click JS "https://github.com/negin-mgdm/oscars-library/blob/main/client.js"
    click Server "https://github.com/negin-mgdm/oscars-library/blob/main/server.js"
    click Data "https://github.com/negin-mgdm/oscars-library/blob/main/oscars.json"
    click Heroku "https://github.com/negin-mgdm/oscars-library/tree/main/Procfile"
    click Package "https://github.com/negin-mgdm/oscars-library/blob/main/package.json"
    click Readme "https://github.com/negin-mgdm/oscars-library/blob/main/README.md"
    click Gitignore "https://github.com/negin-mgdm/oscars-library/blob/main/.gitignore"

    classDef frontend fill:#e0f7fa,stroke:#006064;
    classDef backend fill:#e8f5e9,stroke:#2e7d32;
    classDef datastore fill:#fff3e0,stroke:#ef6c00;
    classDef deployment fill:#eceff1,stroke:#546e7a;
    classDef config fill:#f3e5f5,stroke:#6a1b9a;
```
