# manu-hn/manuhn-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/manu-hn/manuhn-portfolio
- Repository: https://github.com/manu-hn/manuhn-portfolio

## Overview

##### Project type and purpose
- This is a personal “Next.js Portfolio” site built with Next.js 13’s App Router.
- It’s primarily a front-end React/TypeScript application with server-side support for a contact form (sendEmail action).
- It uses static assets (images, logos, project thumbnails), a Redux store for theme or UI state, and integrates an external email service for inbound messages.

##### File structure
- Top-level config: next.config.mjs, tailwind.config.ts, postcss.config.mjs, tsconfig.json → Build and styling toolchain (Next.js + Tailwind).
- public/ → Static assets served at build time via CDN.
- src/app/ → Next.js 13 App Router: global CSS, layout.tsx (root layout), page.tsx (home page).
- src/components/ → UI broken down by feature (header, footer, intro, about, experience, skills, projects, contact, theme provider, notice-provider).
- src/actions/sendEmail.tsx → A Next.js Server Action or API route to handle form submissions.
- src/store/ → Redux state management (themeSlice, provider, hooks).
- src/lib/ → Custom hooks and utility functions.
- src/constants, src/types → Strongly-typed data and configuration for resume entries, skills, social links.

##### Key insights from the README
- Confirms the site’s purpose: a Next.js portfolio.

a. Main components
– User’s Browser (Client)
– Next.js App Server (SSR/SSG runtime + Server Actions)
– React Component Tree (src/app + src/components)
– Redux Store (client-side state for theme/UI)
– Static Asset Store (public/ folder served via CDN)
– External Email Service (SMTP or third-party API used in sendEmail)
– Hosting/CDN (e.g., Vercel)
b. Relationships & data flows
1. User requests page → Next.js Server routes via src/app layout/page → SSR or SSG → delivered HTML/CSS/JS.
2. React hydrates in the browser → component tree initialized → Redux store sets initial theme state.
3. User interacts (navigation, carousel, form) → component event handlers → Redux updates or Server Action calls.
4. Contact form submit → sendEmail Server Action → communicates with External Email Service → returns success/error.
5. UI shows notification via NotistackProvider.
6. Static assets (images, logos) fetched directly from CDN.
c. Architectural patterns & principles
– Component-based design (UI molecules/organisms/pages).
– Directory-based routing with App Router.
– SSR/SSG hybrid rendering for performance & SEO.
– Redux for centralized UI state (theme toggling).
– Server Actions for backend behavior without separate API folder.
– Utility and constants layers for typed data.
d. Technologies & frameworks
– Next.js 13 (App Router)
– React + TypeScript
– Redux Toolkit
– Tailwind CSS + PostCSS
– Notistack for toast notifications
– Vercel (recommended) for deployment and CDN

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client-side browser
    Browser["User's Browser"]:::frontend

    subgraph "Client-side Shell"
      direction TB
      subgraph "React Component Tree" 
        direction TB
        Header["Header"] 
        Intro["Intro Section"]
        About["About Section"]
        Experience["Experience Section"]
        Skills["Skills Section"]
        Projects["Projects Section"]
        Contact["Contact Section"]
        ThemeProvider["Theme Provider"]
        NoticeProvider["Notification Provider"]
      end
      subgraph "Redux Store"
        direction TB
        Store["Store Config"]
        Slice["themeSlice"]
        ReduxProvider["Redux Provider"]
        Hooks["Store Hooks"]
      end
    end

    %% Server-side Next.js
    subgraph "Next.js Server (SSR/SSG)" 
      direction TB
      C1["App Router\n(src/app/layout.tsx, page.tsx)"]:::server
      C2["Globals CSS\n(src/app/globals.css)"]:::server
      EAction["sendEmail Action"]:::server
    end

    %% External services
    G["Static Assets CDN"]:::external
    H["External Email API"]:::external

    %% Data flows
    Browser -->|"HTTP Request"| C1
    C1 -->|"Serves HTML/CSS/JS"| Browser
    Browser -->|"Hydrate"| Header
    Header -->|uses| Store
    Store -->|provides state| Header
    Browser -->|"Fetch assets"| G
    Contact -->|"Server Action"| EAction
    EAction -->|"Calls Email API"| H
    H -->|"Response"| EAction
    EAction -->|"Result"| Contact
    C1 -->|uses| C2

    %% Click events for component mapping
    click C1 "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/app/layout.tsx"
    click C1 "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/app/page.tsx"
    click C2 "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/app/globals.css"
    click Header "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/header/index.tsx"
    click Intro "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/intro/index.tsx"
    click About "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/about/index.tsx"
    click Experience "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/experience/index.tsx"
    click Skills "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/skills/index.tsx"
    click Projects "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/projects/index.tsx"
    click Contact "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/contact/index.tsx"
    click ThemeProvider "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/theme/index.tsx"
    click NoticeProvider "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/components/notice-provider/NotistackProvider.tsx"
    click Store "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/store/store.ts"
    click Slice "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/store/slice/themeSlice.ts"
    click ReduxProvider "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/store/ReduxProvider.tsx"
    click Hooks "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/store/hooks.ts"
    click EAction "https://github.com/manu-hn/manuhn-portfolio/blob/main/src/actions/sendEmail.tsx"

    %% Class definitions
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef server fill:#D6F5D6,stroke:#28a745,color:#22863a;
    classDef external fill:#FFE8A1,stroke:#d28806,color:#bf8700;
```
