# sarmad259/portfolio architecture

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

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

## Overview

##### Project Type & Purpose
- This is a Next.js 13 “app-router” frontend application that renders a chat-style UI to display GitHub and LinkedIn data.
- It syncs with the v0.dev platform (your chat builder), pushes code into this GitHub repo, and is automatically built & deployed on Vercel.

##### File-Structure Analysis
- app/
- layout.tsx, page.tsx, globals.css → Next.js “app”-directory entry points and global CSS.
- components/
- theme-provider.tsx → top-level ThemeContext wrapper.
- ui/… → 40+ reusable UI primitives (buttons, cards, dialogs, etc.)
- hooks/ → custom React hooks (useMobile, useToast)
- lib/utils.ts → shared helper functions
- public/images → static assets
- styles/, tailwind.config.ts, postcss.config.mjs → styling stack (TailwindCSS)
- next.config.mjs, tsconfig.json, package.json, pnpm-lock.yaml → build & config files

##### README Insights
- Explains the automatic GitHub sync triggered by changes in v0.dev.
- Mentions Vercel deployment and live URL.
- No in-repo backend—data fetching likely occurs client-side or via v0.dev APIs embedded in page.tsx.

a. Frontend (blue)
- Next.js app (app/layout.tsx & app/page.tsx)
- UI Library (components/ui)
- Custom hooks (hooks/)
- Client browser environment
b. External Services (orange)
- v0.dev chat & sync service
- GitHub API (to fetch repos, commits, stars, etc.)
- LinkedIn API (to fetch profile, posts)
c. CI/CD & Version Control (green)
- GitHub repository
- Vercel build & deployment platform

##### Component Relationships & Data Flow
- Developer → (push) → GitHub Repo
- GitHub → (webhook) → Vercel → (build & deploy) → Live Next.js App
- User Browser ↔ Next.js Frontend (SSR/CSR)
- Next.js Frontend → (HTTP REST/GraphQL) → GitHub API & LinkedIn API
- Next.js Frontend ↔ v0.dev Service (for real-time chat UI & sync)

##### Architectural Patterns & Design Principles
- “Separation of concerns”:
- Presentation (components/ui) vs. data hooks (hooks/) vs. page/layout (app/)
- CSS-in-JS + Tailwind combination for utility-first styling
- CI/CD pipeline connecting v0.dev → GitHub → Vercel for automated deploys

## Diagram (Mermaid)

```mermaid
flowchart TD
    Developer["Developer"]:::cicd

    subgraph "CI/CD & Version Control"
        direction TB
        GitHubRepo["GitHub Repository"]:::cicd
        Vercel["Vercel Platform"]:::cicd
        LiveApp["Live Next.js App"]:::frontend
    end

    Developer -->|"push code"| GitHubRepo
    GitHubRepo -->|"webhook"| Vercel
    Vercel -->|"build & deploy"| LiveApp

    subgraph "Repository Files"
        direction TB
        Layout["app/layout.tsx"]:::repo
        HomePage["app/page.tsx"]:::repo
        GlobalCSS["app/globals.css"]:::repo
        StylesCSS["styles/globals.css"]:::repo
        ThemeProvider["components/theme-provider.tsx"]:::repo
        UILib["components/ui/"]:::repo
        HookMobile["hooks/use-mobile.tsx"]:::repo
        HookToast["hooks/use-toast.ts"]:::repo
        Utils["lib/utils.ts"]:::repo
        TailwindCfg["tailwind.config.ts"]:::repo
        PostCSSCfg["postcss.config.mjs"]:::repo
        NextCfg["next.config.mjs"]:::repo
        TSConfig["tsconfig.json"]:::repo
        PackageJSON["package.json"]:::repo
        Lockfile["pnpm-lock.yaml"]:::repo
        Images["public/images/"]:::repo
    end

    subgraph "Client"
        direction TB
        Browser["User Browser"]:::frontend
        subgraph "Next.js Frontend"
            direction TB
            Layout
            HomePage
            ThemeProvider
            UILib
            HookMobile
            HookToast
            Utils
        end
    end

    Browser <-->|"SSR/CSR"| LiveApp
    LiveApp -.->|"HTTP REST/GraphQL"| GitHubAPI
    LiveApp -.->|"HTTP REST/GraphQL"| LinkedInAPI
    LiveApp <-->|"chat sync"| V0Service

    subgraph "External Services"
        direction TB
        V0Service["v0.dev Chat & Sync Service"]:::external
        GitHubAPI["GitHub API"]:::external
        LinkedInAPI["LinkedIn API"]:::external
    end

    click Layout "https://github.com/sarmad259/portfolio/blob/main/app/layout.tsx"
    click HomePage "https://github.com/sarmad259/portfolio/blob/main/app/page.tsx"
    click GlobalCSS "https://github.com/sarmad259/portfolio/blob/main/app/globals.css"
    click StylesCSS "https://github.com/sarmad259/portfolio/blob/main/styles/globals.css"
    click ThemeProvider "https://github.com/sarmad259/portfolio/blob/main/components/theme-provider.tsx"
    click UILib "https://github.com/sarmad259/portfolio/tree/main/components/ui/"
    click HookMobile "https://github.com/sarmad259/portfolio/blob/main/hooks/use-mobile.tsx"
    click HookToast "https://github.com/sarmad259/portfolio/blob/main/hooks/use-toast.ts"
    click Utils "https://github.com/sarmad259/portfolio/blob/main/lib/utils.ts"
    click TailwindCfg "https://github.com/sarmad259/portfolio/blob/main/tailwind.config.ts"
    click PostCSSCfg "https://github.com/sarmad259/portfolio/blob/main/postcss.config.mjs"
    click NextCfg "https://github.com/sarmad259/portfolio/blob/main/next.config.mjs"
    click TSConfig "https://github.com/sarmad259/portfolio/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/sarmad259/portfolio/blob/main/package.json"
    click Lockfile "https://github.com/sarmad259/portfolio/blob/main/pnpm-lock.yaml"
    click Images "https://github.com/sarmad259/portfolio/tree/main/public/images/"

    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef external fill:#ffe5cc,stroke:#333,stroke-width:1px
    classDef cicd fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef repo fill:#f2f2f2,stroke:#333,stroke-width:1px
```
