# saki007ster/next-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/saki007ster/next-portfolio
- Repository: https://github.com/saki007ster/next-portfolio

## Overview

##### Project type and purpose
- This is a full-stack, content-driven Next.js web application (a blog/portfolio site) using the App Router.
- It statically generates most pages from local Markdown files under `content/blog`, supports a dynamic API route for the contact form, and uses React + TypeScript + Tailwind CSS for styling.

##### File structure
- Top-level folders
- `content/blog` – Markdown source files for blog posts
- `public` – Static assets (images, favicon, etc.)
- `src/app` – Next.js App Router routes (page.tsx, layout.tsx, API routes)
- `src/components` – Reusable UI components (BlogCard, Navbar, MarkdownRenderer, etc.)
- Config files
- `next.config.ts` – Next.js configuration
- `tailwind.config.ts` + `postcss.config.mjs` – Tailwind/PostCSS setup
- `tsconfig.json` – TypeScript settings
- `eslint.config.mjs` – Linting rules
- API route
- `src/app/api/contact/route.ts` – Serverless function handling form submissions (e.g., send email)

##### Extract insights from README
- Uses Next.js CLI via `create-next-app`
- Employs `next/font` for automatic font optimization
- Encourages Vercel for deployment (default target)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build-Time Layer
    subgraph "Build-Time Layer"
        direction TB
        MD["Markdown Content Store"]:::static
        Public["Public Assets"]:::static
        CSS["CSS Pipeline (Tailwind→PostCSS)"]:::dynamic
        SSG["Next.js SSG Engine"]:::dynamic

        subgraph "App Router (src/app)"
            direction TB
            Globals["Global Styles"]:::static
            Layout["Layout Component"]:::static
            Home["Home Page Route"]:::static
            About["About Page Route"]:::static
            BlogListPage["Blog List Page Route"]:::static
            BlogDetailPage["Blog Detail Page Route"]:::static
            ProjectsPage["Projects Page Route"]:::static
            ContactPage["Contact Page Route"]:::static
        end

        subgraph "UI Component Library (src/components)"
            direction TB
            Nav["Navbar"]:::static
            Hero["Hero"]:::static
            BlogCard["BlogCard"]:::static
            BlogListComp["BlogList"]:::static
            BlogDetailComp["BlogDetail"]:::static
            MarkdownR["Markdown Renderer"]:::static
            ContactForm["Contact Form"]:::static
            GiscusComp["Giscus Comments Widget"]:::static
            ProjectsList["Projects Listing"]:::static
            HomeClient["Home Page Client Content"]:::static
            ProjectsClient["Projects Page Client Content"]:::static
        end

        MD --> SSG
        Public --> SSG
        CSS --> SSG
        Globals --> SSG
        Layout --> SSG
        Home --> SSG
        About --> SSG
        BlogListPage --> SSG
        BlogDetailPage --> SSG
        ProjectsPage --> SSG
        ContactPage --> SSG
        Nav --> SSG
        Hero --> SSG
        BlogCard --> SSG
        BlogListComp --> SSG
        BlogDetailComp --> SSG
        MarkdownR --> SSG
        ContactForm --> SSG
        GiscusComp --> SSG
        ProjectsList --> SSG
        HomeClient --> SSG
        ProjectsClient --> SSG

        SSG -->|Generates HTML/CSS/JS| CDN
    end

    %% Runtime Layer
    subgraph "Runtime Layer"
        direction TB
        Client["Client Browser"]:::client
        CDN["Vercel CDN / Edge"]:::external
        NextJS["Next.js Serverless / SSR"]:::dynamic
        API["Contact API Route"]:::dynamic
        Email["Email Provider"]:::external
        Giscus["Giscus Comments Widget"]:::external
        Font["Font CDN"]:::external

        Client -->|Requests Page| CDN
        CDN -->|Serves Static Assets| Client
        Client -->|Hydrates React| NextJS
        Client -->|POST /api/contact| API
        API -->|Sends Email| Email
        Client -->|Loads Comments| Giscus
        Client -->|Loads Fonts| Font
    end

    %% Click Events
    click MD "https://github.com/saki007ster/next-portfolio/tree/main/content/blog/"
    click Public "https://github.com/saki007ster/next-portfolio/tree/main/public/"
    click Globals "https://github.com/saki007ster/next-portfolio/blob/main/src/app/globals.css"
    click Layout "https://github.com/saki007ster/next-portfolio/blob/main/src/app/layout.tsx"
    click Home "https://github.com/saki007ster/next-portfolio/blob/main/src/app/page.tsx"
    click About "https://github.com/saki007ster/next-portfolio/blob/main/src/app/about/page.tsx"
    click BlogListPage "https://github.com/saki007ster/next-portfolio/blob/main/src/app/blog/page.tsx"
    click BlogDetailPage "https://github.com/saki007ster/next-portfolio/blob/main/src/app/blog/[slug]/page.tsx"
    click ProjectsPage "https://github.com/saki007ster/next-portfolio/blob/main/src/app/projects/page.tsx"
    click ContactPage "https://github.com/saki007ster/next-portfolio/blob/main/src/app/contact/page.tsx"
    click API "https://github.com/saki007ster/next-portfolio/blob/main/src/app/api/contact/route.ts"
    click Nav "https://github.com/saki007ster/next-portfolio/blob/main/src/components/Navbar.tsx"
    click Hero "https://github.com/saki007ster/next-portfolio/blob/main/src/components/Hero.tsx"
    click BlogCard "https://github.com/saki007ster/next-portfolio/blob/main/src/components/BlogCard.tsx"
    click BlogListComp "https://github.com/saki007ster/next-portfolio/blob/main/src/components/BlogList.tsx"
    click BlogDetailComp "https://github.com/saki007ster/next-portfolio/blob/main/src/components/BlogDetail.tsx"
    click MarkdownR "https://github.com/saki007ster/next-portfolio/blob/main/src/components/MarkdownRenderer.tsx"
    click ContactForm "https://github.com/saki007ster/next-portfolio/blob/main/src/components/Contact.tsx"
    click GiscusComp "https://github.com/saki007ster/next-portfolio/blob/main/src/components/GiscusComments.tsx"
    click ProjectsList "https://github.com/saki007ster/next-portfolio/blob/main/src/components/Projects.tsx"
    click HomeClient "https://github.com/saki007ster/next-portfolio/blob/main/src/components/HomePageClientContent.tsx"
    click ProjectsClient "https://github.com/saki007ster/next-portfolio/blob/main/src/components/ProjectsPageClientContent.tsx"

    %% Styles
    classDef static fill:#E0F7FA,stroke:#006064,stroke-width:1px
    classDef dynamic fill:#E8F5E9,stroke:#2E7D32,stroke-width:1px
    classDef external fill:#FFF3E0,stroke:#EF6C00,stroke-width:1px
    classDef client fill:#ECEFF1,stroke:#546E7A,stroke-width:1px
    class CDN,SSG,NextJS dynamic
    class MD,Public,Globals,Layout,Home,About,BlogListPage,BlogDetailPage,ProjectsPage,ContactPage,Nav,Hero,BlogCard,BlogListComp,BlogDetailComp,MarkdownR,ContactForm,GiscusComp,ProjectsList,HomeClient,ProjectsClient static
```
