# eaa24peeh/radar-hub architecture

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

- Interactive diagram: https://gitdiagram.com/eaa24peeh/radar-hub
- Repository: https://github.com/eaa24peeh/radar-hub

## Overview

##### Project Type and Purpose
- Project Type: A static, front-end website designed to serve as an interactive community hub.
- Purpose: To connect Aarhus citizens with Radar’s cultural mission via engaging features such as live voting, discussion forums, and real-time updates.
- Key Feature Note: Although interactive behaviors (e.g., live voting) are mentioned, the file tree shows no dedicated backend, which means dynamic behavior is likely powered by vanilla JavaScript (and possibly external APIs) embedded within the HTML pages.

##### File Structure
- Top-level files: Several HTML files (index.html, about.html, hub.html, contact.html, popular-posts.html) – these form the core pages or “views” of the website.
- Directories:
- assets: Contains favicon assets and may include other media.
- css: Divided into global styles (global/global.css), a primary style hub (style.css) that imports component-specific CSS files (from css/components), and additional responsive layouts.
- js: Hosts JavaScript files (nav.js, newsletter.js) that add interactivity and dynamic behavior.
- Additional Files: SEO-related files such as robots.txt and sitemap.xml, which are essential for search engine visibility.
- Architectural Indication: Modular organization, emphasizing separation between structure (HTML), presentation (CSS), and behavior (JavaScript).

##### README Insights
- Architecture Details: The README explains that the site uses semantic HTML5, modular CSS (with a global.css and multiple component stylesheets imported via style.css), and modern CSS techniques like Flexbox, Grid, and CSS clamp for responsiveness.
- Built with Vanilla JavaScript: This emphasizes that all interactions and dynamic behaviors stem from lightweight script files rather than heavy frameworks.
- Emphasis on Maintenance: The separation of CSS files and reusability of common elements (header, footer) are noted as best practices.
- Overall, the architecture is clearly front-end centric with a strong focus on performance, responsiveness, and code modularity.

- HTML Pages: Represent each page (index.html, about.html, hub.html, contact.html, popular-posts.html) as separate nodes grouped under a “Presentation Layer.”
▪ Global styles (global.css)
▪ Component-specific styles (found in css/components), which are aggregated by style.css.
- JavaScript Functionality: A module for “Client-Side Interaction” that includes nav.js, newsletter.js, and any inline scripts.
- Assets Directory: Serve as the media/branding component, showing Favicon assets and images.
- SEO & Deployment Configurations: A component for SEO setups (robots.txt, sitemap.xml) and references to the about.html and contact.html content.
- Interactions:

##### Architectural Patterns & Design Principles
- Separation of Concerns: Differentiate clearly between “Presentation” (HTML), “Styling” (CSS), and “Behavior” (JavaScript).
- Modularity: Highlight that styling is broken down into global and component-specific files, while the HTML files act as containers for these modular pieces.
- Responsive Design: Indicate the use of Flexbox, CSS Grid, and clamp() for responsive layouts, ensuring that the design adapts to various screen sizes.
- Performance Optimization: Note that, as learned during development, externalizing CSS and JS and reducing inline scripts are important for performance.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Aggregated Presentation Node
    HP("HTML Pages Aggregated"):::htmlStyle

    %% Presentation Layer with Individual HTML Files
    subgraph "Presentation Layer"
        H1("index.html"):::htmlStyle
        H2("about.html"):::htmlStyle
        H3("hub.html"):::htmlStyle
        H4("contact.html"):::htmlStyle
        H5("popular-posts.html"):::htmlStyle
    end

    %% CSS Styling Layer
    subgraph "CSS Styling"
        B1("global.css"):::cssStyle
        B2("style.css (Aggregates /css/components)"):::cssStyle
    end

    %% JavaScript Interaction Module
    J("JavaScript: Client-Side Interaction (nav.js,newsletter.js)"):::jsStyle

    %% Assets Module
    A("Assets (Favicon & Media)"):::assetsStyle

    %% SEO and Deployment Configuration
    subgraph "SEO & Deployment Config"
        S1("robots.txt"):::seoStyle
        S2("sitemap.xml"):::seoStyle
    end

    %% External Service for Live Updates
    EAPI("External Service/API (LiveUpdates)"):::jsStyle

    %% Responsive Design Note
    N("Responsive Design (Flexbox,Grid,clamp())"):::cssStyle

    %% Connections from Aggregated HTML Node to Other Layers
    HP -->|"styles"| B1
    HP -->|"styles"| B2
    HP -->|"interacts"| J
    HP -->|"loads"| A
    HP -->|"configures"| S1
    HP -->|"configures"| S2

    %% External API call from JavaScript Interaction
    J -->|"calls"| EAPI

    %% Responsive design implemented in component CSS
    B2 -->|"implements"| N

    %% Class Definitions for Colour Coding
    classDef htmlStyle fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef cssStyle fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef jsStyle fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef assetsStyle fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef seoStyle fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;

    %% Click Events for HTML Pages
    click H1 "https://github.com/eaa24peeh/radar-hub/blob/main//index.html"
    click H2 "https://github.com/eaa24peeh/radar-hub/blob/main//about.html"
    click H3 "https://github.com/eaa24peeh/radar-hub/blob/main//hub.html"
    click H4 "https://github.com/eaa24peeh/radar-hub/blob/main//contact.html"
    click H5 "https://github.com/eaa24peeh/radar-hub/blob/main//popular-posts.html"

    %% Click Events for CSS Files
    click B1 "https://github.com/eaa24peeh/radar-hub/blob/main//css/global/global.css"
    click B2 "https://github.com/eaa24peeh/radar-hub/blob/main//css/style.css"

    %% Click Event for JavaScript Directory
    click J "https://github.com/eaa24peeh/radar-hub/tree/main//js"

    %% Click Event for Assets Directory
    click A "https://github.com/eaa24peeh/radar-hub/tree/main//assets"

    %% Click Events for SEO Files
    click S1 "https://github.com/eaa24peeh/radar-hub/blob/main//robots.txt"
    click S2 "https://github.com/eaa24peeh/radar-hub/blob/main//sitemap.xml"
```
