# christianglenogo/space-tourism architecture

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

- Interactive diagram: https://gitdiagram.com/christianglenogo/space-tourism
- Repository: https://github.com/christianglenogo/space-tourism

## Overview

##### Project type and purpose
- This is a purely frontend, multipage static website (“Space tourism”) built as a challenge solution.
- There is no backend server or database—content is served as static files (HTML/CSS/JS/JSON/assets).

##### File structure
- Top-level HTML files: index.html, destination.html, crew.html, technology.html
- css/ contains compiled CSS files. scss/ contains source SCSS modules.
- js/ contains vanilla-JS scripts that fetch data.json and swap content.
- data.json holds the dynamic page content for destinations, crew, and technology.
- assets/ holds images categorized by page.

##### README insights
- Built with HTML5, SCSS, Flexbox, Fetch API, vanilla JavaScript.
- Mobile-first responsive design.
- No server-side logic: Fetch API is used client-side to read data.json.

##### Main components and their interactions
a. Client (Browser)
- Renders HTML pages and applies CSS.
- Executes JavaScript to fetch data.json and manipulate the DOM.
b. Static Host / CDN
- Serves .html, .css, .js, .json, and asset files over HTTP/HTTPS.
c. SCSS Build Pipeline (Developer-side)
- Watches scss/* → compiles into css/*.
- (Optional) Could include autoprefixer, minifier before deployment.
d. data.json
- Acts as a mini “data store” fetched at runtime by JS.
e. Assets (images)

##### Architectural pattern & design principles
- Static website architecture (no backend).
- Separation of concerns: SCSS for style, JS for data binding, JSON for content.
- Mobile-first and responsive design (Flexbox, CSS variables).
- Unidirectional data flow: JS fetch → update DOM.

##### Elements to include for clarity
- Clear labels: “Browser (Client)”, “Static Host/CDN”, “SCSS Compiler”

## Diagram (Mermaid)

```mermaid
graph TB
    %% Developer Tooling Layer
    subgraph "Developer Tooling"
        direction TB
        SCSS_Compiler["SCSS Compiler"]:::tooling
        CSS_Files_Build["CSS Files"]:::build
        README["README.md"]:::tooling
    end

    SCSS_Compiler -->|"compile SCSS"| CSS_Files_Build

    %% Static Host / CDN Layer
    subgraph "Static Host / CDN"
        direction TB
        subgraph "HTML Pages"
            direction TB
            HTML_Index["index.html"]:::host
            HTML_Destination["destination.html"]:::host
            HTML_Crew["crew.html"]:::host
            HTML_Technology["technology.html"]:::host
        end
        CSS_Files_Host["css/"]:::host
        JS_Scripts["js/"]:::host
        Data_JSON["data.json"]:::host
        subgraph "Assets"
            direction TB
            Assets_Home["assets/home/"]:::host
            Assets_Destination["assets/destination/"]:::host
            Assets_Crew["assets/crew/"]:::host
            Assets_Technology["assets/technology/"]:::host
            Assets_Shared["assets/shared/"]:::host
        end
    end

    %% Browser Layer
    subgraph "Browser (Client)"
        direction TB
        HTML_Renderer["HTML Renderer"]:::runtime
        CSS_Engine["CSS Engine"]:::runtime
        JS_Engine["JS Engine (Fetch API)"]:::runtime
        DOM_Renderer["DOM Renderer"]:::runtime
    end

    %% Build flow propagation
    CSS_Files_Build -->|"deploy css"| CSS_Files_Host

    %% Runtime flows (green)
    HTML_Index -->|"HTTP GET index.html"| HTML_Renderer
    HTML_Destination -->|"HTTP GET destination.html"| HTML_Renderer
    HTML_Crew -->|"HTTP GET crew.html"| HTML_Renderer
    HTML_Technology -->|"HTTP GET technology.html"| HTML_Renderer

    CSS_Files_Host -->|"HTTP GET css files"| CSS_Engine
    JS_Scripts -->|"HTTP GET js scripts"| JS_Engine
    Assets_Home -->|"HTTP GET images"| HTML_Renderer
    Assets_Destination -->|"HTTP GET images"| HTML_Renderer
    Assets_Crew -->|"HTTP GET images"| HTML_Renderer
    Assets_Technology -->|"HTTP GET images"| HTML_Renderer
    Assets_Shared -->|"HTTP GET shared images"| HTML_Renderer

    JS_Engine -->|"Fetch data.json"| Data_JSON
    Data_JSON -->|"return JSON"| JS_Engine
    JS_Engine -->|"update content"| DOM_Renderer

    %% Click Events
    click SCSS_Compiler "https://github.com/christianglenogo/space-tourism/tree/main/scss/"
    click CSS_Files_Build "https://github.com/christianglenogo/space-tourism/tree/main/css/"
    click JS_Scripts "https://github.com/christianglenogo/space-tourism/tree/main/js/"
    click Data_JSON "https://github.com/christianglenogo/space-tourism/blob/main/data.json"
    click HTML_Index "https://github.com/christianglenogo/space-tourism/blob/main/index.html"
    click HTML_Destination "https://github.com/christianglenogo/space-tourism/blob/main/destination.html"
    click HTML_Crew "https://github.com/christianglenogo/space-tourism/blob/main/crew.html"
    click HTML_Technology "https://github.com/christianglenogo/space-tourism/blob/main/technology.html"
    click Assets_Home "https://github.com/christianglenogo/space-tourism/tree/main/assets/home/"
    click Assets_Destination "https://github.com/christianglenogo/space-tourism/tree/main/assets/destination/"
    click Assets_Crew "https://github.com/christianglenogo/space-tourism/tree/main/assets/crew/"
    click Assets_Technology "https://github.com/christianglenogo/space-tourism/tree/main/assets/technology/"
    click Assets_Shared "https://github.com/christianglenogo/space-tourism/tree/main/assets/shared/"
    click README "https://github.com/christianglenogo/space-tourism/blob/main/README.md"

    %% Styles
    classDef tooling fill:#FDEDEC,stroke:#E6B0AA
    classDef build fill:#D6EAF8,stroke:#AED6F1
    classDef host fill:#FCF3CF,stroke:#F9E79F
    classDef runtime fill:#D5F5E3,stroke:#A9DFBF
```
