# ankitzm/portfolio architecture

> Architecture diagram of the GitHub repository ankitzm/portfolio, 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/ankitzm/portfolio
- Repository: https://github.com/ankitzm/portfolio

## Overview

##### Project Type and Purpose
- This is a front-end React application built with TypeScript and Vite. It is designed as a template for React development with support for Hot Module Reloading (HMR) and ESLint configurations. The project is focused solely on the user interface and client-side logic.
- Key indicators: The README explicitly states “React + TypeScript + Vite” and the file tree shows a “src” folder, pages, components, data (JSON) files, and public assets.

##### File Structure
- Top-level files: Configuration files such as .eslintrc.cjs, tailwind.config.js, tsconfig.json, and vite.config.ts denote environment settings and build configurations.
- The index.html in the root is the entry point for the application.
- The “src” directory includes:
- App.tsx & main.tsx: Bootstrapping and overall application container.
- “components”: Contains UI components (e.g., Navbar, ExperienceCard, ProjectCard) including motion components for animations via page transitions.
- “pages”: Represents different routes/views (home, experience, projects, contact).
- “data”: JSON files that provide data for the Experience and Projects pages.
- “assets”: Fonts and potential images.
- The “public” directory holds static assets and project-related files (e.g., images and markdown).
- Notice the absence of a backend folder; the architecture is entirely client-side.

##### README for Additional Insights
- The README confirms the project’s purpose as a template with a minimal and efficient set-up for React using Vite.
- It also includes instructions on configuring ESLint and hints at the use of plugins for faster refresh (Babel/SWC).

a. Main Components:
- Entry Point & Build Tool: index.html, Vite (vite.config.ts), and main.tsx.
- Application Shell: App.tsx that integrates routing and renders pages.
- Pages: Components representing routes (pages/home.tsx, pages/experience.tsx, pages/projects.tsx, pages/contact.tsx).
- UI Components: Components like Navbar, ExperienceCard, ProjectCard and specialized components under “motion-components” for animations.
- Assets & Data: “assets” folder for fonts/images and “data” folder for JSON files that supply static content.
- Configuration & Tooling: ESLint configuration, Tailwind CSS config, and TypeScript configurations that influence coding standards and styles.

b. Relationships and Interactions:
- App.tsx acts as the container, integrating the routing mechanism (likely using React Router) to link to pages like home, projects, etc.
- Each page then uses various UI components (like Navbar, ProjectCard, ExperienceCard) to display its content.
- Data interactions exist from UI components to the static JSON files (experience.json, projects.json), representing a read-only “data layer.”
- Static assets (images, fonts) in “public” and “assets” are used by components.

c. Important Architectural Patterns and Design Principles:
- Component-Based Architecture: The UI is broken down into reusable, modular components.
- Separation of Concerns: Clear boundaries between the application shell (App.tsx), page views (pages folder), and individual UI components.
- Build & Development Tools: Vite provides the bundling along with ES module support and fast refresh capabilities.
- Styling is managed via dedicated CSS/SCSS files (for example in “src/index.css” and separated stylesheets) in combination with Tailwind (as indicated by tailwind.config.js).
- Static Data Layer: JSON files in the data folder provide the structured content which is decoupled from the components.

d. Relevant Technologies:
- React: for component-based UI.
- TypeScript: ensuring type safety and better development experience.
- Vite: for fast bundling and hot module replacement.
- Tailwind CSS: for styling.
- ESLint and TypeScript configurations: to enforce coding standards.

##### Elements
- Entry Point/Index Layer: index.html → main.tsx.
- Application Shell: App.tsx.
- Routing/Pages: home.tsx, experience.tsx, projects.tsx, contact.tsx.
- UI Components: Navbar, ExperienceCard, ProjectCard, MyTools, SocialComponent, and motion components.
- Data Layer: JSON files from the data directory.
- Assets: fonts, images, and static project files (under public).
- The flow from the entry point to the application shell, then to individual pages.
- How individual pages load and make use of UI components which in turn reference static data & assets.
- Green for UI components.
- Orange for static resources (data, assets, and public files).
- Grey for configuration and build-related files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Entry Point & Build"
        E1["index.html"]:::core
        E2["main.tsx"]:::core
        E3["App.tsx"]:::core
        VConfig["vite.config.ts"]:::config
        E1 --> E2
        E2 --> E3
    end

    subgraph "Pages"
        P1["home.tsx"]:::core
        P2["experience.tsx"]:::core
        P3["projects.tsx"]:::core
        P4["contact.tsx"]:::core
        E3 --> P1
        E3 --> P2
        E3 --> P3
        E3 --> P4
    end

    subgraph "UI Components"
        C1["Navbar"]:::ui
        C2["ExperienceCard"]:::ui
        C3["ProjectCard"]:::ui
        C4["MyTools"]:::ui
        C5["SocialComponent"]:::ui
        M1["AnimatedText"]:::ui
        M2["pageTransition"]:::ui
        P1 --> C1
        P2 --> C1
        P3 --> C1
        P4 --> C1
        P2 --> C2
        P3 --> C3
        P1 --> M1
        P1 --> M2
    end

    subgraph "Data & Assets"
        D1["experience.json"]:::static
        D2["projects.json"]:::static
        A1["assets"]:::static
        A2["public"]:::static
        P2 --> D1
        P3 --> D2
        C1 --> A1
        C1 --> A2
        C2 --> A1
        C3 --> A1
    end

    subgraph "Configuration & Tooling"
        Cfg1[".eslintrc.cjs"]:::config
        Cfg2["tailwind.config.js"]:::config
        Cfg3["tsconfig.json"]:::config
        Cfg4["tsconfig.node.json"]:::config
        Cfg5["postcss.config.js"]:::config
    end

    click E1 "https://github.com/ankitzm/portfolio/blob/v2/index.html"
    click E2 "https://github.com/ankitzm/portfolio/blob/v2/src/main.tsx"
    click VConfig "https://github.com/ankitzm/portfolio/blob/v2/vite.config.ts"
    click E3 "https://github.com/ankitzm/portfolio/blob/v2/src/App.tsx"
    click P1 "https://github.com/ankitzm/portfolio/blob/v2/src/pages/home.tsx"
    click P2 "https://github.com/ankitzm/portfolio/blob/v2/src/pages/experience.tsx"
    click P3 "https://github.com/ankitzm/portfolio/blob/v2/src/pages/projects.tsx"
    click P4 "https://github.com/ankitzm/portfolio/blob/v2/src/pages/contact.tsx"
    click C1 "https://github.com/ankitzm/portfolio/blob/v2/src/components/Navbar.tsx"
    click C2 "https://github.com/ankitzm/portfolio/blob/v2/src/components/ExperienceCard.tsx"
    click C3 "https://github.com/ankitzm/portfolio/blob/v2/src/components/ProjectCard.tsx"
    click C4 "https://github.com/ankitzm/portfolio/blob/v2/src/components/MyTools.tsx"
    click C5 "https://github.com/ankitzm/portfolio/blob/v2/src/components/SocialComponent.tsx"
    click M1 "https://github.com/ankitzm/portfolio/blob/v2/src/components/motion-components/AnimatedText.tsx"
    click M2 "https://github.com/ankitzm/portfolio/blob/v2/src/components/motion-components/pageTransition.tsx"
    click D1 "https://github.com/ankitzm/portfolio/blob/v2/src/data/experience.json"
    click D2 "https://github.com/ankitzm/portfolio/blob/v2/src/data/projects.json"
    click A1 "https://github.com/ankitzm/portfolio/tree/v2/src/assets"
    click A2 "https://github.com/ankitzm/portfolio/tree/v2/public"
    click Cfg1 "https://github.com/ankitzm/portfolio/blob/v2/.eslintrc.cjs"
    click Cfg2 "https://github.com/ankitzm/portfolio/blob/v2/tailwind.config.js"
    click Cfg3 "https://github.com/ankitzm/portfolio/blob/v2/tsconfig.json"
    click Cfg4 "https://github.com/ankitzm/portfolio/blob/v2/tsconfig.node.json"
    click Cfg5 "https://github.com/ankitzm/portfolio/blob/v2/postcss.config.js"

    classDef core fill:#cce5ff,stroke:#003366,stroke-width:2px;
    classDef ui fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef static fill:#ffeeba,stroke:#856404,stroke-width:2px;
    classDef config fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
```
