# srijani-chakroborty/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/srijani-chakroborty/my-portfolio
- Repository: https://github.com/srijani-chakroborty/my-portfolio

## Overview

##### Project Type and Purpose
- This is a full-stack (mostly front-end) portfolio website built with Next.js, styled via Tailwind CSS, with animations provided by Framer Motion.
- There is a minimal API layer (`src/pages/api/hello.js`), but the primary focus is on server-side-rendered (SSR) and statically-generated (SSG) pages.

##### File Structure
- Top-level configuration:
- `.eslintrc.json`, `jsconfig.json` for linting and path aliases
- `next.config.js`, `postcss.config.js`, `tailwind.config.js` for build and styling
- `src/components/`: reusable React components (e.g., `NavBar`, `Footer`, `AnimatedText`, custom hooks)
- `src/pages/`: Next.js page-based routing (`index.js`, `about.js`, `projects.js`, `articles.js`) + API routes
- `src/styles/`: CSS modules and global styles

##### Main System Components
A. Browser / Client
- User’s web browser interacting via HTTP/HTTPS
B. Next.js Serverless Runner
- Handles SSR and SSG pages
- Serves dynamic content from `src/pages/*.js`
C. Static File Server / CDN
D. API Layer
- Next.js API Routes (`src/pages/api/hello.js`)
- Node.js process running `next build`/`next start`
- PostCSS & TailwindCSS integration
F. External Libraries
- Framer Motion (animations)
- Tailwind CSS (utility-first styling)
- PostCSS, ESLint, jsconfig

##### Architectural Patterns & Design Principles
- Component-Based UI: modular React components under `src/components/`
- Page-Based Routing: automatic file-system–based routing in `src/pages/`
- Hybrid Rendering: SSR for dynamic pages, SSG for static pages (e.g., projects, articles)
- Separation of Concerns:
- Components vs. Pages vs. Styles vs. Public assets
- Build configuration vs. source code

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser/Client
    Browser["Browser / Client"]:::ui

    %% Next.js Serverless Runner and its pages/components
    subgraph "Next.js Serverless Runner"
        direction TB
        Runner["Next.js Serverless Runner"]:::compute
        subgraph "Pages & Components"
            direction TB
            App["_app.js"]:::ui
            Doc["_document.js"]:::ui
            Home["index.js (SSR/SSG)"]:::ui
            About["about.js (SSG)"]:::ui
            Projects["projects.js (SSG)"]:::ui
            Articles["articles.js (SSG)"]:::ui
            Components["src/components/"]:::ui
        end
    end

    %% API Layer
    API["/api/hello"]:::compute

    %% Static Assets CDN
    subgraph "Static Assets CDN"
        direction TB
        Images["public/images/"]:::storage
        PDF["public/dummy.pdf"]:::storage
        Texts["public/All-Texts/"]:::storage
    end

    %% Build & Deployment Pipeline
    Build["Build & Deployment Pipeline"]:::service

    %% Config & External Libraries
    subgraph "Config & External Libraries"
        direction TB
        pkg["package.json"]:::config
        ESLint[".eslintrc.json"]:::config
        jscfg["jsconfig.json"]:::config
        postcss["postcss.config.js"]:::config
        tailwind["tailwind.config.js"]:::config
    end

    %% Data Flows
    Browser -->|"HTTP GET /"| Runner
    Runner -->|"fetch /images/*"| Images
    Runner -->|"fetch /dummy.pdf"| PDF
    Browser -->|"GET /images/*"| Images
    Browser -->|"GET /All-Texts/*"| Texts
    Browser -->|"HTTP GET /api/hello"| API
    API -->|"exec API route"| Runner
    Runner -->|"render page"| Browser
    Build -->|"deploy build"| Runner

    %% Click Events
    click Runner "https://github.com/srijani-chakroborty/my-portfolio/blob/main/next.config.js"
    click App "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/_app.js"
    click Doc "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/_document.js"
    click Home "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/index.js"
    click About "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/about.js"
    click Projects "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/projects.js"
    click Articles "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/articles.js"
    click Components "https://github.com/srijani-chakroborty/my-portfolio/tree/main/src/components/"
    click API "https://github.com/srijani-chakroborty/my-portfolio/blob/main/src/pages/api/hello.js"
    click Images "https://github.com/srijani-chakroborty/my-portfolio/tree/main/public/images/"
    click PDF "https://github.com/srijani-chakroborty/my-portfolio/blob/main/public/dummy.pdf"
    click Texts "https://github.com/srijani-chakroborty/my-portfolio/tree/main/public/All-Texts/"
    click pkg "https://github.com/srijani-chakroborty/my-portfolio/blob/main/package.json"
    click postcss "https://github.com/srijani-chakroborty/my-portfolio/blob/main/postcss.config.js"
    click tailwind "https://github.com/srijani-chakroborty/my-portfolio/blob/main/tailwind.config.js"
    click ESLint "https://github.com/srijani-chakroborty/my-portfolio/blob/main/.eslintrc.json"
    click jscfg "https://github.com/srijani-chakroborty/my-portfolio/blob/main/jsconfig.json"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef compute fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef storage fill:#90EE90,stroke:#333,stroke-width:1px
    classDef service fill:#FFD700,stroke:#333,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:1px
```
