# muhammad-fiaz/portfolio architecture

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

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

## Overview

##### Project Type and Purpose
This is a modern full-stack portfolio website built with Next.js 13+ (App Router), focusing on performance and user experience. The project serves as a personal portfolio website with features like blog posts, projects showcase, and interactive elements.

##### Main Components

A. Frontend Layer:
- Client-Side Components (src/components/)
- Content Components
- UI Components
- Section Components
- Utility Components
- Pages/Routes (src/app/)
- Public Assets (public/)

B. Backend Layer:
- API Routes (pages/api/)
- Authentication (/api/auth)
- Data Fetching endpoints
- Chat API
- Projects API
- RSS Feed API

C. External Services Integration:
- Authentication Service (NextAuth.js)
- GitHub Integration (for contributions, streaks, trophies)
- RSS Feed Service
- Vercel Analytics

**[Client Layer]**
- ↑↓
**[Next.js App Router]**
- ↑↓
**[API Layer]**
- ↑↓
**[External Services]**

##### Important Architectural Elements to Highlight

- Next.js App Router architecture
- API route structure
- Authentication flow
- Static and dynamic content handling
- External service integrations
- Asset management
- Theme system
- Analytics integration

##### Key Relationships to Emphasize

- Component hierarchy in the frontend
- API communication patterns
- Authentication flow
- Data fetching patterns
- State management
- External service interactions

This system design should effectively communicate the project's architecture to both technical and non-technical stakeholders while serving as a valuable reference for future development and maintenance.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[UI Components]
        CC[Content Components]
        SC[Section Components]
        UC[Utility Components]
        Routes["Pages/Routes"]
        Assets["Public Assets"]
        
        UI --> |renders| Routes
        CC --> |renders| Routes
        SC --> |renders| Routes
        UC --> |supports| Routes
    end

    subgraph Core_UI
        Header["Header"]
        Footer["Footer"]
        Nav["Navigation"]
        Mobile["Mobile Menu"]
        
        Header --> Nav
        Nav --> Mobile
    end

    subgraph Theme
        TC["Theme Context"]
        TT["Theme Toggle"]
        
        TC --> TT
    end

    subgraph API_Layer
        Auth["Authentication API"]
        Chat["Chat API"]
        Projects["Projects API"]
        RSS["RSS Feed API"]
    end

    subgraph GitHub_Integration
        GH_Contrib["Contribution History"]
        GH_Streak["GitHub Streak"]
        GH_Trophy["GitHub Trophies"]
    end

    subgraph External_Services
        NextAuth["NextAuth.js"]
        GitHub["GitHub API"]
        RSSService["RSS Service"]
        Analytics["Vercel Analytics"]
    end

    subgraph Configuration
        Config["Main Config"]
        Env["Environment Variables"]
        SiteConfig["Site Configuration"]
    end

    Routes --> API_Layer
    API_Layer --> External_Services
    GitHub_Integration --> GitHub
    Auth --> NextAuth

    %% Component Mappings
    click UI "https://github.com/muhammad-fiaz/portfolio/tree/main/src/components/ui/"
    click CC "https://github.com/muhammad-fiaz/portfolio/tree/main/src/components/content/"
    click SC "https://github.com/muhammad-fiaz/portfolio/tree/main/src/components/sections/"
    click UC "https://github.com/muhammad-fiaz/portfolio/tree/main/src/components/utils/"
    click Routes "https://github.com/muhammad-fiaz/portfolio/tree/main/src/app/(user)/"
    click Auth "https://github.com/muhammad-fiaz/portfolio/blob/main/pages/api/auth/[...nextauth].ts"
    click Chat "https://github.com/muhammad-fiaz/portfolio/blob/main/pages/api/fetch-chat.ts"
    click Projects "https://github.com/muhammad-fiaz/portfolio/blob/main/pages/api/fetch-projects.ts"
    click RSS "https://github.com/muhammad-fiaz/portfolio/blob/main/pages/api/fetchRSS.ts"
    click GH_Contrib "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/content/GitHubContributionHistory.tsx"
    click GH_Streak "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/content/GitHubStreak.tsx"
    click GH_Trophy "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/content/GitHubTrophies.tsx"
    click Header "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/ui/Header.tsx"
    click Footer "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/ui/Footer.tsx"
    click Nav "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/ui/LinksNav.tsx"
    click Mobile "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/ui/MobileMenuNav.tsx"
    click Config "https://github.com/muhammad-fiaz/portfolio/blob/main/src/configs/config.ts"
    click Env "https://github.com/muhammad-fiaz/portfolio/blob/main/src/configs/envVars.ts"
    click SiteConfig "https://github.com/muhammad-fiaz/portfolio/blob/main/next.config.ts"
    click TC "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/utils/themeContext.tsx"
    click TT "https://github.com/muhammad-fiaz/portfolio/blob/main/src/components/utils/ThemeToggle.tsx"
    click Assets "https://github.com/muhammad-fiaz/portfolio/tree/main/public/"

    classDef frontend fill:#3498db,stroke:#2980b9,color:#fff
    classDef api fill:#2ecc71,stroke:#27ae60,color:#fff
    classDef external fill:#9b59b6,stroke:#8e44ad,color:#fff
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:#fff

    class UI,CC,SC,UC,Routes,Core_UI,Theme frontend
    class API_Layer,Auth,Chat,Projects,RSS api
    class External_Services,NextAuth,GitHub,RSSService,Analytics external
    class Configuration,Config,Env,SiteConfig config
```
