# prakhardubey2002/verifium architecture

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

- Interactive diagram: https://gitdiagram.com/prakhardubey2002/verifium
- Repository: https://github.com/prakhardubey2002/verifium

## Overview

##### Main Components
- Frontend Application (React): Represented by the overall Create React App setup. Include the public folder with index.html (the entry point) and the src directory where the application logic resides.
- Pages/Views: Include individual pages like Home, About, Admin, Login, Register, MintNft, NftData, User, etc. (found in src/pages) to indicate different screens/routes in the app.
- State Management / Context: Highlight the WalletContext (in src/Context/WalletContext.js) which manages the crucial blockchain wallet integration.
- Assets & Styling: Represent assets (animations and JSON files in src/assets) and styling (CSS files in src/css and src/pages/resources/css) as supporting elements for UI/UX.

- That the Public folder loads the initial webpage (index.html), which then bootstraps the React application.
- That user interactions on various pages drive state changes through components and are mediated by the WalletContext (which handles blockchain wallet connections).

##### Important Architectural Patterns and Design Principles
- Component-Based Architecture: Emphasize how the project splits UI into reusable components (Navbar, Footer, etc.) and pages.
- Separation of Concerns: Display how presentation (UI components), routing/pages, and state management (WalletContext) are clearly separated.
- Blockchain Integration: Make it evident that a central piece (WalletContext) connects with external blockchain services via Phantom wallet (as noted by the use of devnet and wallet switching instructions).

##### Relevant Technologies and Frameworks
- React (front-end framework, bootstrapped with Create React App)
- CSS and asset management (for animations and styling)
- Blockchain integration tools (Phantom wallet connection, interaction with blockchain on devnet)
- Optionally, indicate dependency on the external Verifium-backend service to complete the system picture

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Application Layer
    subgraph "Frontend Application"
        PublicIndex("public/index.html"):::frontend
        Src("src (Application Logic)"):::frontend
    end

    %% UI Components Layer
    subgraph "UI Components"
        Navbar("Navbar"):::frontend
        Footer("Footer"):::frontend
        Button("Button"):::frontend
        Sidebar("Sidebar"):::frontend
        NFTList("NFTList"):::frontend
    end

    %% Pages/Views Layer
    subgraph "Pages"
        Home("Home Page"):::frontend
        About("About Page"):::frontend
        Admin("Admin Page"):::frontend
        Login("Login Page"):::frontend
        Register("Register Page"):::frontend
        MintNft("MintNft Page"):::frontend
        NftData("NftData Page"):::frontend
        User("User Page"):::frontend
        Adx("Adx Page"):::frontend
        Details("Details Page"):::frontend
    end

    %% State Management / Context
    WalletContext("WalletContext"):::context

    %% Assets & Styling Layer
    subgraph "Assets & Styling"
        Assets("Assets"):::assets
        GlobalStyles("Global Styles"):::assets
        ComponentStyles("Component CSS"):::assets
        PageStyles("Page Resource Styles"):::assets
    end

    %% External Services
    Blockchain("Blockchain (Phantom Devnet)"):::external
    ExternalBackend("Verifium-backend (External)"):::external

    %% Data Flow
    PublicIndex -->|"bootstraps"| Src

    Src -->|"initializes"| Navbar
    Src -->|"initializes"| Home
    Src -->|"initializes"| WalletContext
    Src -->|"loads"| Assets

    %% Interaction from UI Components and Pages to WalletContext
    Navbar -->|"userInteraction"| WalletContext
    Home -->|"userAction"| WalletContext

    %% UI Components & Pages use Assets & Styling
    Footer -->|"styledWith"| GlobalStyles
    MintNft -->|"styledWith"| ComponentStyles

    %% WalletContext interactions with external blockchain and backend services
    WalletContext -->|"establishesConnection"| Blockchain
    WalletContext -->|"apiCalls"| ExternalBackend

    %% Styling connections (optional representative arrows)
    NFTList -->|"uses"| ComponentStyles
    About -->|"uses"| PageStyles

    %% Click Events for Frontend Application
    click PublicIndex "https://github.com/prakhardubey2002/verifium/blob/main/public/index.html"
    click Src "https://github.com/prakhardubey2002/verifium/tree/main/src/"

    %% Click Events for UI Components
    click Navbar "https://github.com/prakhardubey2002/verifium/blob/main/src/components/Navbar.jsx"
    click Footer "https://github.com/prakhardubey2002/verifium/blob/main/src/components/Footer.jsx"
    click Button "https://github.com/prakhardubey2002/verifium/blob/main/src/components/Button.jsx"
    click Sidebar "https://github.com/prakhardubey2002/verifium/blob/main/src/components/Sidebar.jsx"
    click NFTList "https://github.com/prakhardubey2002/verifium/blob/main/src/components/NFTList.jsx"

    %% Click Events for Pages/Views
    click Home "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Home.jsx"
    click About "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/About.jsx"
    click Admin "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Admin.jsx"
    click Login "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Login.jsx"
    click Register "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Register.jsx"
    click MintNft "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/MintNft.jsx"
    click NftData "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/NftData.jsx"
    click User "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/User.jsx"
    click Adx "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Adx.jsx"
    click Details "https://github.com/prakhardubey2002/verifium/blob/main/src/pages/Details.jsx"

    %% Click Event for State Management / Context
    click WalletContext "https://github.com/prakhardubey2002/verifium/blob/main/src/Context/WalletContext.js"

    %% Click Events for Assets & Styling
    click Assets "https://github.com/prakhardubey2002/verifium/tree/main/src/assets/"
    click GlobalStyles "https://github.com/prakhardubey2002/verifium/blob/main/src/App.css"
    click ComponentStyles "https://github.com/prakhardubey2002/verifium/tree/main/src/css/"
    click PageStyles "https://github.com/prakhardubey2002/verifium/tree/main/src/pages/resources/css/"

    %% Class Definitions for Colors
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef context fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef assets fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
