# moodykroko/my-portfolio architecture

> Architecture diagram of the GitHub repository moodykroko/my-portfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moodykroko/my-portfolio
- Repository: https://github.com/moodykroko/my-portfolio

## Overview

1. This repository is an Astro-based static site, likely a portfolio or case-study website rather than a traditional app backend. The architecture is centered on file-based routes in `src/pages`, reusable UI pieces in `src/components`, shared page framing in `src/layouts`, and global styling in `src/styles`.

2. The main site surfaces as standard Astro routes:
   - `src/pages/index.astro` for the homepage
   - `src/pages/about.astro`
   - `src/pages/work/index.astro` for the work listing
   - `src/pages/work/project-1.astro`, `project-2.astro`
   - a nested case study area under `src/pages/work/goodnotes-folder-colours/`
   
   This implies a content-driven site where each page is independently rendered from route files.

3. The `src/pages/work/goodnotes-folder-colours/` subtree is the clearest example of a case-study template split into multiple pieces:
   - `index.astro` as the route entry
   - `content.astro` for the main narrative/content
   - supporting static design-handoff documents in sibling folders like `design_handoff_problem_section`, `design_handoff_user_need_section`, and `design_handoff_exploration_section`
   
   Architecturally, this suggests the site is organized around modular sections that can be composed into a long-form project presentation.

4. Shared layout and navigation are handled through components:
   - `src/layouts/Layout.astro` likely defines the common shell
   - `src/components/Nav.astro` and `Footer.astro` provide global chrome
   - `ProjectCard.astro`, `StackSection.astro`, and `ContactSection.astro` encapsulate repeatable content blocks
   
   These components form the presentation layer boundary: pages assemble them, but the components own the reusable structure and styling hooks.

5. The site’s content flow is mostly top-down and static: page routes import shared layout/components, render curated content, and rely on assets from `src/assets` and `public`. There is no visible database, CMS, or client-side state layer in the tree, so the architecture is primarily build-time composition rather than runtime data orchestration.

6. Static assets are split by purpose:
   - `public/solution-video.mp4` is a directly served media asset
   - `src/assets/Device Bezels/iPad` and `src/assets/icons` appear to be imported assets used inside components or pages
   
   This indicates the site mixes Astro-managed asset imports with public static files for direct URL access, especially for media-heavy case study pages.

7. There is a small server-side boundary at `src/pages/api/cs-auth.ts`. Because it lives under `src/pages/api`, Astro will expose it as an API route. Its exact role isn’t visible from the tree, but it is the only explicit backend endpoint and likely serves some kind of content/security/authentication function for a specific section of the site.

8. `src/middleware.ts` adds another request-time boundary. Middleware in Astro runs before route handling, so it can enforce access rules, redirects, localization, or other cross-cutting request logic. Combined with the API route, it suggests the site is not purely static in behavior, even if the main content is pre-rendered.

9. Styling is centralized in `src/styles/global.css`, which likely sets global typography, spacing, and theme tokens used by all pages. The architecture appears to rely more on component composition plus one global stylesheet than on a large utility framework.

10. The repo includes `astro.config.mjs`, `tsconfig.json`, and `package.json` with the usual Astro toolchain. The runtime is Node-based build tooling for generating a static production site into `dist/`, with local dev and preview modes matching standard Astro workflows.

11. The `design_handoff_*` folders and HTML files look like source artifacts for content review or presentation of design process sections, not runtime app logic. They likely support the work/case-study narrative and may have been generated or hand-authored for stakeholder handoff.

12. In diagram terms, the cleanest abstraction is:
   - browser requests route-specific Astro pages
   - pages compose shared layout/components
   - components render content using static assets
   - global CSS provides the styling layer
   - one API route and middleware handle the small amount of server-side request logic
   
   The overall system is a content-first Astro site with a mostly static rendering model and a thin server-side edge for special route handling.

Main entry points: [`src/layouts/Layout.astro`](https://github.com/moodykroko/my-portfolio/blob/main/src/layouts/Layout.astro) (Layout), [`src/pages/index.astro`](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/index.astro) (Home), [`src/pages/work/index.astro`](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/index.astro) (Work Index), [`src/pages/api/cs-auth.ts`](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/api/cs-auth.ts) (CS Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_routes["Routes"]
  node_node_home["Home<br/>astro page<br/>[index.astro]"]
  node_node_about["About<br/>astro page<br/>[about.astro]"]
  node_node_work_index["Work Index<br/>astro page<br/>[index.astro]"]
  node_node_work_project1["Project 1<br/>astro page<br/>[project-1.astro]"]
  node_node_work_project2["Project 2<br/>astro page<br/>[project-2.astro]"]
  node_node_goodnotes_index["Goodnotes Route<br/>astro page<br/>[index.astro]"]
  node_node_goodnotes_content["Case Content<br/>astro partial<br/>[content.astro]"]
end

subgraph group_grp_ui["UI"]
  node_node_layout["Layout<br/>shell<br/>[Layout.astro]"]
  node_node_nav["Nav<br/>[Nav.astro]"]
  node_node_footer["Footer<br/>[Footer.astro]"]
  node_node_project_card["Project Card<br/>[ProjectCard.astro]"]
  node_node_stack_section["Stack Section<br/>[StackSection.astro]"]
  node_node_contact_section["Contact Section"]
  node_node_global_css["Global CSS<br/>styles<br/>[global.css]"]
end

subgraph group_grp_content["Content"]
  node_node_assets[("Assets")]
  node_node_public_media["Public Media<br/>static media<br/>[solution-video.mp4]"]
  node_node_design_handoff["Handoff Docs<br/>content artifacts"]
end

subgraph group_grp_server["Server Edge"]
  node_node_api_auth["CS Auth<br/>api route<br/>[cs-auth.ts]"]
  node_node_middleware["Middleware<br/>request hook<br/>[middleware.ts]"]
end

subgraph group_grp_tooling["Tooling"]
  node_node_config["Astro Config<br/>tooling<br/>[astro.config.mjs]"]
end

node_node_home -->|"uses"| node_node_layout
node_node_about -->|"uses"| node_node_layout
node_node_work_index -->|"uses"| node_node_layout
node_node_work_project1 -->|"uses"| node_node_layout
node_node_work_project2 -->|"uses"| node_node_layout
node_node_goodnotes_index -->|"uses"| node_node_layout
node_node_layout -->|"wraps"| node_node_nav
node_node_layout -->|"wraps"| node_node_footer
node_node_home -->|"renders"| node_node_project_card
node_node_work_index -->|"renders"| node_node_project_card
node_node_home -->|"renders"| node_node_stack_section
node_node_home -->|"renders"| node_node_contact_section
node_node_goodnotes_index -->|"includes"| node_node_goodnotes_content
node_node_goodnotes_content -->|"imports"| node_node_assets
node_node_goodnotes_content -->|"references"| node_node_public_media
node_node_work_project1 -.->|"references"| node_node_design_handoff
node_node_work_project2 -.->|"references"| node_node_design_handoff
node_node_home -->|"styles"| node_node_global_css
node_node_about -->|"styles"| node_node_global_css
node_node_work_index -->|"styles"| node_node_global_css
node_node_goodnotes_index -->|"styles"| node_node_global_css
node_node_api_auth -.->|"protected by"| node_node_middleware
node_node_home -.->|"may call"| node_node_api_auth
node_node_work_index -.->|"may call"| node_node_api_auth
node_node_config -->|"builds"| node_node_home
node_node_config -->|"builds"| node_node_api_auth

click node_node_home "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/index.astro"
click node_node_about "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/about.astro"
click node_node_work_index "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/index.astro"
click node_node_work_project1 "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/project-1.astro"
click node_node_work_project2 "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/project-2.astro"
click node_node_goodnotes_index "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/goodnotes-folder-colours/index.astro"
click node_node_goodnotes_content "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/goodnotes-folder-colours/content.astro"
click node_node_layout "https://github.com/moodykroko/my-portfolio/blob/main/src/layouts/Layout.astro"
click node_node_nav "https://github.com/moodykroko/my-portfolio/blob/main/src/components/Nav.astro"
click node_node_footer "https://github.com/moodykroko/my-portfolio/blob/main/src/components/Footer.astro"
click node_node_project_card "https://github.com/moodykroko/my-portfolio/blob/main/src/components/ProjectCard.astro"
click node_node_stack_section "https://github.com/moodykroko/my-portfolio/blob/main/src/components/StackSection.astro"
click node_node_contact_section "https://github.com/moodykroko/my-portfolio/blob/main/src/components/ContactSection.astro"
click node_node_global_css "https://github.com/moodykroko/my-portfolio/blob/main/src/styles/global.css"
click node_node_assets "https://github.com/moodykroko/my-portfolio/tree/main/src/assets"
click node_node_public_media "https://github.com/moodykroko/my-portfolio/blob/main/public/solution-video.mp4"
click node_node_design_handoff "https://github.com/moodykroko/my-portfolio/tree/main/design_handoff_problem_section"
click node_node_api_auth "https://github.com/moodykroko/my-portfolio/blob/main/src/pages/api/cs-auth.ts"
click node_node_middleware "https://github.com/moodykroko/my-portfolio/blob/main/src/middleware.ts"
click node_node_config "https://github.com/moodykroko/my-portfolio/blob/main/astro.config.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_home,node_node_about,node_node_work_index,node_node_work_project1,node_node_work_project2,node_node_goodnotes_index,node_node_goodnotes_content toneBlue
class node_node_layout,node_node_nav,node_node_footer,node_node_project_card,node_node_stack_section,node_node_contact_section,node_node_global_css toneAmber
class node_node_assets,node_node_public_media,node_node_design_handoff toneMint
class node_node_api_auth,node_node_middleware toneRose
class node_node_config toneIndigo
```

## Components

### Routes

File-based Astro pages and page subtrees

- [Home](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/index.astro): astro page · Homepage route · `src/pages/index.astro`
- [About](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/about.astro): astro page · About route · `src/pages/about.astro`
- [Work Index](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/index.astro): astro page · Listing of projects · `src/pages/work/index.astro`
- [Project 1](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/project-1.astro): astro page · Standalone work case page · `src/pages/work/project-1.astro`
- [Project 2](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/project-2.astro): astro page · Standalone work case page · `src/pages/work/project-2.astro`
- [Goodnotes Route](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/goodnotes-folder-colours/index.astro): astro page · Nested case-study entry route · `src/pages/work/goodnotes-folder-colours/index.astro`
- [Case Content](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/work/goodnotes-folder-colours/content.astro): astro partial · Long-form narrative content · `src/pages/work/goodnotes-folder-colours/content.astro`

### UI

Shared layout, components, and styling

- [Layout](https://github.com/moodykroko/my-portfolio/blob/main/src/layouts/Layout.astro): shell · Shared page frame · `src/layouts/Layout.astro`
- [Nav](https://github.com/moodykroko/my-portfolio/blob/main/src/components/Nav.astro): Global navigation · `src/components/Nav.astro`
- [Footer](https://github.com/moodykroko/my-portfolio/blob/main/src/components/Footer.astro): Global footer · `src/components/Footer.astro`
- [Project Card](https://github.com/moodykroko/my-portfolio/blob/main/src/components/ProjectCard.astro): Reusable project teaser · `src/components/ProjectCard.astro`
- [Stack Section](https://github.com/moodykroko/my-portfolio/blob/main/src/components/StackSection.astro): Reusable profile section · `src/components/StackSection.astro`
- [Contact Section](https://github.com/moodykroko/my-portfolio/blob/main/src/components/ContactSection.astro): Reusable contact block · `src/components/ContactSection.astro`
- [Global CSS](https://github.com/moodykroko/my-portfolio/blob/main/src/styles/global.css): styles · Site-wide styling layer · `src/styles/global.css`

### Content

Case-study artifacts and static media

- [Assets](https://github.com/moodykroko/my-portfolio/tree/main/src/assets): media assets · Imported images and icons · `src/assets`
- [Public Media](https://github.com/moodykroko/my-portfolio/blob/main/public/solution-video.mp4): static media · Directly served video asset · `public/solution-video.mp4`
- [Handoff Docs](https://github.com/moodykroko/my-portfolio/tree/main/design_handoff_problem_section): content artifacts · Design-review and section artifacts · `design_handoff_problem_section`

### Server Edge

Request-time logic beyond static pages

- [CS Auth](https://github.com/moodykroko/my-portfolio/blob/main/src/pages/api/cs-auth.ts): api route · Server endpoint under /api · `src/pages/api/cs-auth.ts`
- [Middleware](https://github.com/moodykroko/my-portfolio/blob/main/src/middleware.ts): request hook · Cross-cutting request logic · `src/middleware.ts`

### Tooling

Build and project configuration

- [Astro Config](https://github.com/moodykroko/my-portfolio/blob/main/astro.config.mjs): tooling · Build/runtime configuration · `astro.config.mjs`

## Connections

- Home → Layout: uses · Homepage renders inside the shared shell
- About → Layout: uses · About page renders inside the shared shell
- Work Index → Layout: uses · Work listing uses the shared shell
- Project 1 → Layout: uses · Project page uses the shared shell
- Project 2 → Layout: uses · Project page uses the shared shell
- Goodnotes Route → Layout: uses · Case-study route uses the shared shell
- Layout → Nav: wraps · Layout composes global navigation
- Layout → Footer: wraps · Layout composes global footer
- Home → Project Card: renders · Homepage likely surfaces project teasers
- Work Index → Project Card: renders · Work index lists projects with cards
- Home → Stack Section: renders · Homepage can include profile/stack content
- Home → Contact Section: renders · Homepage can include contact CTA
- Goodnotes Route → Case Content: includes · Route entry delegates to long-form content
- Case Content → Assets: imports · Case-study content uses local assets
- Case Content → Public Media: references · Long-form content can embed direct media
- Project 1 → Handoff Docs: references · Project presentation may draw from handoff artifacts
- Project 2 → Handoff Docs: references · Project presentation may draw from handoff artifacts
- Home → Global CSS: styles · Global stylesheet affects all pages
- About → Global CSS: styles · Global stylesheet affects all pages
- Work Index → Global CSS: styles · Global stylesheet affects all pages
- Goodnotes Route → Global CSS: styles · Global stylesheet affects all pages
- CS Auth → Middleware: protected by · Request flow is shaped by middleware
- Home → CS Auth: may call · Special site behavior can reach the API route
- Work Index → CS Auth: may call · Special site behavior can reach the API route
- Astro Config → Home: builds · Astro config drives page generation
- Astro Config → CS Auth: builds · Astro config applies to API route generation
