# paul-hammant/tiny-timeline architecture

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

- Interactive diagram: https://gitdiagram.com/paul-hammant/tiny-timeline
- Repository: https://github.com/paul-hammant/tiny-timeline

## Overview

##### Main components
- Frontend (User Interface): The tiny-timeline.html file which is the entry point shown in the browser/mobile. This component is responsible for rendering the timeline, handling user interaction (like clicking or swiping) and reading timeline configuration (e.g., which timeline to display based on the URL hash).
- Data Sources: The JSON files (spaceflight-milestones.json and womens-rights.json) which contain the events to be displayed. These files provide event data that the HTML/JavaScript code consumes.
- Repository/Version Control: Although not part of runtime, the .gitignore coupled with the repository setup indicates the project is managed via Git.

##### Relationships and Interactions
- The browser loads tiny-timeline.html.
- The application fetches the JSON data, parses it, and populates the timeline accordingly.
- There is a direct data flow from the JSON files to the browser's timeline presentation logic.

##### Architectural Patterns & Design Principles
- This is a single-page static application with a clear separation between static content (HTML) and external data (JSON files).
- The design emphasizes minimalism and client-side rendering – all logic is contained within the HTML file.
- It uses progressive enhancement by relying on URL hash navigation, making it easily accessible on both desktops and mobile devices.

##### Relevant Technologies & Frameworks
- Core: HTML, likely CSS, and JavaScript (though no explicit libraries are mentioned, you may infer vanilla JS or small helper libraries may be used).
- Data Format: JSON for timeline events.
- Web Hosting/Deployment: The project is hosted statically (as seen from the provided GitHub Pages links).

- Optionally, include secondary notes indicating that the URL hash in the browser triggers the selection of the appropriate JSON file.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User("User (Browser/Mobile)"):::user
    Frontend("tiny-timeline.html (Frontend)"):::frontend
    User -->|"opens timeline"| Frontend

    subgraph "Timeline Data Sources"
        Spaceflight("spaceflight-milestones.json (Data Source)"):::data
        WomensRights("womens-rights.json (Data Source)"):::data
    end

    Frontend -->|"fetches events"| Spaceflight
    Frontend -->|"fetches events"| WomensRights

    subgraph "Repository/Version Control"
        Gitignore[".gitignore"]:::repo
        Readme["README.md"]:::repo
    end

    click Frontend "https://github.com/paul-hammant/tiny-timeline/blob/main/tiny-timeline.html"
    click Spaceflight "https://github.com/paul-hammant/tiny-timeline/blob/main/spaceflight-milestones.json"
    click WomensRights "https://github.com/paul-hammant/tiny-timeline/blob/main/womens-rights.json"
    click Gitignore "https://github.com/paul-hammant/tiny-timeline/blob/main/.gitignore"
    click Readme "https://github.com/paul-hammant/tiny-timeline/blob/main/README.md"

    classDef user fill:#FFC107,stroke:#000,stroke-width:2px;
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef data fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef repo fill:#D3D3D3,stroke:#000,stroke-width:2px;
```
