# s-hirano-ist/s-public architecture

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

- Interactive diagram: https://gitdiagram.com/s-hirano-ist/s-public
- Repository: https://github.com/s-hirano-ist/s-public

## Overview

##### Main Components
- Frontend Site (Static SSG) – This includes:
- The Astro framework entry point (astro.config.mjs) coordinating the build.
- The “src” directory containing all the UI pieces: pages (portfolio, blog, news, license, search, etc.), layouts, and components (both Astro and React-based). Components like Header, Footer, PostCard, Timeline, etc., are organized under “src/components.”
- Styling and assets under “src/styles” and the “assets” directory (as well as public assets in “public”).
- Build & Development Tools – This involves:
- Package management (pnpm, package.json, pnpm-lock.yaml).
- Build and type-checking scripts (pnpm commands like build, tsc, sync).
- Code formatting and linting suites (Prettier, ESLint, StyleLint, markdownlint).
- GitHub workflows in “.github/workflows” that handle CI, linting, dependency updates (Renovate), testing (Playwright, Lighthouse, Visual Regression).
- Deployment integration with Cloudflare Pages.
- External Services & Infrastructure – Include:
- Analytics: Google Analytics.
- Site verification: Google Search Console.
- Domain management: Onamae.com.
- License and security checks (scripts like checkLicense.sh and licensing summaries).

##### Relationships and Interactions
- Data Flow: Illustrate how source files in “src” and assets in “assets/public” are processed during the build process (via Astro’s SSG) into a production build (./dist).
- CI/CD Pipeline: Show how commits trigger GitHub Actions and workflows (.github/workflows) that run tests, verify code formatting, run security and dependency scans, and then deploy automatically to Cloudflare Pages.
- Integration Points: Indicate the upstream control (GitHub for source code management) and downstream services such as Google Analytics, Search Console, and the packaging/updating scripts (like generating license summaries or photo paths).

##### Architectural Patterns and Design Principles
- Separation of Concerns – The codebase is clearly divided: component views (UI), page templates, layouts, and utilities.
- Static Site Generation – The site is pre-built via Astro, then deployed as static files.
- Modular Components – The use of both Astro and React components within “src/components” supports reusability and composition.
- CI/CD Automation – Built-in GitHub Actions, Renovate configuration, and external checks ensure continuity between code quality and deployment.

##### Technologies, Frameworks, and Tools
- Astro (framework) at the center of the web generation.
- React components (located in “src/components/react”).
- TypeScript represented in tsconfig.json and TypeScript files.
- TailwindCSS and DaisyUI for styling.
- Various linters (ESLint, StyleLint, secretlint) and formatters (Prettier) which ensure code quality.
- GitHub Actions pipelines (.github/workflows) for automation.
- Cloudflare Pages for hosting/deployment.
- External integrations: Google Analytics, Search Console, and licensing/security tools.

##### What
- Frontend (Astro Site) with subdivisions for Pages, Components, Layouts, and Styles.
- Build Tools/Development Environment.
- CI/CD Pipeline (GitHub workflows).
- External Services (Deployment on Cloudflare Pages, Google Analytics, Search Console).
- From source code (repository) → build process → production build → deployment.
- CI integrations that loop back into the development cycle.
- Optionally, include smaller details such as:
- The script executions (e.g., generating license summaries or photo paths).
- The modularity provided by the “src” folder structure.
- How environment configurations (from .nvmrc, .npmrc, etc.) support development.

- The repository with its code and assets is built by Astro (leveraging the “src” folder).
- The build process is orchestrated and monitored by CI/CD (GitHub Actions).
- Once built, the static site is deployed to Cloudflare Pages and interacts with analytics/verification services.
- All components (pages, components, utilities) and build tools, integration scripts, and external API hooks are clearly delineated.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Repo["Source Code Repository"]:::external

    subgraph "Frontend Site (Astro SSG)"
        A1["Astro Entry (astro.config.mjs)"]:::frontend
        A2["UI Components & Pages"]:::frontend
        A2a["Astro Components (src/components)"]:::frontend
        A2b["React Components (src/components/react)"]:::frontend
        A2c["Pages & Layouts (src/pages, src/layouts)"]:::frontend
        A3a["Public Assets (public)"]:::frontend
        A3b["Assets (assets)"]:::frontend
        A4["Styling (src/styles)"]:::frontend
        A4a["Tailwind Config (tailwind.config.mjs)"]:::frontend
    end

    subgraph "Build & Development Tools"
        B1["Package & Build Scripts"]:::build
        B1a["package.json"]:::build
        B1b["pnpm-lock.yaml"]:::build
        B1c["tsconfig.json"]:::build
        B2["Linting & Formatting"]:::build
        B2a[".prettierignore"]:::build
        B2b["prettier.config.mjs"]:::build
        B2c["eslint.config.js"]:::build
        B2d[".stylelintignore"]:::build
        B2e[".stylelintrc.mjs"]:::build
        B2f[".markdownlint-cli2.jsonc"]:::build
        B2g[".secretlintrc.json"]:::build
        B2h[".secretlintignore"]:::build
        B3["Node Environment"]:::build
        B3a[".npmrc"]:::build
        B3b[".nvmrc"]:::build
    end

    subgraph "CI/CD & Deployment Pipeline"
        C1["GitHub Actions Workflows"]:::cicd
        C1a["ci.yaml"]:::cicd
        C1b["create-pr.yaml"]:::cicd
        C1c["github-actions-lint.yaml"]:::cicd
        C1d["renovate-validator.yaml"]:::cicd
        C1e["update-submodule.yaml"]:::cicd
        C1f["vrt.yaml"]:::cicd
        C2["Renovate Config (.github/renovate.json5)"]:::cicd
    end

    subgraph "License & Security Checks"
        L1["License Check Script (checkLicense.sh)"]:::license
        L2["License Summary (license.summary.txt)"]:::license
    end

    BP["Build Process (Astro Build)"]:::frontend
    Dist["Production Build (./dist)"]:::build
    Deploy["Deployment (Cloudflare Pages)"]:::cicd
    Ext["External Services"]:::external
    E1["Google Analytics"]:::external
    E2["Google Search Console"]:::external
    E3["Onamae Domain"]:::external

    %% Relationships from the repository to its components
    Repo --> A1
    Repo --> B1
    Repo --> C1
    Repo --> L1

    %% Frontend Site internal structure
    A2 --> A2a
    A2 --> A2b
    A2 --> A2c
    A4 --> A4a

    %% Feeding into the build process
    A1 --> BP
    A2 --> BP
    A3a --> BP
    A3b --> BP
    A4 --> BP
    A4a --> BP
    B1 --> BP

    %% Build process to production build
    BP --> Dist

    %% CI/CD triggers deployment
    C1 --> Deploy
    C2 --> Deploy

    %% License & Security checks are part of CI/CD validations
    L1 --> C1
    L2 --> C1

    %% Production build is deployed
    Dist --> Deploy

    %% Deployment feeds external services
    Deploy --> E1
    Deploy --> E2
    Deploy --> E3

    %% Click Events for Frontend Site
    click A1 "https://github.com/s-hirano-ist/s-public/blob/main/astro.config.mjs"
    click A2a "https://github.com/s-hirano-ist/s-public/tree/main/src/components"
    click A2b "https://github.com/s-hirano-ist/s-public/tree/main/src/components/react"
    click A2c "https://github.com/s-hirano-ist/s-public/tree/main/src/pages"
    click A3a "https://github.com/s-hirano-ist/s-public/tree/main/public"
    click A3b "https://github.com/s-hirano-ist/s-public/tree/main/assets"
    click A4 "https://github.com/s-hirano-ist/s-public/tree/main/src/styles"
    click A4a "https://github.com/s-hirano-ist/s-public/blob/main/tailwind.config.mjs"

    %% Click Events for Build & Development Tools
    click B1a "https://github.com/s-hirano-ist/s-public/blob/main/package.json"
    click B1b "https://github.com/s-hirano-ist/s-public/blob/main/pnpm-lock.yaml"
    click B1c "https://github.com/s-hirano-ist/s-public/blob/main/tsconfig.json"
    click B2a "https://github.com/s-hirano-ist/s-public/blob/main/.prettierignore"
    click B2b "https://github.com/s-hirano-ist/s-public/blob/main/prettier.config.mjs"
    click B2c "https://github.com/s-hirano-ist/s-public/blob/main/eslint.config.js"
    click B2d "https://github.com/s-hirano-ist/s-public/blob/main/.stylelintignore"
    click B2e "https://github.com/s-hirano-ist/s-public/blob/main/.stylelintrc.mjs"
    click B2f "https://github.com/s-hirano-ist/s-public/blob/main/.markdownlint-cli2.jsonc"
    click B2g "https://github.com/s-hirano-ist/s-public/blob/main/.secretlintrc.json"
    click B2h "https://github.com/s-hirano-ist/s-public/blob/main/.secretlintignore"
    click B3a "https://github.com/s-hirano-ist/s-public/blob/main/.npmrc"
    click B3b "https://github.com/s-hirano-ist/s-public/blob/main/.nvmrc"

    %% Click Events for CI/CD & Deployment Pipeline
    click C1a "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/ci.yaml"
    click C1b "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/create-pr.yaml"
    click C1c "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/github-actions-lint.yaml"
    click C1d "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/renovate-validator.yaml"
    click C1e "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/update-submodule.yaml"
    click C1f "https://github.com/s-hirano-ist/s-public/blob/main/.github/workflows/vrt.yaml"
    click C2 "https://github.com/s-hirano-ist/s-public/blob/main/.github/renovate.json5"

    %% Click Events for License & Security Checks
    click L1 "https://github.com/s-hirano-ist/s-public/blob/main/checkLicense.sh"
    click L2 "https://github.com/s-hirano-ist/s-public/blob/main/license.summary.txt"

classDef frontend fill:#C7F9CC,stroke:#2B9348,stroke-width:2px;
classDef build fill:#AEDFF7,stroke:#1C7CD5,stroke-width:2px;
classDef cicd fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
classDef license fill:#F6D155,stroke:#E59866,stroke-width:2px;
classDef external fill:#F7C6C7,stroke:#C0392B,stroke-width:2px;
```
