# strikertushar19/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (v13 App Router), created via `create-next-app`.
- Its primary purpose is to render React pages on both server and client, optimize fonts with `next/font`, and serve static assets from `public/`.

##### File structure
- Top-level files:
· `next.config.ts`: Next.js configuration
· `tsconfig.json`: TypeScript settings
· `package.json` / `package-lock.json`: dependencies and scripts
· `postcss.config.mjs`: PostCSS pipeline
- “app/” directory (App Router):
· `layout.tsx`: root layout component (shared UI across all pages)
· `page.tsx`: default route’s React component
· `globals.css`: global styles
· `lib/utils/cn.tsx`: utility for class-name merging
- “public/”: static assets (images, favicon)

##### README for additional insights
- Confirms Next.js + React stack, dev scripts (`npm run dev`), Vercel-ready deployment.
- Uses `next/font` for automatic font optimization.

a. Main components
- Browser / Client
- Next.js Application
– React Components (pages, layout)
– Global CSS & PostCSS pipeline
– Utility Library (`app/lib/utils`)
– next/font optimization
- Build Tooling
– Node.js + npm
– TypeScript compiler
- Hosting & Deployment
– Vercel Platform (or custom Node.js server)
- Static Assets
– `public/` folder (served via CDN)

b. Relationships & interactions
1. Developer invokes `npm run dev` → Node.js starts Next.js dev server.
2. Browser requests `http://localhost:3000` → Next.js server handles routing via App Router.
3. Server uses `layout.tsx` + `page.tsx`, applies CSS (via PostCSS and next/font), bundles with Webpack/RSC.
4. HTML + CSS + JS sent to client → React hydrates for client-side interactivity.
5. Static files in `public/` served directly via CDN or static server.
6. On deploy, Vercel runs build (`next build`), produces optimized serverless functions and static assets.

c. Architectural patterns & design principles
- App Router (file-system–based routing)
- Server-Side Rendering (SSR) and Static Site Generation (SSG) hybrid
- Component re-use via `layout.tsx` and utility functions
- CSS isolation with global stylesheet plus optional module scope

d. Key technologies & libraries
- Next.js (app directory, SSR/SSG)
- React 18 (Server Components + Client Components)
- TypeScript
- PostCSS / Tailwind or custom CSS pipeline (configured in `postcss.config.mjs`)
- next/font for font optimization
- Vercel for CI/CD and hosting

##### Detail
- Every piece: build scripts in `package.json`, config in `next.config.ts`, utility libs.
- File locations to runtime components.
- Don’t overcomplicate – separate into as many logical components as possible to clearly show responsibilities.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build & Deploy Lane
    subgraph "Build & Deploy"
        direction TB
        NodeJS["Node.js + npm"]:::server
        TSCompiler["TypeScript Compiler"]:::server
        NextBuild["Next.js Build"]:::server
        Vercel["Vercel Platform"]:::server
        PackageJSON["package.json / package-lock.json"]:::server
        TSConfig["tsconfig.json"]:::server
        NextConfig["next.config.ts"]:::server
        PostCSSConfig["postcss.config.mjs"]:::server
    end

    %% Runtime Lane
    subgraph "Runtime"
        direction TB
        Browser["Browser / Client"]:::client
        DevServer["Next.js Dev Server"]:::server
        NextServer["Next.js Server (SSR/SSG)"]:::server
        subgraph "React Components"
            direction TB
            Layout["app/layout.tsx"]:::client
            Page["app/page.tsx"]:::client
            UtilsDir["app/lib/utils/"]:::server
            CNUtil["app/lib/utils/cn.tsx"]:::server
        end
        subgraph "CSS Pipeline"
            direction TB
            GlobalsCSS["app/globals.css"]:::static
            PostCSS["PostCSS Processing"]:::server
            BundledCSS["Bundled CSS"]:::static
        end
        CDN["Public Assets (public/)"]:::static
    end

    %% Build & Deploy Flow
    NodeJS -->|runs scripts from| PackageJSON
    NodeJS -->|installs deps via| PackageJSON
    NodeJS --> TSCompiler
    TSCompiler -->|uses config| TSConfig
    NodeJS --> NextBuild
    NextBuild -->|reads config| NextConfig
    NextBuild -->|processes CSS| PostCSSConfig
    NextBuild --> Vercel

    %% Runtime Flow
    Browser -->|HTTP request| DevServer
    DevServer --> NextServer
    NextServer --> ReactComponents{"Render Components"}:::server
    ReactComponents --> Layout
    ReactComponents --> Page
    ReactComponents --> CNUtil
    CNUtil --> UtilsDir
    NextServer -->|apply styles| BundledCSS
    BundledCSS --> Browser
    GlobalsCSS --> PostCSS
    PostCSS --> BundledCSS
    NextServer --> CDN
    Browser -->|fetch static assets| CDN

    %% Click events
    click NextConfig "https://github.com/strikertushar19/portfolio/blob/main/next.config.ts"
    click TSConfig "https://github.com/strikertushar19/portfolio/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/strikertushar19/portfolio/blob/main/package.json"
    click PackageJSON "https://github.com/strikertushar19/portfolio/blob/main/package-lock.json"
    click PostCSSConfig "https://github.com/strikertushar19/portfolio/blob/main/postcss.config.mjs"
    click Layout "https://github.com/strikertushar19/portfolio/blob/main/app/layout.tsx"
    click Page "https://github.com/strikertushar19/portfolio/blob/main/app/page.tsx"
    click GlobalsCSS "https://github.com/strikertushar19/portfolio/blob/main/app/globals.css"
    click CNUtil "https://github.com/strikertushar19/portfolio/blob/main/app/lib/utils/cn.tsx"
    click UtilsDir "https://github.com/strikertushar19/portfolio/tree/main/app/lib/utils/"
    click CDN "https://github.com/strikertushar19/portfolio/tree/main/public/"

    %% Styling
    classDef server fill:#D0E6FF,stroke:#333,stroke-width:1px
    classDef client fill:#D1FFD1,stroke:#333,stroke-width:1px
    classDef static fill:#FFDDAA,stroke:#333,stroke-width:1px
```
