# harshitsilly/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a personal website built with Next.js. The project contains pages for blog posts, career information, wedding details, projects, bucket lists, and more.
- The README indicates planned feature expansions (integration with MDX, code snippets, linking to a Wix blog, etc.) so the system is designed for both content presentation and extensibility.

##### File structure and key architectural elements
- The top-level directories include configuration files (.nvmrc, next.config.js, package.json, etc.), a public folder for static assets (images, resume), pages (Next.js routing), and a src folder that contains more granular, component-level code.
- The src folder is organized into logical subdirectories:
- atoms: low-level, reusable UI elements (e.g., Button, Link, Navbar, etc.)
- components: composite or layout components (such as Avtar, Tag, layout components like header and footer)
- module: feature-specific modules like Blog, Career, BucketList, Projects, Wedding, and Intro; these represent the primary content areas of the website and encapsulate related UI and data.
- utils: custom hooks and helper functions.
- svg: SVG assets used within the UI.
- The pages folder follows Next.js conventions to create routes corresponding to each section of the site (blog, career, projects, etc.) and also includes styling with SCSS.
- There is also a scripts directory that appears to include tooling (e.g., an image processing script using libwebp binaries) which might be used in optimizing images before serving them.

##### Main components
a. Frontend/UI (Next.js Application):
- Pages: Represented by the Next.js pages folder (/_app.js, blog routes, mobile routes, etc.).
- Feature Modules: Present in src/module (e.g., Blog, Career, Projects, BucketList, Wedding, Intro) that structure content and functionality.

b. Static Assets & Public Resources:
- Public directory (images, resume.pdf) containing the static assets.

c. Utility and Helper Services:
- Scripts for image processing (located in scripts, including library wrappers around libwebp).
- Utility functions and custom hooks in src/utils.

d. Configuration and Build:
- Project configuration files (next.config.js, .prettierrc, .nvmrc, package.json) drive how the project is built and deployed.
- Storybook for UI development (the .storybook folder).

e. Data Sources:
- MDX and other data files under src/module paths serving as content (e.g., blog post MDX files for the blog, career markdown content).

##### Relationships and interactions
- The Next.js pages interact with feature modules: For example, the /pages/blog/[[...tag]].js route invokes the Blog module in src/module/Blog.
[Pages] → [Modules (Blog, Career, etc.)] → [Components/Atoms].
- Utility functions in src/utils are used by both modules and components.
- Scripts (in the scripts directory) may be initiated during build time or as part of a pre-deployment pipeline for image processing.
- The public directory hosts static content that is directly referenced by the UI.

##### Architectural patterns/design principles
- Component-Driven Design: The extensive use of “atoms” and component modules suggests adherence to atomic design principles for UI development.
- Separation of Concerns: Pages (routing/view layer) vs. modules (feature layer) vs. components (presentation layer) clearly separate responsibilities.
- Extensibility: Planned features (MDX integration and code snippets) reflect that the architecture is built to be extended in future versions.
- Next.js conventions: Using file-based routing and structured modules contributes to a well-organized, maintainable architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    U["User Request"]:::frontend

    %% Frontend Application Layer
    PAGES["Next.js Pages"]:::frontend

    %% Feature Modules
    subgraph "Feature Modules"
        BLOG["Blog Module"]:::frontend
        CAREER["Career Module"]:::frontend
        BUCKET["BucketList Module"]:::frontend
        PROJECTS["Projects Module"]:::frontend
        WEDDING["Wedding Module"]:::frontend
        INTRO["Intro Module"]:::frontend
        SHELL["Shell Module"]:::frontend
        SNIPPETS["Snippets Module"]:::frontend
    end

    %% UI Components Layer
    subgraph "UI Components"
        ATOMS["Atoms"]:::frontend
        COMPONENTS["Composite Components"]:::frontend
    end

    %% Static Assets
    subgraph "Static Assets"
        ASSETS["Public Assets"]:::static
    end

    %% Utility & Helper Services
    subgraph "Utility & Helper Services"
        UTIL["Utilities (src/utils)"]:::utility
        SCRIPTS["Scripts (Tooling)"]:::utility
    end

    %% Configuration & Build Tools
    subgraph "Configuration & Build Tools"
        CONFIG1[".nvmrc"]:::config
        CONFIG2["next.config.js"]:::config
        CONFIG3["package.json"]:::config
        CONFIG4["package-lock.json"]:::config
        CONFIG5[".prettierrc"]:::config
        STORYBOOK["Storybook"]:::config
    end

    %% Connections
    U --> PAGES

    %% Pages calling Feature Modules
    PAGES --> BLOG
    PAGES --> CAREER
    PAGES --> BUCKET
    PAGES --> PROJECTS
    PAGES --> WEDDING
    PAGES --> INTRO
    PAGES --> SHELL
    PAGES --> SNIPPETS

    %% Pages referencing Static Assets
    PAGES --> ASSETS

    %% Feature Modules using UI Components
    BLOG --> ATOMS
    BLOG --> COMPONENTS
    CAREER --> ATOMS
    CAREER --> COMPONENTS
    BUCKET --> ATOMS
    BUCKET --> COMPONENTS
    PROJECTS --> ATOMS
    PROJECTS --> COMPONENTS
    WEDDING --> ATOMS
    WEDDING --> COMPONENTS
    INTRO --> ATOMS
    INTRO --> COMPONENTS
    SHELL --> ATOMS
    SHELL --> COMPONENTS
    SNIPPETS --> ATOMS
    SNIPPETS --> COMPONENTS

    %% Feature Modules and UI Components using Utilities
    BLOG --> UTIL
    CAREER --> UTIL
    BUCKET --> UTIL
    PROJECTS --> UTIL
    WEDDING --> UTIL
    INTRO --> UTIL
    SHELL --> UTIL
    SNIPPETS --> UTIL
    ATOMS --> UTIL
    COMPONENTS --> UTIL

    %% Configuration & Build Tools driving Pages
    CONFIG1 --> PAGES
    CONFIG2 --> PAGES
    CONFIG3 --> PAGES
    CONFIG4 --> PAGES
    CONFIG5 --> PAGES
    STORYBOOK --> PAGES

    %% Scripts involvement in build and asset processing
    SCRIPTS --> ASSETS
    SCRIPTS --> PAGES
    SCRIPTS --> UTIL

    %% Click Events
    click PAGES "https://github.com/harshitsilly/portfolio/tree/master/pages"
    click ATOMS "https://github.com/harshitsilly/portfolio/tree/master/src/atoms"
    click COMPONENTS "https://github.com/harshitsilly/portfolio/tree/master/src/components"
    click BLOG "https://github.com/harshitsilly/portfolio/tree/master/src/module/Blog"
    click CAREER "https://github.com/harshitsilly/portfolio/tree/master/src/module/Career"
    click BUCKET "https://github.com/harshitsilly/portfolio/tree/master/src/module/BucketList"
    click PROJECTS "https://github.com/harshitsilly/portfolio/tree/master/src/module/Projects"
    click WEDDING "https://github.com/harshitsilly/portfolio/tree/master/src/module/Wedding"
    click INTRO "https://github.com/harshitsilly/portfolio/tree/master/src/module/Intro"
    click SHELL "https://github.com/harshitsilly/portfolio/tree/master/src/module/Shell"
    click SNIPPETS "https://github.com/harshitsilly/portfolio/tree/master/src/module/snippets"
    click UTIL "https://github.com/harshitsilly/portfolio/tree/master/src/utils"
    click SCRIPTS "https://github.com/harshitsilly/portfolio/tree/master/scripts"
    click ASSETS "https://github.com/harshitsilly/portfolio/tree/master/public"
    click CONFIG1 "https://github.com/harshitsilly/portfolio/blob/master/.nvmrc"
    click CONFIG2 "https://github.com/harshitsilly/portfolio/blob/master/next.config.js"
    click CONFIG3 "https://github.com/harshitsilly/portfolio/blob/master/package.json"
    click CONFIG4 "https://github.com/harshitsilly/portfolio/blob/master/package-lock.json"
    click CONFIG5 "https://github.com/harshitsilly/portfolio/blob/master/.prettierrc"
    click STORYBOOK "https://github.com/harshitsilly/portfolio/blob/master/.storybook"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef config fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef utility fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef static fill:#e2d6f3,stroke:#6f42c1,stroke-width:2px;

    class U,PAGES,BLOG,CAREER,BUCKET,PROJECTS,WEDDING,INTRO,SHELL,SNIPPETS,ATOMS,COMPONENTS frontend;
    class CONFIG1,CONFIG2,CONFIG3,CONFIG4,CONFIG5,STORYBOOK config;
    class UTIL,SCRIPTS utility;
    class ASSETS static;
```
