# indiehum/portfolio architecture

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

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

## Overview

##### Main Components Structure

a. Portfolio Core
- Root-level components (index.html, StyleSheet, Font, Img)

b. Project Showcase Section
- Each sub-project should be represented as a separate module:
- FakeStore (E-commerce)
- QuizApp
- WeatherApp
- ToDoApp
- RockPaperScissor
- Others

##### Technical Architecture Elements

For each component, represent:

a. Frontend Architecture
- Static Assets (CSS, Images, Fonts)
- JavaScript Modules
- HTML Structure
- Utility Functions

b. Common Services Layer
- HTTP Request Handlers (httpReq.js)
- Authentication Services (auth.js)
- Utility Functions (validation.js, cookie.js)

##### Specific Project Patterns

Different architectural patterns used:
- FakeStore & FakeStoreOOP: Highlight both procedural and OOP implementations
- WeatherApp: Show Tailwind integration and build process
- QuizApp: Display multi-page architecture with state management

##### Component Relationships

Key interactions:
- Main portfolio navigation flow
- Project isolation and independence
- Shared resource usage
- API integrations (Weather API, FakeStore API)

##### Technical Stack Indicators

- Vanilla JavaScript
- CSS (including Tailwind for WeatherApp)
- HTML5
- External APIs
- Build tools (for WeatherApp)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Portfolio["Portfolio Website"]
        direction TB
        Entry[/"index.html"\]:::entry
        click Entry "https://github.com/IndieHum/Portfolio/blob/master/index.html"
        
        subgraph Core["Core Components"]
            direction TB
            MainJS["Main JavaScript"]:::core
            click MainJS "https://github.com/IndieHum/Portfolio/blob/master/JS/main.js"
            RenderJS["Asset Renderer"]:::core
            click RenderJS "https://github.com/IndieHum/Portfolio/blob/master/JS/Render.js"
            StyleCSS["Core Styling"]:::core
            click StyleCSS "https://github.com/IndieHum/Portfolio/blob/master/StyleSheet/Style.css"
            Assets["Static Assets"]:::core
        end

        subgraph Common["Common Services"]
            direction TB
            HTTPReq["HTTP Handler"]:::service
            click HTTPReq "https://github.com/IndieHum/Portfolio/blob/master/JS/httpReq.js"
            Auth["Authentication"]:::service
            click Auth "https://github.com/IndieHum/Portfolio/blob/master/Links/FakeStore/utils/authorization.js"
            Cookie["Cookie Manager"]:::service
            click Cookie "https://github.com/IndieHum/Portfolio/blob/master/Links/FakeStore/utils/cookie.js"
            Validation["Validation Service"]:::service
            click Validation "https://github.com/IndieHum/Portfolio/blob/master/Links/FakeStore/utils/validation.js"
        end

        subgraph Projects["Project Showcase"]
            direction TB
            
            subgraph FakeStore["FakeStore E-commerce"]
                direction TB
                FSProc["Procedural Implementation"]:::project
                click FSProc "https://github.com/IndieHum/Portfolio/tree/master/Links/FakeStore"
                FSOOP["OOP Implementation"]:::project
                click FSOOP "https://github.com/IndieHum/Portfolio/tree/master/Links/FakeStoreOOP"
                FSAuth["Authentication"]:::project
                click FSAuth "https://github.com/IndieHum/Portfolio/blob/master/Links/FakeStore/auth.js"
                FSDash["Dashboard"]:::project
                click FSDash "https://github.com/IndieHum/Portfolio/blob/master/Links/FakeStore/dashboard.js"
            end

            subgraph Weather["Weather Application"]
                direction TB
                WApp["Main Application"]:::project
                click WApp "https://github.com/IndieHum/Portfolio/tree/master/Links/WeatherApp"
                WBuild["Build Output"]:::project
                click WBuild "https://github.com/IndieHum/Portfolio/tree/master/Links/WeatherApp/build"
                WTailwind["Tailwind Config"]:::project
                click WTailwind "https://github.com/IndieHum/Portfolio/blob/master/Links/WeatherApp/tailwind.config.js"
                WHTTP["HTTP Services"]:::project
                click WHTTP "https://github.com/IndieHum/Portfolio/blob/master/Links/WeatherApp/build/js/httpReq.js"
            end

            subgraph Quiz["Quiz Application"]
                direction TB
                QApp["Main Application"]:::project
                click QApp "https://github.com/IndieHum/Portfolio/tree/master/Links/QuizApp"
                QState["State Management"]:::project
                click QState "https://github.com/IndieHum/Portfolio/tree/master/Links/QuizApp/js"
                QPages["Multi-page Structure"]:::project
                click QPages "https://github.com/IndieHum/Portfolio/tree/master/Links/QuizApp/pages"
                QStyle["Styling"]:::project
                click QStyle "https://github.com/IndieHum/Portfolio/tree/master/Links/QuizApp/css"
            end

            subgraph Todo["Todo Application"]
                direction TB
                TApp["Main Application"]:::project
                click TApp "https://github.com/IndieHum/Portfolio/tree/master/Links/ToDoApp"
                TCore["Core Logic"]:::project
                click TCore "https://github.com/IndieHum/Portfolio/blob/master/Links/ToDoApp/app.js"
                TLocal["Localization"]:::project
                click TLocal "https://github.com/IndieHum/Portfolio/tree/master/Links/ToDoApp/persian-assets"
            end

            subgraph RPS["Rock Paper Scissors"]
                direction TB
                RApp["Main Application"]:::project
                click RApp "https://github.com/IndieHum/Portfolio/tree/master/Links/RockPaperScissor"
                RLogic["Game Logic"]:::project
                click RLogic "https://github.com/IndieHum/Portfolio/blob/master/Links/RockPaperScissor/logic/app.js"
                RDiff["Difficulty Management"]:::project
                click RDiff "https://github.com/IndieHum/Portfolio/blob/master/Links/RockPaperScissor/logic/difficulty.js"
            end
        end

        subgraph StaticAssets["Static Resources"]
            direction TB
            Images["Images"]:::asset
            click Images "https://github.com/IndieHum/Portfolio/tree/master/Img"
            Fonts["Fonts"]:::asset
            click Fonts "https://github.com/IndieHum/Portfolio/tree/master/Font"
            ProjectImages["Project Images"]:::asset
            click ProjectImages "https://github.com/IndieHum/Portfolio/tree/master/Img/projects"
        end
    end

    %% Relationships
    Entry --> Core
    Core --> Common
    Core --> Projects
    Core --> StaticAssets
    Common --> Projects

    %% Styling
    classDef core fill:#2196F3,color:white
    classDef service fill:#FFC107,color:black
    classDef project fill:#4CAF50,color:white
    classDef asset fill:#9C27B0,color:white
    classDef entry fill:#FF5722,color:white

    %% Legend
    subgraph Legend
        L1[Core Component]:::core
        L2[Common Service]:::service
        L3[Project Module]:::project
        L4[Static Asset]:::asset
        L5[Entry Point]:::entry
    end
```
