# allbad/frontend-nanodegree-feedreader architecture

> Architecture diagram of the GitHub repository allbad/frontend-nanodegree-feedreader, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allbad/frontend-nanodegree-feedreader
- Repository: https://github.com/allbad/frontend-nanodegree-feedreader

## Overview

##### Project type and purpose
- This is a front-end single‐page web application (“Feed Reader”) that runs entirely in the browser.
- Its job is to fetch RSS feeds from external servers, parse them, and render entries into the page.
- It also includes a Jasmine test harness under jasmine/ for automated behavior checks.

##### File structure
- Top level
– index.html: entry‐point for the UI
– js/app.js: core application logic (feed definitions, AJAX fetch, DOM updates)
– jasmine/: test harness
- lib/jasmine-2.1.2/: Jasmine framework (boot.js, jasmine.js, CSS)
- spec/feedreader.js: initial test suite
- No dedicated backend – the application runs entirely in the user’s browser and depends on public RSS endpoints.

##### README for insights
- README confirms a browser-only RSS reader, instructs how to run by opening index.html, and outlines required test specs.
- No build or deployment pipeline – static hosting (e.g., GitHub Pages) is assumed.

##### Main components and their relationships
a. Static File Host
- Serves index.html, CSS, JS, Jasmine libs
b. Client Browser
- UI Layer (HTML + CSS)
- App Logic (js/app.js):
– FeedModel: definitions for feed URLs + metadata
– FeedLoader: AJAX calls to RSS endpoints
– ViewRenderer: inserts .entry elements into the DOM
– MenuController: toggles menu visibility
- Test Runner (Jasmine boot sequence + spec files)
c. External RSS Feed Servers
- Source of feed XML/JSON via HTTP requests
d. (Optional) Developer Workstation
- Hosts the code, runs tests locally

##### Data flows and interactions
– Browser ← HTTP GET ─ Static Host ─ delivers index.html, CSS, JS, Jasmine files
– App logic makes AJAX calls → External RSS Feed Servers → returns feed data → parsed by FeedLoader → ViewRenderer updates DOM
– Jasmine boot.js loads tests + app code → executes specs in spec/feedreader.js → reports pass/fail

##### Architectural patterns and design principles
- Separation of concerns:
– Presentation (HTML/CSS) vs. Application logic (app.js) vs. Tests (jasmine/spec)
- Minimal dependencies: purely client‐side, easy to serve statically
- Test‐first mindset encouraged by Jasmine integration

a. Components
- Static File Host (e.g., GitHub Pages)
- Browser:
– UI Layer (HTML, CSS)
– Application Layer (app.js modules: FeedModel, FeedLoader, ViewRenderer, MenuController)
– Test Harness (Jasmine libs + specs)
- External RSS Feed Servers
b. Relationships & Data Flow
c. Architectural notes
- MVC-like split within app.js
- That there is no backend service beyond RSS sources
d. Key technologies
- HTML5, CSS3
- Vanilla JavaScript
- AJAX / Fetch
- Jasmine 2.x testing framework

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Static File Host
    subgraph "Static File Host"
        direction TB
        IndexHTML["index.html"]:::staticAssets
        CSS["css/"]:::staticAssets
        JS["js/"]:::staticAssets
        JasmineLibs["jasmine/"]:::staticAssets
    end

    %% Browser Container
    subgraph "Browser" 
        direction TB

        subgraph "UI Layer"
            direction TB
            UI_HTML["index.html"]:::staticAssets
            CSSNormalize["css/normalize.css"]:::staticAssets
            CSSStyle["css/style.css"]:::staticAssets
            CSSIcomoon["css/icomoon.css"]:::staticAssets
            Fonts["fonts/"]:::staticAssets
        end

        subgraph "Application Logic"
            direction TB
            AppLogic["Application Logic (js/app.js)"]:::runtime
            FeedModel["FeedModel"]:::runtime
            FeedLoader["FeedLoader"]:::runtime
            ViewRenderer["ViewRenderer"]:::runtime
            MenuController["MenuController"]:::runtime
        end

        subgraph "Test Harness"
            direction TB
            BootJS["boot.js"]:::tests
            JasmineJS["jasmine.js"]:::tests
            JasmineHTML["jasmine-html.js"]:::tests
            ConsoleJS["console.js"]:::tests
            JasmineCSS["jasmine.css"]:::tests
            SpecFeedReader["feedreader.js"]:::tests
        end
    end

    %% External Services
    RSS["External RSS Feed Servers"]:::external

    %% Connections
    IndexHTML -->|"GET index.html"| UI_HTML
    CSS -->|"GET CSS files"| CSSNormalize
    CSS -->|"GET CSS files"| CSSStyle
    CSS -->|"GET CSS files"| CSSIcomoon
    CSS -->|"GET fonts"| Fonts
    JS -->|"GET app.js"| AppLogic
    JasmineLibs -->|"GET Jasmine libs"| BootJS
    JasmineLibs --> JasmineJS
    JasmineLibs --> JasmineHTML
    JasmineLibs --> ConsoleJS
    JasmineLibs --> JasmineCSS
    JasmineLibs --> SpecFeedReader

    AppLogic -->|"AJAX GET feed URL"| RSS
    RSS -->|"feed data"| FeedLoader
    FeedLoader -->|"parse data"| ViewRenderer
    UI_HTML -->|"user click"| MenuController
    SpecFeedReader -->|"runs specs"| AppLogic

    %% Click Events
    click IndexHTML "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/index.html"
    click CSS "https://github.com/allbad/frontend-nanodegree-feedreader/tree/master/css/"
    click JS "https://github.com/allbad/frontend-nanodegree-feedreader/tree/master/js/"
    click JasmineLibs "https://github.com/allbad/frontend-nanodegree-feedreader/tree/master/jasmine/"
    click UI_HTML "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/index.html"
    click CSSNormalize "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/css/normalize.css"
    click CSSStyle "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/css/style.css"
    click CSSIcomoon "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/css/icomoon.css"
    click Fonts "https://github.com/allbad/frontend-nanodegree-feedreader/tree/master/fonts/"
    click AppLogic "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/js/app.js"
    click BootJS "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/lib/jasmine-2.1.2/boot.js"
    click JasmineJS "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/lib/jasmine-2.1.2/jasmine.js"
    click JasmineHTML "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/lib/jasmine-2.1.2/jasmine-html.js"
    click ConsoleJS "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/lib/jasmine-2.1.2/console.js"
    click JasmineCSS "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/lib/jasmine-2.1.2/jasmine.css"
    click SpecFeedReader "https://github.com/allbad/frontend-nanodegree-feedreader/blob/master/jasmine/spec/feedreader.js"

    %% Styles
    classDef staticAssets fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef runtime fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef tests fill:#DDA0DD,stroke:#000,stroke-width:1px
```
