# konstabash/goit-react-hw-01 architecture

> Architecture diagram of the GitHub repository konstabash/goit-react-hw-01, 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/konstabash/goit-react-hw-01
- Repository: https://github.com/konstabash/goit-react-hw-01

## Overview

##### Main System Components
- Entry Point & Build Tool: Represent the entry file (index.html) and the Vite configuration (vite.config.js, package.json). This section explains how Vite orchestrates building, fast refresh, and bundling.
- React Application Core: Highlight src/main.jsx as the key bootstrap file that mounts the React app, and src/App.jsx which acts as the root component.
- UI Components: Break down each component directory under src/components (e.g., FriendList, FriendListItem, Profile, TransactionHistory) to show how the UI is modularized. This provides insight into how the user interface is composed.

##### Relationships and Interactions
- Configuration & Tooling: Illustrate the configuration files (eslint.config.js, package.json) as supporting tools that govern the project setup, coding standards, and build processes.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Emphasize that the application follows a modular, reusable component structure.
- Integration of Tooling: Note the integration of tools like ESLint for code quality and the two available React plugins for fast refresh (Babel/SWC).

##### Specific Technologies & Libraries
- React is the primary UI library.
- Vite is used as the build tool.
- ESLint is configured for linting.
- The project uses static JSON files for data emulation.
- CSS modules are used for component styling, as indicated by the *.module.css files.

##### Final Overview for the Engineer
- Bootstrapping/Build Layer: index.html, vite.config.js, package.json, and ESLint configuration.
- Application Layer: main.jsx, App.jsx.
- UI Components Layer: Detailed layout of the FriendList, FriendListItem, Profile, and TransactionHistory components.
- Data & Assets Layer: Static JSON files and the assets folder.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Bootstrapping/Build Layer"
        indexHTML["index.html"]:::build
        viteConfig["vite.config.js"]:::build
        packageJSON["package.json"]:::build
        eslintConfig["eslint.config.js"]:::build
    end

    subgraph "React Application Layer"
        mainJSX["main.jsx"]:::app
        AppJSX["App.jsx"]:::app
    end

    subgraph "UI Components Layer"
        FriendList["FriendList"]:::ui
        FriendListItem["FriendListItem"]:::ui
        Profile["Profile"]:::ui
        TransactionHistory["TransactionHistory"]:::ui
    end

    subgraph "Data & Assets Layer"
        assets["assets"]:::data
        friendsJSON["friends.json"]:::data
        transactionJSON["transaction.json"]:::data
        userDataJSON["userData.json"]:::data
    end

    %% Flow connections
    indexHTML -->|"loads"| mainJSX
    mainJSX -->|"mounts"| AppJSX

    AppJSX -->|"renders"| FriendList
    AppJSX -->|"renders"| Profile
    AppJSX -->|"renders"| TransactionHistory
    FriendList -->|"includes"| FriendListItem

    friendsJSON -->|"supplies"| FriendList
    transactionJSON -->|"supplies"| TransactionHistory
    userDataJSON -->|"supplies"| Profile
    assets -->|"provides"| AppJSX

    %% Click Events
    click indexHTML "https://github.com/konstabash/goit-react-hw-01/blob/main/index.html"
    click viteConfig "https://github.com/konstabash/goit-react-hw-01/blob/main/vite.config.js"
    click packageJSON "https://github.com/konstabash/goit-react-hw-01/blob/main/package.json"
    click eslintConfig "https://github.com/konstabash/goit-react-hw-01/blob/main/eslint.config.js"
    click mainJSX "https://github.com/konstabash/goit-react-hw-01/blob/main/src/main.jsx"
    click AppJSX "https://github.com/konstabash/goit-react-hw-01/blob/main/src/App.jsx"
    click FriendList "https://github.com/konstabash/goit-react-hw-01/blob/main/src/components/FriendList/FriendList.jsx"
    click FriendListItem "https://github.com/konstabash/goit-react-hw-01/blob/main/src/components/FriendListItem/FriendListItem.jsx"
    click Profile "https://github.com/konstabash/goit-react-hw-01/blob/main/src/components/Profile/Profile.jsx"
    click TransactionHistory "https://github.com/konstabash/goit-react-hw-01/blob/main/src/components/TransactionHistory/TransactionHistory.jsx"
    click assets "https://github.com/konstabash/goit-react-hw-01/tree/main/src/assets"
    click friendsJSON "https://github.com/konstabash/goit-react-hw-01/blob/main/src/friends.json"
    click transactionJSON "https://github.com/konstabash/goit-react-hw-01/blob/main/src/transaction.json"
    click userDataJSON "https://github.com/konstabash/goit-react-hw-01/blob/main/src/userData.json"

    %% Styles
    classDef build fill:#ffdddd,stroke:#cc3333,stroke-width:2px;
    classDef app fill:#ddffdd,stroke:#33cc33,stroke-width:2px;
    classDef ui fill:#ddddff,stroke:#3333cc,stroke-width:2px;
    classDef data fill:#ffffdd,stroke:#cccc33,stroke-width:2px;
```
