# namanbarkiya/minimal-next-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/namanbarkiya/minimal-next-portfolio
- Repository: https://github.com/namanbarkiya/minimal-next-portfolio

## Overview

##### Project type and purpose
- This is a full-stack, server-rendered portfolio web application built with Next.js 14.
- Purpose: showcase a developer’s skills, experience, projects, and provide a contact form.

##### File structure
- **app/** – Next.js App Router (server and client components).
- Routes for pages: `/`, `/career`, `/experience`, `/skills`, `/contact`, `/resume`, `/contributions`.
- `app/api/contact/route.ts` – serverless API endpoint for contact form.
- `app/layout.tsx`, `app/globals.css`, `app/manifest.ts`, `app/sitemap.ts` – global layout, styling, SEO.
- **components/** – UI and feature components, organized by domain:
- `components/common` – navigation, theme toggling, analytics wrapper, layout containers.
- `components/ui` – design system primitives (buttons, cards, dialogs, inputs).
- Feature-specific folders: `career`, `experience`, `skills`, `contributions`, `contact`, `modals`, `forms`.
- **config/** – JSON/TS files holding static data: site metadata, routes, career entries, experiences, skills, contributions, socials.
- **hooks/** – React hooks for modal state and body scroll locking.
- **providers/** – context providers for animations, modals, theme.
- **lib/** – utility functions.
- **next.config.js**, **tailwind.config.js**, **tsconfig.json**, linting & formatting config – build and deployment settings.

##### README insights
- Emphasizes SSR, TypeScript, Tailwind + shadcn/ui, Framer Motion, server actions for forms, Google/Vercel Analytics, Vercel deployment.
- No database: contact form likely emails or posts to external service.

a. Main components to include:
- **Client Browser** – renders React pages, handles animations, interacts with UI components.
- **Next.js Server** – handles SSR/SSG for each route, serves static assets, runs server actions.
- **Serverless API** – the `/api/contact` route for form submissions.
- **External Services** – Google Analytics, Vercel Analytics, email or form-processing service.
- **Static Storage / CDN** – Vercel’s CDN for assets under `/public` and optimized images.
b. Relationships & data flows:
- Browser → Next.js Server: HTTP GET for pages.
- Next.js Server → Browser: HTML + CSS + JS bundles.
- Browser (client-side) → Serverless API: POST contact form.
- Serverless API → External form/email service: delivers form data.
- Browser ↔ Google/Vercel Analytics: tracking calls.
- Next.js build → Vercel Deployment → Static assets delivered via CDN.
c. Architectural patterns & principles:
- **App Router (Next.js 14)** – co-locates routes and layout, SSR/SSG hybrid.
- **Component-based design** – shadcn/ui primitives + custom feature components.
- **Unidirectional data flow** – React props & server actions.
- **Serverless functions** – lightweight micro-endpoint for contact form.
- **Configuration-as-code** – `config/` drives dynamic page generation without code changes.
d. Key technologies & frameworks:
- **Next.js 14**, **React**, **TypeScript**
- **Tailwind CSS**, **shadcn/ui**, **Framer Motion**
- **Vercel Serverless Functions**, **Vercel Analytics**, **Google Analytics**

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Browser"
        direction TB
        Browser["Client Browser"]:::frontend
        UIComponents["UI & Components (components/)"]:::frontend
    end

    %% Server Layer
    subgraph "Next.js Server"
        direction TB
        AppRouter["App Router (app/)"]:::backend
        GlobalLayout["Global Layout & Metadata"]:::backend
        subgraph "Page Routes"
            direction TB
            HomePage["Home Page"]:::backend
            CareerListing["Career Listing"]:::backend
            CareerDetail["Career Detail"]:::backend
            ExperienceListing["Experience Listing"]:::backend
            ExperienceDetail["Experience Detail"]:::backend
            ContributionsPage["Contributions"]:::backend
            SkillsPage["Skills"]:::backend
            ContactPage["Contact"]:::backend
            ResumePage["Resume"]:::backend
        end
        ServerlessAPI["Contact API Function"]:::backend
        ConfigLayer["Configuration/Data Layer"]:::backend
        Providers["Context Providers"]:::backend
        Hooks["State & Side-Effect Hooks"]:::backend
        LibUtils["Utility Functions"]:::backend
    end

    %% CDN & Deployment
    subgraph "Static Storage / CDN"
        direction TB
        CDN["Public CDN (assets & public/)"]:::static
    end

    subgraph "Deployment"
        direction TB
        Vercel["Vercel Platform"]:::external
    end

    %% External Services
    subgraph "External Services"
        direction TB
        GA["Google Analytics"]:::external
        VercelAnalytics["Vercel Analytics"]:::external
        EmailService["Email/Form Service"]:::external
    end

    %% Connections
    Browser -->|"HTTP GET /pages"| AppRouter
    AppRouter -->|"SSR/SSG"| Browser
    Browser -->|"Client-side interactions"| UIComponents
    Browser -->|"POST /api/contact"| ServerlessAPI
    ServerlessAPI -->|"Forward form data"| EmailService
    Browser -->|"Analytics events"| GA
    Browser -->|"Analytics events"| VercelAnalytics
    Vercel -->|"Deploy build"| AppRouter
    AppRouter -->|"Serve static assets"| CDN
    Browser -->|"Load fonts & images"| CDN

    %% Click Events - App Router & Pages
    click AppRouter "https://github.com/namanbarkiya/minimal-next-portfolio/tree/master/app/(root)/"
    click HomePage "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/page.tsx"
    click CareerListing "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/career/page.tsx"
    click CareerDetail "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/career/[careerId]/page.tsx"
    click ExperienceListing "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/experience/page.tsx"
    click ExperienceDetail "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/experience/[expId]/page.tsx"
    click ContributionsPage "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/contributions/page.tsx"
    click SkillsPage "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/skills/page.tsx"
    click ContactPage "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/contact/page.tsx"
    click ResumePage "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/(root)/resume/page.tsx"

    %% Click Events - Global Layout & Metadata
    click GlobalLayout "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/layout.tsx"
    click GlobalLayout "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/globals.css"
    click GlobalLayout "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/manifest.ts"
    click GlobalLayout "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/sitemap.ts"

    %% Click Events - Serverless API
    click ServerlessAPI "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/app/api/contact/route.ts"

    %% Click Events - UI & Feature Components
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/tree/master/components/common/"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/tree/master/components/ui/"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/career/timeline.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/experience/exp-description.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/experience/project-card.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/skills/skills-card.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/skills/rating.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/contributions/contribution-card.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/forms/contact-form.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/contact/github-redirect-card.tsx"
    click UIComponents "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/modals/custom-modal.tsx"

    %% Click Events - Config
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/site.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/routes.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/pages.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/constants.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/career.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/experience.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/skills.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/contributions.ts"
    click ConfigLayer "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/config/socials.ts"

    %% Click Events - Hooks & Providers & Lib
    click Hooks "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/hooks/use-modal-store.ts"
    click Hooks "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/hooks/use-lock-body.ts"
    click Providers "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/providers/animation-provider.tsx"
    click Providers "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/providers/modal-provider.tsx"
    click Providers "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/components/common/theme-provider.tsx"
    click LibUtils "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/lib/utils.ts"

    %% Click Events - Static Assets & CDN
    click CDN "https://github.com/namanbarkiya/minimal-next-portfolio/tree/master/assets/fonts/"
    click CDN "https://github.com/namanbarkiya/minimal-next-portfolio/tree/master/public/"

    %% Click Events - Build & Tooling
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/next.config.js"
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/tailwind.config.js"
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/postcss.config.js"
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/tsconfig.json"
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/.eslintrc.json"
    click Vercel "https://github.com/namanbarkiya/minimal-next-portfolio/blob/master/.prettierrc"

    %% Styles
    classDef frontend fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef backend fill:#cce0ff,stroke:#333,stroke-width:1px
    classDef external fill:#ffddcc,stroke:#333,stroke-width:1px
    classDef static fill:#eeeeee,stroke:#333,stroke-width:1px
```
