# prash240303/portfolio-prashant architecture

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

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

## Overview

##### Project Type and Purpose
- The project is a modern Next.js application written in TypeScript that appears to serve as a personal or portfolio site. It contains dedicated routes for pages such as “about”, “blogs”, “crafts”, “resume”, and “guestbook”, along with a rich set of UI components.
- The README includes an image, likely showcasing the UI or a key aspect of the site, which reinforces its visual-centric purpose.

##### Analyzing the File Structure
- Top-Level Files: You have configuration files (.eslintrc.json, next.config.mjs, tailwind.config.ts, tsconfig.json, etc.) that set up coding standards, build settings, and styling.
- src Directory: Split between an “app” directory and a “components” directory.
- The app directory contains route-based page definitions (e.g., src/app/about/page.tsx, src/app/blogs/page.tsx) and a global layout (src/app/layout.tsx). This indicates the use of Next.js’s App Router.
- The components directory includes reusable UI elements (Navbar, Footer, Hero, etc.) and even specialized UI modules (e.g., CodeBlock, LightDarkSwitch).
- Additional folders like “data” (Languages.jsx, Projects.jsx, links.jsx) and “lib” (utils.ts) suggest a separation between static content/data definitions, logic/utility functions, and UI.

##### Key Components
- Next.js Application Layer:
- “src/app” folder as the routing layer. Each folder (about, blogs, crafts, resume, guestbook) represents an individual route/page, while layout.tsx establishes a common layout.
- UI Components Layer:
- Together components like Navbar, Hero, Footer, CTA, etc., under a UI or presentation layer. Emphasize how these components are used in multiple pages.
- The “components/ui” subdirectory contains finer-grained UI utilities (e.g., CodeBlock.tsx, LightDarkSwitch.tsx).
- Data and Utility Layers:
- “src/data” folder as the source for static, predefined content such as project details, language skills, and external links.
- “src/lib” folder (with utils.ts) as containing helper functions that may be used across components and pages.
- Static Assets Layer:
- The “public” folder holds the images, videos, PDF resume, and other static assets which feed into both the UI and the content of the pages.

##### Relationships and Data Flow
- Flow beginning with the client (browser) making a request.
- That the Next.js routing layer (src/app) intercepts the request and loads a specific page. This page then composes several components from the “components” directory.
- Global layout (layout.tsx) as wrapping around individual pages, embedding shared elements like the Navbar and Footer.
- That the UI components interact with static data from “src/data” and perform helper functions via “src/lib”.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clearly separate concerns among routing (app folder), presentation (components), data (data folder), and utility functions (lib folder).
- Component Reusability: The use and organization of components (for example, repeated use of project cards, CTA sections, or navigational bars) supports the idea of modular design.
- Static Versus Dynamic Content: Pages may use static content from the “data” directory and static assets from the “public” folder while leveraging Next.js’s server- or static-side rendering capabilities.

- Insert a common “Global Layout” that wraps around these pages and includes shared UI elements.
d. Separately, provide a container for the “UI Components” (src/components) and connect them to the pages that render them.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client("Client (Browser)"):::client
    Client -->|"request"| App("Next.js App"):::app

    subgraph "Routing Layer (src/app)"
        GL("Global Layout"):::routing
        About("About Page"):::routing
        Blogs("Blogs Page"):::routing
        Crafts("Crafts Page"):::routing
        Guestbook("Guestbook Page"):::routing
        Resume("Resume Page"):::routing
    end

    App --> GL
    GL -->|"composes"| About
    GL -->|"composes"| Blogs
    GL -->|"composes"| Crafts
    GL -->|"composes"| Guestbook
    GL -->|"composes"| Resume

    subgraph "UI Components (src/components)"
        Nav("Navbar"):::ui
        Hero("Hero"):::ui
        Footer("Footer"):::ui
        CTA("CTA"):::ui
        PC("Project Card"):::ui
        CB("Code Block"):::ui
        LDS("Light/Dark Switch"):::ui
        Switch("Switch"):::ui
    end

    %% Global Layout includes shared UI elements
    GL -->|"includes"| Nav
    GL -->|"includes"| Footer

    %% Individual pages rendering additional UI components
    About -->|"renders"| Hero
    About -->|"renders"| CTA
    Blogs -->|"renders"| PC

    subgraph "Data & Utility Layers"
        Data("Data Sources (src/data)"):::data
        Lib("Utility Functions (src/lib)"):::data
    end

    subgraph "Static Assets (public)"
        Assets("Static Assets"):::assets
    end

    %% UI Components depending on Data, Lib, and Assets
    CTA -->|"utilizes"| Data
    PC -->|"utilizes"| Lib
    Nav -->|"loads"| Assets

    %% Connections among UI components for specialized interactions
    Hero -->|"triggers"| LDS
    LDS -->|"links"| Switch
    Nav -->|"may invoke"| CB

    %% Click Events for Next.js Routing Layer
    click About "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/about/page.tsx"
    click Blogs "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/blogs/page.tsx"
    click Crafts "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/crafts/page.tsx"
    click Guestbook "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/guestbook/page.tsx"
    click Resume "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/resume/page.tsx"
    click GL "https://github.com/prash240303/portfolio-prashant/blob/main/src/app/layout.tsx"

    %% Click Events for UI Components Layer
    click Nav "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/Navbar.tsx"
    click Hero "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/Hero.tsx"
    click Footer "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/Footer.tsx"
    click CTA "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/CTA.tsx"
    click PC "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/ProjectCard.tsx"
    click CB "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/ui/CodeBlock.tsx"
    click LDS "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/ui/LightDarkSwitch.tsx"
    click Switch "https://github.com/prash240303/portfolio-prashant/blob/main/src/components/ui/switch.tsx"

    %% Click Events for Data & Utility Layers
    click Data "https://github.com/prash240303/portfolio-prashant/tree/main/src/data"
    click Lib "https://github.com/prash240303/portfolio-prashant/blob/main/src/lib/utils.ts"

    %% Click Event for Static Assets
    click Assets "https://github.com/prash240303/portfolio-prashant/blob/main/public/Resume/Prashant_Prabhakar_Resume.pdf"

    %% Styles
    classDef client fill:#f9f,stroke:#333,stroke-width:2px;
    classDef app fill:#bbf,stroke:#333,stroke-width:2px;
    classDef routing fill:#cfc,stroke:#333,stroke-width:2px;
    classDef ui fill:#fcf,stroke:#333,stroke-width:2px;
    classDef data fill:#ffd,stroke:#333,stroke-width:2px;
    classDef assets fill:#cff,stroke:#333,stroke-width:2px;
```
