# elyseemb/durand_construction architecture

> Architecture diagram of the GitHub repository elyseemb/durand_construction, 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/elyseemb/durand_construction
- Repository: https://github.com/elyseemb/durand_construction

## Overview

##### Project Type and Purpose
- This is a static‐site/blog/portfolio built with Astro (an SSG framework), enriched with React/TSX components, Markdoc config for documentation, and a small set of serverless functions (under `functions/`) to power dynamic data fetches. The README confirms it’s based on the “Astro Starter Kit: Basics,” extended with custom pages, blog content, and UI components.

##### File‐Structure Analysis
- Top-level:
- `.github/workflows/deploy.yml` – CI/CD pipeline for building & deploying
- `astro.config.mjs`, `package.json`, `tsconfig.json` – project config & dependencies
- `functions/` – serverless endpoints (e.g. `data.ts`)
- `public/` – static assets (video, manifest)
- `src/`:
- `pages/` – Astro routes (e.g. `/`, `/about`, `/blog/[...id].astro`)
- `layouts/` – high-level page wrappers (`Layout.astro`)
- `components/` – reusable UI pieces in Astro & React (blocks, UI folder)
- `content/` & `data/` – Markdown blog posts, taxonomy JSON, author data
- `css/` – global/app CSS, block-specific & module CSS
- `hooks/`, `helpers/`, `function/` – utility code for DOM, toggles, lightbox
- Patterns:
- Static generation (SSG) at build time
- MD/JSON content ingestion
- Component-based UI (Astro + React)
- Serverless API layer for dynamic or client-side fetches

##### Key README Insights
- Guides on CLI commands, dev vs. build vs. preview.

a. Main Components
- Developer & GitHub (source control)
- CI/CD Workflow (GitHub Actions)
- Astro CLI / Build Server (Node.js runtime)
- Content Sources (Markdown files, JSON taxonomies, author data)
- Static-Site Generator (Astro)
- Serverless Functions (e.g. `/functions/data.ts`)
- Static Assets (images, video in `public/`)
- Frontend Delivery (generated HTML/CSS/JS hosted on CDN)
- End Users (browsers)
b. Relationships & Interactions
- Dev pushes to GitHub → CI/CD triggers deploy.yml
- CI: `pnpm install` → `pnpm build` (Astro reads `src/content` & `src/data`, renders pages/components, bundles JS/CSS)
- Build output (`dist/`) + serverless functions → deployed to hosting (e.g. Netlify, Vercel)
- User visits site → static HTML served from CDN → in-page JS may call `/api/data` (serverless)
c. Architectural Patterns & Principles
- Static generation (fast first-load) + selective dynamic data via serverless APIs
- Component-driven UI (Astro islands + React components)
- Content & data as code (Markdown + JSON)
- Modular CSS (global + block + module levels)
d. Technologies & Frameworks
- Astro (SSG framework)
- Node.js (runtime for build & serverless)
- React/TSX (interactive components)
- Markdoc (if used) for docs
- PNPM (package manager)
- GitHub Actions (CI/CD)

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "Developer & CI"
    Dev["Developer"]:::dev
    GitHub["GitHub (Source Control)"]:::dev
    CI["CI/CD Workflow\n(GitHub Actions)"]:::ci
  end

  subgraph "Build Time"
    Content["Content Sources\n(Markdown & JSON)"]:::data
    Config["Build Config Files"]:::build
    Components["UI Components (Astro & React)"]:::build
    CSS["Global & Modular CSS"]:::build
    Utilities["Hooks, Helpers & Utilities"]:::build
    SSG["Static-Site Generator\n(Astro)"]:::build
  end

  subgraph "Runtime/Production"
    CDN["CDN Hosting\n(Static Assets)"]:::runtime
    Browser["Browser (End User)"]:::runtime
    API["Serverless Functions\n(/functions/data.ts)"]:::runtime
    Assets["Static Assets\n(public/)"]:::assets
  end

  Dev -->|push code| GitHub
  GitHub -->|trigger| CI
  CI -->|runs build| SSG
  Content -->|feeds| SSG
  Config -->|configures| SSG
  Components -->|renders| SSG
  CSS -->|styles| SSG
  Utilities -->|supports| SSG
  SSG -->|output → dist| CDN
  CI -->|deploys| CDN
  CI -->|deploys| API
  Browser -->|fetch static| CDN
  Browser -->|call API| API
  Assets -->|served via| CDN

  click GitHub "https://github.com/elyseemb/durand_construction/blob/master/.github/workflows/deploy.yml"
  click CI "https://github.com/elyseemb/durand_construction/blob/master/.github/workflows/deploy.yml"
  click GitHub "https://github.com/elyseemb/durand_construction/blob/master/README.md"
  click Config "https://github.com/elyseemb/durand_construction/blob/master/astro.config.mjs"
  click Config "https://github.com/elyseemb/durand_construction/blob/master/package.json"
  click Config "https://github.com/elyseemb/durand_construction/blob/master/tsconfig.json"
  click Config "https://github.com/elyseemb/durand_construction/blob/master/pnpm-lock.yaml"
  click Content "https://github.com/elyseemb/durand_construction/blob/master/src/content/docs/mon-article.md"
  click Content "https://github.com/elyseemb/durand_construction/blob/master/src/data/blog/example.md"
  click Content "https://github.com/elyseemb/durand_construction/blob/master/src/data/authors/author.json"
  click Content "https://github.com/elyseemb/durand_construction/blob/master/src/data/taxonomies/taxonomy.json"
  click Components "https://github.com/elyseemb/durand_construction/blob/master/src/components/example.astro"
  click Components "https://github.com/elyseemb/durand_construction/blob/master/src/components/example.tsx"
  click Components "https://github.com/elyseemb/durand_construction/blob/master/src/components/blocks/block.astro"
  click Components "https://github.com/elyseemb/durand_construction/blob/master/src/components/ui/button.tsx"
  click CSS "https://github.com/elyseemb/durand_construction/blob/master/src/css/app.css"
  click CSS "https://github.com/elyseemb/durand_construction/blob/master/src/css/blocks/block.css"
  click CSS "https://github.com/elyseemb/durand_construction/blob/master/src/css/modules/module.css"
  click CSS "https://github.com/elyseemb/durand_construction/blob/master/src/css/tools/tool.css"
  click Utilities "https://github.com/elyseemb/durand_construction/blob/master/src/hooks/useToggle.tsx"
  click Utilities "https://github.com/elyseemb/durand_construction/blob/master/src/hooks/useLightbox.tsx"
  click Utilities "https://github.com/elyseemb/durand_construction/blob/master/src/helpers/dom.ts"
  click API "https://github.com/elyseemb/durand_construction/blob/master/functions/data.ts"
  click Assets "https://github.com/elyseemb/durand_construction/blob/master/public/site.webmanifest"

  classDef dev fill:#D6EFFF,stroke:#0366d6
  classDef ci fill:#CFE2FF,stroke:#00509e
  classDef build fill:#E2F0D9,stroke:#2f5233
  classDef data fill:#FFF2CC,stroke:#a67c00
  classDef runtime fill:#D9D2E9,stroke:#5a2e8a
  classDef assets fill:#FDE9D9,stroke:#a32929
```
