# nikooravesh/nikoo architecture

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

- Interactive diagram: https://gitdiagram.com/nikooravesh/nikoo
- Repository: https://github.com/nikooravesh/nikoo

## Overview

##### Main Components
- Client (Frontend) – This is a client-side React application.
- Application Code – The “src” folder contains all the application logic. Notice the subfolders:
- Components: Contains individual sections (About, Contact, Experience, Footer, Globe, Projects, Videos, etc.) that represent different parts of the webpage.
- Types: Includes TypeScript type declarations.
- Assets: Contains media or other resource files (social assets, etc.).
- Package configuration files (package.json, tsconfig.json): They indicate used frameworks (React, TypeScript) and dependencies.

##### Interactions and Data Flow
- The static HTML (index.html in the public folder) is loaded in the browser.
- This HTML loads the bundled JavaScript produced by the React code starting from src/index.tsx.
- src/index.tsx renders the top-level App component (src/App.tsx).
- The App component orchestrates the rendering of various child components:
– AppAppBar (likely the navigation/header)
– MainContent (which probably organizes subsections such as About, Projects, Experience, etc.)
– Footer and possibly others.
- Theme components (in src/theme) interact with various parts of the UI to provide a consistent look and feel. They define global styles and even support mode toggling (e.g., light/dark via ColorModeSelect and ColorModeIconDropdown).
- Each component (found in src/components) represents a logical segment of the website (e.g., About section, Contact info). They are arranged to support the “one-page” application navigation.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: The code is divided into reusable, independent UI components.
- Theming & Customization: An emphasis on separation between style customizations and component logic. This is clearly seen in the “theme” folder with sub-customizations for different UI aspects.
- Use of TypeScript: Promotes type safety and self-documenting code, with custom types located under the src/_@types folder.

a. Layout Components:
– Start with a block titled “Browser” (Client) that loads “index.html” (Public Assets).
b. Core Application:
– Create a block for “src/App.tsx” as the central component that binds together all UI elements.
c. Additional Layers:
– Illustrate the role of “Theme” by drawing a dedicated “Theme Layer” block that interacts with multiple components. Connect this to blocks like “AppTheme”, “ColorModeSelect”, and “ColorModeIconDropdown” to show their influence on styling.
– Highlight the “src/_@types” folder to indicate the use of custom TypeScript types pervading the codebase.
– Represent the “assets” folder as a separate block that provides additional media resources, indicating data flow or dependency from various components.
d. Notation:
e. Data Flow:
– Though this is largely static front-end rendering, note the modular interactions via props or context (particularly for theme and global state) between the parent and child components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser (Client)"]:::client
    html["index.html (Public Assets)"]:::static
    icons["Icons & cmodel (Public Assets)"]:::static
    indexTs["src/index.tsx"]:::component
    appTs["src/App.tsx"]:::component
    AppCode["Application Code (src/)"]:::component
    TypeDecl["Type Declarations"]:::type
    Assets["Assets (Media)"]:::static
    pkg["package.json"]:::config
    tsconfig["tsconfig.json"]:::config

    Browser -->|"loads"| html
    Browser -->|"loads"| icons
    html -->|"triggers"| indexTs
    indexTs -->|"renders"| appTs
    AppCode -->|"contains"| indexTs
    AppCode -->|"contains"| appTs
    AppCode -->|"contains"| TypeDecl
    AppCode -->|"contains"| Assets
    AppCode -->|"contains"| pkg
    AppCode -->|"contains"| tsconfig

    subgraph "UI Components"
        AppAppBar["AppAppBar"]:::component
        MainContent["MainContent"]:::component
        Footer["Footer"]:::component
        subgraph "Main Content Sections"
            About["About"]:::component
            Contact["Contact"]:::component
            Experience["Experience"]:::component
            Projects["Projects"]:::component
            Videos["Videos"]:::component
            Globe["Globe"]:::component
            SitemarkIcon["SitemarkIcon"]:::component
            Tech["Tech"]:::component
        end
    end

    appTs -->|"renders"| AppAppBar
    appTs -->|"renders"| MainContent
    appTs -->|"renders"| Footer
    MainContent -->|"includes"| About
    MainContent -->|"includes"| Contact
    MainContent -->|"includes"| Experience
    MainContent -->|"includes"| Projects
    MainContent -->|"includes"| Videos
    MainContent -->|"includes"| Globe
    MainContent -->|"includes"| SitemarkIcon
    MainContent -->|"includes"| Tech

    subgraph "Theme Layer"
        AppTheme["AppTheme"]:::theme
        ColorModeSelect["ColorModeSelect"]:::theme
        ColorModeIconDropdown["ColorModeIconDropdown"]:::theme
        Customizations["Customizations"]:::theme
    end

    AppTheme -->|"styles"| appTs
    AppTheme -->|"styles"| MainContent
    ColorModeSelect -->|"toggles"| AppTheme
    ColorModeIconDropdown -->|"selects"| AppTheme

    %% Click Events
    click html "https://github.com/nikooravesh/nikoo/blob/main/public/index.html"
    click indexTs "https://github.com/nikooravesh/nikoo/blob/main/src/index.tsx"
    click appTs "https://github.com/nikooravesh/nikoo/blob/main/src/App.tsx"
    click AppAppBar "https://github.com/nikooravesh/nikoo/blob/main/src/components/AppAppBar.tsx"
    click MainContent "https://github.com/nikooravesh/nikoo/blob/main/src/components/MainContent.tsx"
    click Footer "https://github.com/nikooravesh/nikoo/blob/main/src/components/Footer.tsx"
    click About "https://github.com/nikooravesh/nikoo/blob/main/src/components/About.tsx"
    click Contact "https://github.com/nikooravesh/nikoo/blob/main/src/components/Contact.tsx"
    click Experience "https://github.com/nikooravesh/nikoo/blob/main/src/components/Experience.tsx"
    click Projects "https://github.com/nikooravesh/nikoo/blob/main/src/components/Projects.tsx"
    click Videos "https://github.com/nikooravesh/nikoo/blob/main/src/components/Videos.tsx"
    click Globe "https://github.com/nikooravesh/nikoo/blob/main/src/components/Globe.tsx"
    click SitemarkIcon "https://github.com/nikooravesh/nikoo/blob/main/src/components/SitemarkIcon.tsx"
    click Tech "https://github.com/nikooravesh/nikoo/blob/main/src/components/tech.tsx"
    click AppTheme "https://github.com/nikooravesh/nikoo/blob/main/src/theme/AppTheme.tsx"
    click ColorModeSelect "https://github.com/nikooravesh/nikoo/blob/main/src/theme/ColorModeSelect.tsx"
    click ColorModeIconDropdown "https://github.com/nikooravesh/nikoo/blob/main/src/theme/ColorModeIconDropdown.tsx"
    click Customizations "https://github.com/nikooravesh/nikoo/tree/main/src/theme/customizations/"
    click TypeDecl "https://github.com/nikooravesh/nikoo/blob/main/src/_@types/svg.d.ts"
    click Assets "https://github.com/nikooravesh/nikoo/tree/main/src/assets/social"
    click AppCode "https://github.com/nikooravesh/nikoo/tree/main/src/"
    click pkg "https://github.com/nikooravesh/nikoo/blob/main/package.json"
    click tsconfig "https://github.com/nikooravesh/nikoo/blob/main/tsconfig.json"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef component fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef theme fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef static fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef config fill:#FF6961,stroke:#000,stroke-width:2px;
    classDef type fill:#AAF0D1,stroke:#000,stroke-width:2px;
```
