# sulemanahmedrajput/personal-portfolio architecture

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

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

## Overview

##### Main System Components

a) Frontend Layer
- Next.js Application (Client & Server Components)
- UI Components Library
- Theme System
- Content Management Integration (Sanity)

b) API Layer
- Contact API Route
- Blog API Integration

c) External Services
- Sanity CMS Integration
- Email Service (for contact form)

**┌─────────────────────────────────────────────┐**
- Next.js Application            │
- ┬─────────────┬──────────────┤
- Page Router  │  Components │    API Layer  │
- ┴─────────────┴──────────────┘

##### Specific Elements

a) Page Structure:
- Root Layout (app/layout.js)
- Home Page (app/page.js)
- Blog Pages (app/blog/*)
- Dynamic Routes

b) Component Categories:
- Custom Components:
- Interactive Components (Hero, Contact)
- Content Components (AboutMe, Skills)
- Layout Components (Navbar, Template)
- UI Components:
- Form Elements
- Interactive Elements
- Layout Elements

c) Integration Points:
- Sanity CMS Connection
- Contact Form API
- Theme System

##### Important Architectural Patterns to Highlight

- Server Components vs Client Components
- API Route Implementation
- Theme Provider Pattern
- Component Composition
- Data Fetching Strategy

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph NextApp["Next.js Application"]
        direction TB
        Layout["Root Layout"]
        Pages["Pages"]
        Components["Components"]
        API["API Layer"]
    end

    subgraph ComponentLayer["Component Layer"]
        direction TB
        CustomComponents["Custom Components"]
        UIComponents["UI Components"]
        
        subgraph Custom["Custom Components"]
            direction TB
            Hero["Hero Section"]
            About["About Section"]
            Skills["Skills Section"]
            Contact["Contact Form"]
            Nav["Navigation"]
            ThemeToggle["Theme Toggle"]
            Template["Page Template"]
            ThemeProvider["Theme Provider"]
        end

        subgraph UI["UI Components"]
            direction TB
            FormElements["Form Elements"]
            Button["Button"]
            Input["Input"]
            Toast["Toast Notifications"]
        end
    end

    subgraph APILayer["API Layer"]
        direction TB
        ContactAPI["Contact API"]
        BlogAPI["Blog API"]
    end

    subgraph ExternalServices["External Services"]
        direction TB
        SanityCMS["Sanity CMS"]
        EmailService["Email Service"]
    end

    %% Connections
    Layout --> Components
    Pages --> Components
    Components --> CustomComponents
    Components --> UIComponents
    Contact --> ContactAPI
    ContactAPI --> EmailService
    BlogAPI --> SanityCMS
    Pages --> BlogAPI

    %% Component Relationships
    ThemeProvider --> ThemeToggle
    Template --> Nav
    Contact --> FormElements
    Contact --> Button
    Contact --> Input
    Contact --> Toast

    %% Styling
    classDef default fill:#ddd,stroke:#333,stroke-width:1px
    classDef external fill:#c9a3ff,stroke:#333
    classDef api fill:#90EE90,stroke:#333
    classDef ui fill:#FFB347,stroke:#333
    classDef custom fill:#87CEEB,stroke:#333

    class SanityCMS,EmailService external
    class ContactAPI,BlogAPI api
    class FormElements,Button,Input,Toast ui
    class Hero,About,Skills,Contact,Nav,ThemeToggle,Template,ThemeProvider custom

    %% Click Events
    click Layout "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/app/layout.js"
    click NextApp "https://github.com/SulemanAhmedRajput/Personal-Portfolio/tree/main/app/"
    click UIComponents "https://github.com/SulemanAhmedRajput/Personal-Portfolio/tree/main/components/ui/"
    click ThemeProvider "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/themeProvider.js"
    click ContactAPI "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/app/api/contact/route.js"
    click BlogAPI "https://github.com/SulemanAhmedRajput/Personal-Portfolio/tree/main/app/blog/"
    click SanityCMS "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/app/lib/sanity.js"
    click Hero "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/Hero.jsx"
    click About "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/AboutMe.jsx"
    click Skills "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/Skills.jsx"
    click Contact "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/Contact.jsx"
    click Nav "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/Navbar.jsx"
    click FormElements "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/ui/form.jsx"
    click Button "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/ui/button.jsx"
    click Input "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/ui/input.jsx"
    click Toast "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/ui/toast.jsx"
    click ThemeToggle "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/ThemeToggle.jsx"
    click Template "https://github.com/SulemanAhmedRajput/Personal-Portfolio/blob/main/components/custom/Template.jsx"
```
