# munishmummadi/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a monolithic, full-stack “personal portfolio” website built with Next.js (React framework) and styled via Tailwind CSS.
- Purpose: display a developer’s projects, timeline, status, and personal information in a modern, responsive, SEO-friendly site, hosted (e.g., on Vercel).

##### File structure
- Top-level folders:
- public/ – static assets (images, favicons, sounds, shaders)
- src/pages/ – Next.js file-based routes (404, index, projects, status, timeline, error)
- src/components/ – reusable UI components (Button, Navbar, List, Status widgets, Background)
- src/layouts/ – page wrappers (Default and Error layouts)
- src/lib/ – utility modules (SEO, navigation, sounds, API calls such as lanyard.ts for Discord status)
- src/data/ – local JSON data (projects.json, timeline.json)
- src/types/ – TypeScript type definitions
- Configuration: next.config.js, tailwind.config.js, tsconfig.json, vercel.json

##### README for additional insights
- Architecture: Next.js 14, SSR by default, static generation for data-driven pages.
- Tech stack: React + TypeScript on the front end; Tailwind CSS for styling; no external database—data is read from JSON or fetched at runtime via lanyard API.

##### Main components
a. Client Browser
b. CDN (e.g., Vercel Edge Network)
c. Next.js Server (Node.js runtime)
d. React Components & Layouts (UI layer)
e. Data Sources
- Local JSON files (projects.json, timeline.json)
- External API (Discord status via Lanyard)
f. Static Assets (public/)
g. Build & Deployment Pipeline (Vercel, pnpm/npm scripts)

##### Relationships and data flow
- Client → CDN → Next.js server / cached static page
- Next.js server
- At build time: reads src/data/*.json → generates static HTML/JSON
- At runtime (SSR): processes React components, may call lanyard API → HTML + props → client
- Public assets served by CDN directly
- Client sends interactions/events (e.g., dark mode toggle) to React state (src/lib/state.ts)

##### Architectural patterns and design principles
- Component-Based UI (src/components)
- File-Based Routing (src/pages)
- Hybrid Rendering:
- Static Generation (SSG) for projects & timeline
- Server-Side Rendering (SSR) for dynamic status page
- Utility modules (src/lib) for cross-cutting concerns (SEO, navigation, state)
- Type-Safe code (TypeScript + src/types)

##### Relevant technologies/frameworks
- Next.js (routing, SSR/SSG, API routes)
- React (UI library)
- Tailwind CSS (utility-first styling)
- TypeScript
- Vercel (hosting & CDN)
- Lanyard API (Discord presence integration)

##### Elements
- Clear labels for nodes (Browser, CDN, Next.js Server, JSON Data, External API, Static Assets)
- Blue for client-side components
- Green for server/runtime
- Orange for data sources
- Gray for static assets/CDN
- Rectangles for services/components (Next.js, React)

##### Detail
- React component category (UI widgets, layouts, pages) if needed for a deep-dive
- SSR vs. SSG pathways distinctly
- Call out configuration & deployment (vercel.json, next.config.js) as part of the pipeline

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    subgraph "Client Side"
        direction TB
        Browser["Client Browser"]:::client
        UI["UI Layer (React Components)"]:::client
        Browser -->|"renders"| UI
        UI -->|"requests pages/assets"| CDN
    end

    %% CDN / Hosting
    subgraph "CDN & Hosting"
        direction TB
        CDN["Vercel CDN / Edge Network"]:::cdn
        StaticAssets["Static Assets (public/)"]:::assets
        CDN --> StaticAssets
        CDN --> NextServer
    end

    %% Next.js Server
    subgraph "Next.js Server"
        direction TB
        NextServer["Next.js Server (Node.js)"]:::server
        Pages["Pages & Routing"]:::client
        Layouts["Layouts (Default & Error)"]:::client
        GlobalApp["Global App (_app.tsx / _document.tsx)"]:::client
        SSR["Server-Side Rendering (SSR)"]:::server
        SSG["Static Site Generation (SSG)"]:::server
        Config["Config (next.config.js)"]:::server

        NextServer --> Pages
        NextServer --> Layouts
        NextServer --> GlobalApp
        NextServer --> SSR
        NextServer --> SSG
        Config -.-> NextServer
    end

    %% Data Sources
    subgraph "Data Sources"
        direction TB
        JSONProjects["projects.json"]:::data
        JSONTimeline["timeline.json"]:::data
        LanyardAPI["Discord Status API (Lanyard)"]:::data
    end

    %% Utilities & Types
    subgraph "Utilities & Types"
        direction TB
        SEO["SEO Module"]:::utils
        Navigation["Navigation Module"]:::utils
        Sounds["Sounds Module"]:::utils
        State["State Module"]:::utils
        ProjectsHelper["Projects Helper"]:::utils
        Types["Type Definitions"]:::utils
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        Build["pnpm / npm Scripts"]:::pipeline
        VercelConfig["Vercel Config (vercel.json)"]:::pipeline
        Build --> NextServer
        Build --> StaticAssets
        Build --> SSG
        VercelConfig -.-> CDN
    end

    %% Relationships
    SSG -->|"reads"| JSONProjects
    SSG -->|"reads"| JSONTimeline
    SSR -->|"fetches"| LanyardAPI
    Pages --> SSR
    Pages --> SSG
    UI --> Pages
    NextServer --> SEO
    NextServer --> Navigation
    NextServer --> Sounds
    NextServer --> State
    NextServer --> ProjectsHelper
    NextServer --> Types

    %% Click Events
    click UI "https://github.com/munishmummadi/portfolio/tree/main/src/components/"
    click Pages "https://github.com/munishmummadi/portfolio/tree/main/src/pages/"
    click Layouts "https://github.com/munishmummadi/portfolio/blob/main/src/layouts/Default.layout.tsx"
    click Layouts "https://github.com/munishmummadi/portfolio/blob/main/src/layouts/Error.layout.tsx"
    click JSONProjects "https://github.com/munishmummadi/portfolio/blob/main/src/data/projects.json"
    click JSONTimeline "https://github.com/munishmummadi/portfolio/blob/main/src/data/timeline.json"
    click LanyardAPI "https://github.com/munishmummadi/portfolio/blob/main/src/lib/lanyard.ts"
    click SEO "https://github.com/munishmummadi/portfolio/blob/main/src/lib/seo.ts"
    click Navigation "https://github.com/munishmummadi/portfolio/blob/main/src/lib/navigation.tsx"
    click Sounds "https://github.com/munishmummadi/portfolio/blob/main/src/lib/sounds.ts"
    click State "https://github.com/munishmummadi/portfolio/blob/main/src/lib/state.ts"
    click ProjectsHelper "https://github.com/munishmummadi/portfolio/blob/main/src/lib/projects.ts"
    click Types "https://github.com/munishmummadi/portfolio/tree/main/src/types/"
    click StaticAssets "https://github.com/munishmummadi/portfolio/tree/main/public/"
    click Config "https://github.com/munishmummadi/portfolio/blob/main/next.config.js"
    click Build "https://github.com/munishmummadi/portfolio/blob/main/package.json"
    click VercelConfig "https://github.com/munishmummadi/portfolio/blob/main/vercel.json"

    %% Styles
    classDef client fill:#E0F7FA,stroke:#0288D1,stroke-width:1px
    classDef cdn fill:#ECEFF1,stroke:#90A4AE,stroke-width:1px
    classDef server fill:#C8E6C9,stroke:#388E3C,stroke-width:1px
    classDef data fill:#FFE0B2,stroke:#F57C00,stroke-width:1px
    classDef utils fill:#F3E5F5,stroke:#8E24AA,stroke-width:1px
    classDef assets fill:#ECEFF1,stroke:#607D8B,stroke-width:1px
    classDef pipeline fill:#FFECB3,stroke:#FFA000,stroke-width:1px
```
