# boston343/horizon architecture

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

- Interactive diagram: https://gitdiagram.com/boston343/horizon
- Repository: https://github.com/boston343/horizon

## Overview

##### Project type and purpose
- This is a static-site photography theme built with the Astro framework. It’s intended as a drop-in template for portfolios: author writes content in Markdown/MDX and Astro compiles it into a fully static HTML/CSS/JS site.
- Key indicators: presence of `astro.config.mjs`, `.astro` components, `src/pages/`, and a Netlify deploy config.

##### File structure
- Top-level config and build files:
- `astro.config.mjs` – Astro build settings and integrations
- `netlify.toml` – Netlify deploy configuration
- `package.json` & lockfile – dependencies and scripts
- Public assets folder:
- `public/` – static files (favicons, robots.txt, unprocessed images)
- Source code in `src/`:
- `assets/` – images for Astro’s image optimization
- `components/` – reusable UI pieces (Hero, Nav, Footer, etc.)
- `layouts/` – page wrappers (BaseLayout, PortfolioLayout)
- `pages/` – route definitions (`index.astro`, dynamic `[page].astro`, portfolio subroutes)
- `data/` & `config/` – content model and navigation/site metadata
- `js/` – utility scripts (e.g., `textUtils.ts`)
- `styles/` – CSS files, Tailwind theming

##### README for additional insights
- Confirms it’s an Astro theme with a static build pipeline
- Mentions development commands (`npm run dev`, `build`, `preview`)
- Implies usage of Astro’s component system, MDX/Markdown for content, and integration points for forms, styling, and deployment providers.

a. Main components to represent:
- Developer workstation (IDE + Terminal)
- Source files:
– Content (Markdown/MDX in `src/data/…`, `src/pages/`)
– Components (`src/components/…`) & layouts (`src/layouts/…`)
– Assets (`src/assets/…`, `public/…`)
– Configuration (`astro.config.mjs`, `netlify.toml`, `tsconfig.json`)
- Build engine: Astro CLI & Node.js
- Output: Static site files (`./dist/` folder containing HTML/CSS/JS/images)
- Deployment target: Netlify (or Vercel / Cloudflare Pages)
- End-user browser

b. Relationships and data flow:
1. Developer invokes `npm run dev` or `npm run build`
2. Astro reads config, loads components, pages and content
3. Astro compiles and bundles:
– Static rendering of `.astro` pages
– Transpilation of TS/JS utilities
– CSS generation (Tailwind, global styles)
– Asset optimization
4. Output written to `dist/`
5. CI/CD or manual deployment pushes `dist/` to Netlify
6. CDN serves assets; browser requests pages/assets

c. Architectural patterns and design principles:
- Component-based UI (similar to React/Vue but compiled at build time)
- Static Site Generation (SSG) for performance and SEO
- Separation of concerns: content (data) vs. presentation (components) vs. layout
- Convention-over-configuration: `src/pages` → routes

d. Key technologies, frameworks, libraries:
- Astro (SSG framework)
- Node.js & npm (build runtime)
- Tailwind CSS (utility-first styling / theming)
- Netlify (hosting & CDN)
- TypeScript (static typing for config and utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD
    Dev["Developer Workstation\n(IDE + Terminal)"]:::code

    subgraph "Source Files"
        AC["astro.config.mjs"]:::code
        NT["netlify.toml"]:::code
        PM["package.json"]:::code
        TS["tsconfig.json"]:::code
        Public["public/"]:::code
        ImgSrc["src/assets/images"]:::content
        Comp["src/components/"]:::code
        Layouts["src/layouts/"]:::code
        Pages["src/pages/"]:::code
        Nav["src/config/navData.json.ts"]:::code
        SiteData["src/config/siteData.json.ts"]:::code
        ContentCfg["src/content.config.ts"]:::code
        Data["src/data/"]:::content
        Utils["src/js/textUtils.ts"]:::code
        Styles["src/styles/"]:::code
    end

    Dev --> DevServer["Astro Dev Server"]:::build
    DevServer -->|"watches"| AC & NT & PM & TS & Public & ImgSrc & Comp & Layouts & Pages & Nav & SiteData & ContentCfg & Data & Utils & Styles
    DevServer -->|"hot reload"| Dev

    Dev -->|"npm run build"| Build["Astro Build Engine"]:::build
    AC & NT & PM & TS & Public & ImgSrc & Comp & Layouts & Pages & Nav & SiteData & ContentCfg & Data & Utils & Styles -->|"compile & optimize"| Build

    Build -->|"output"| Dist["dist/\n(Static HTML/CSS/JS/Images)"]:::output
    Dist -->|"deploy"| Netlify["Netlify CDN"]:::build
    Netlify -->|"serve"| Browser["End-User Browser"]:::deliverable

    subgraph "Optional Integrations"
        Form["Form Endpoint"]:::external
        Analytics["Analytics Service"]:::external
    end

    Browser -.->|"submits form"| Form
    Browser -.->|"sends analytics"| Analytics

    click AC "https://github.com/boston343/horizon/blob/main/astro.config.mjs"
    click NT "https://github.com/boston343/horizon/blob/main/netlify.toml"
    click PM "https://github.com/boston343/horizon/blob/main/package.json"
    click TS "https://github.com/boston343/horizon/blob/main/tsconfig.json"
    click Public "https://github.com/boston343/horizon/tree/main/public/"
    click ImgSrc "https://github.com/boston343/horizon/tree/main/src/assets/images"
    click Comp "https://github.com/boston343/horizon/tree/main/src/components/"
    click Layouts "https://github.com/boston343/horizon/tree/main/src/layouts/"
    click Pages "https://github.com/boston343/horizon/tree/main/src/pages/"
    click Nav "https://github.com/boston343/horizon/blob/main/src/config/navData.json.ts"
    click SiteData "https://github.com/boston343/horizon/blob/main/src/config/siteData.json.ts"
    click ContentCfg "https://github.com/boston343/horizon/blob/main/src/content.config.ts"
    click Data "https://github.com/boston343/horizon/tree/main/src/data/"
    click Utils "https://github.com/boston343/horizon/blob/main/src/js/textUtils.ts"
    click Styles "https://github.com/boston343/horizon/tree/main/src/styles/"

    classDef code fill:#cce5ff,stroke:#4da3ff,color:#004085
    classDef content fill:#d4edda,stroke:#28a745,color:#155724
    classDef build fill:#fff3cd,stroke:#ffcd39,color:#856404
    classDef output fill:#e2e3e5,stroke:#6c757d,color:#1b1e21
    classDef deliverable fill:#f5c6cb,stroke:#e55353,color:#721c24
    classDef external fill:#f0f0f0,stroke:#999999,color:#333333
```
