# haimichi/portfolio architecture

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

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

## Overview

##### Main Components
a. Frontend Client:
- React Application – Found under “src”, which houses key elements such as:
– UI Components: “src/components” (Header, Footer, ProjectCard, etc.)
– Pages: “src/pages” (Home, About, Projects) that likely correspond to route-based views.
– Context Management: “src/context” includes ThemeContext for handling themes.
– Styling and Assets: “src/styles” with Tailwind CSS, and “public” holds index.html, manifest, and other static assets.
b. Backend / Serverless Function:
- Netlify Functions – Under “src/netlify/functions”, e.g., “send-feedback.js”. This indicates that as part of its architecture the project also employs serverless functions to process non-UI logic (like form submissions, feedback, etc.).
c. Configuration / Build Processes:
- Build and Dependency Management – Files like package.json, package-lock.json, and netlify.toml indicate hosted configurations and deployment settings for Netlify.

##### Establish the Relationships and Interactions
a. The client side (React) interacts with static public assets and utilizes routing defined within “src/pages” to switch between views.
b. Components like “ThemeToggle” and “ThemeContext” suggest that UI state (e.g., dark/light themes) cascades throughout the app.
c. On certain actions (for instance, when a user submits feedback), the React application likely calls the serverless function “send-feedback.js” that handles the back-end process.
d. The overall build process is orchestrated via npm/yarn (as indicated by package.json) and deployed on Netlify – with “netlify.toml” outlining configuration specifics.

##### Highlighting Architectural Patterns and Tech Stack
a. Component-based Architecture – Typical React component separation into reusable UI elements (Header, Footer, etc.).
b. Separation of Concerns – Clear segmentation between presentation (React components/pages) and business logic (serverless functions).
c. State Management – Use of React Context for themes, implying an application-wide state management pattern.
d. Utilization of Tailwind CSS – Custom styling found in “src/styles/tailwind.css” suggests a utility-first CSS approach.
e. Serverless Deployment – Integration of Netlify functions shows a move toward a serverless, microservice-like backend.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Client
    subgraph "Frontend Client"
        A["React Application"]:::frontend
        subgraph "UI Layer"
            B["UI Components (Header, Footer, ProjectCard)"]:::frontend
            C["Pages (Home,About,Projects)"]:::frontend
            D["Context Management (ThemeContext)"]:::frontend
        end
        subgraph "Styling & Assets"
            E1["Tailwind CSS"]:::frontend
            E2["App.css"]:::frontend
            E3["index.css"]:::frontend
            E4["Static Assets"]:::frontend
        end
    end

    %% Backend / Serverless Functions
    subgraph "Backend / Serverless Functions"
        F["Serverless Function: send-feedback.js"]:::backend
    end

    %% Infrastructure & Configurations
    subgraph "Infrastructure & Configurations"
        G["Build Config (package.json & package-lock.json)"]:::config
        H["Netlify Deployment (netlify.toml)"]:::config
    end

    %% Relationships
    A --> B
    A --> C
    A --> D
    A --> E1
    A --> E2
    A --> E3
    A --> E4
    C -->|"APIcall"| F
    D -->|"ThemePropagation"| B

    %% Click Events for Frontend
    click A "https://github.com/haimichi/portfolio/tree/main/src/"
    click B "https://github.com/haimichi/portfolio/tree/main/src/components/"
    click C "https://github.com/haimichi/portfolio/tree/main/src/pages/"
    click D "https://github.com/haimichi/portfolio/blob/main/src/context/ThemeContext.js"
    click E1 "https://github.com/haimichi/portfolio/blob/main/src/styles/tailwind.css"
    click E2 "https://github.com/haimichi/portfolio/blob/main/src/App.css"
    click E3 "https://github.com/haimichi/portfolio/blob/main/src/index.css"
    click E4 "https://github.com/haimichi/portfolio/tree/main/public/"

    %% Click Events for Backend
    click F "https://github.com/haimichi/portfolio/blob/main/src/netlify/functions/send-feedback.js"

    %% Click Events for Infrastructure & Configurations
    click G "https://github.com/haimichi/portfolio/blob/main/package.json"
    click H "https://github.com/haimichi/portfolio/blob/main/netlify.toml"

    %% Class definitions for styling
    classDef frontend fill:#a1c4fd,stroke:#084298,stroke-width:2px;
    classDef backend fill:#ffcc99,stroke:#b36b00,stroke-width:2px;
    classDef config fill:#d5f5e3,stroke:#1e8449,stroke-width:2px;
```
