# cvazzz/ntt-hackaton architecture

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

- Interactive diagram: https://gitdiagram.com/cvazzz/ntt-hackaton
- Repository: https://github.com/cvazzz/ntt-hackaton

## Overview

##### Project type and purpose
- It appears to be a front-end client for a peer-to-peer lending and investment platform: borrowers can request loans, lenders can browse a marketplace, and investors can vote/deposit on “investment boards.”

##### File structure
- Top-level build/config files:
- vite.config.ts, tsconfig*.json, postcss.config.js, tailwind.config.ts
- package.json/lock files, eslint.config.js
- Public assets:
- public/robots.txt, index.html
- Source folder organization (src/):
- pages/ – route components (Dashboard, LoanDetails, MyInvestments…)
- components/ – UI primitives (components/ui) and feature modules (components/boards, components/borrower, components/lender)
- contexts/ – React context for user roles
- hooks/ – custom hooks (use-mobile, use-toast)
- services/ – API calls (investment-boards-service.ts)
- lib/ – shared utilities
- main.tsx, App.tsx + global CSS

##### README
- No content provided; we infer architecture solely from code structure.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entry and Bootstrapping
    Browser["Browser / Client"]:::external
    subgraph "Entry & Bootstrap"
        HTML["index.html"]:::entry
        Main["main.tsx"]:::entry
        App["App.tsx"]:::entry
    end
    Browser -->|"loads"| HTML -->|"boots"| Main -->|"renders"| App

    %% Global State & Utilities
    subgraph "State & Utilities"
        Context["User Role Context"]:::state
        HookMobile["use-mobile"]:::state
        HookToast["use-toast"]:::state
        Utils["utils"]:::state
    end
    App --> Context
    App --> HookMobile
    App --> HookToast
    App --> Utils

    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "UI Primitives"
            Accordion["Accordion"]:::ui
            Button["Button"]:::ui
            Dialog["Dialog"]:::ui
            %% ... other UI primitives
        end
        subgraph "Layout Components"
            AppHeader["App Header"]:::ui
            AppSidebar["App Sidebar"]:::ui
            AppLayout["App Layout"]:::ui
        end
    end
    App --> AppLayout
    AppLayout --> AppHeader
    AppLayout --> AppSidebar
    AppLayout --> Accordion
    AppLayout --> Button
    AppLayout --> Dialog

    %% Feature Modules
    subgraph "Feature Modules"
        subgraph "Borrower Module"
            BorrowerDashboard["Borrower Dashboard"]:::feature
            LoanRequestForm["Loan Request Form"]:::feature
            IBExplorerBorrower["Investment Boards Explorer"]:::feature
        end
        subgraph "Lender Module"
            LenderDashboard["Lender Dashboard"]:::feature
            LoanMarketplace["Loan Marketplace"]:::feature
        end
        subgraph "Boards Module"
            BoardDetails["Board Details"]:::feature
            BoardOverview["Investment Board Overview"]:::feature
            InvestmentDeposit["Investment Deposit"]:::feature
            InvestmentVoting["Investment Voting"]:::feature
            StartupReq["Startup Requirements"]:::feature
        end
        subgraph "Loan Details Module"
            LoanActivity["Loan Activity"]:::feature
            LoanInvestment["Loan Investment"]:::feature
            LoanRepaymentChart["Loan Repayment Chart"]:::feature
        end
    end
    AppLayout --> BorrowerDashboard
    AppLayout --> LoanRequestForm
    AppLayout --> IBExplorerBorrower
    AppLayout --> LenderDashboard
    AppLayout --> LoanMarketplace
    AppLayout --> BoardDetails
    AppLayout --> BoardOverview
    AppLayout --> InvestmentDeposit
    AppLayout --> InvestmentVoting
    AppLayout --> StartupReq
    AppLayout --> LoanActivity
    AppLayout --> LoanInvestment
    AppLayout --> LoanRepaymentChart

    %% Pages / Routing
    subgraph "Pages (Routing)"
        DashboardPage["Dashboard Page"]:::page
        LoanDetailsPage["Loan Details Page"]:::page
        ActiveLoanDetails["Active Loan Details"]:::page
        BoardsList["Boards List"]:::page
        BoardDetailsPage["Board Details Page"]:::page
        BoardInvPage["Board Investment Page"]:::page
        MyInvestmentsPage["My Investments"]:::page
        MyLoansPage["My Loans"]:::page
        RequestLoanPage["Request Loan"]:::page
        RepaymentCalPage["Repayment Calendar"]:::page
        IBExplorerPage["Investment Boards Explorer"]:::page
    end
    App --> DashboardPage
    App --> LoanDetailsPage
    App --> ActiveLoanDetails
    App --> BoardsList
    App --> BoardDetailsPage
    App --> BoardInvPage
    App --> MyInvestmentsPage
    App --> MyLoansPage
    App --> RequestLoanPage
    App --> RepaymentCalPage
    App --> IBExplorerPage

    %% Data & Services
    Service["investment-boards-service"]:::service
    subgraph "External Services"
        Auth["Auth Service"]:::external
        API["Backend API"]:::external
        DB["Database"]:::external
        ThirdParty["Third-Party Integrations"]:::external
    end
    BorrowerDashboard -->|"calls"| Service
    LenderDashboard -->|"calls"| Service
    BoardOverview -->|"calls"| Service
    LoanDetailsPage -->|"calls"| Service
    Service -->|"HTTP"| API
    API -->|"auth via"| Auth
    API -->|"reads/writes"| DB
    App --> ThirdParty

    %% Click Events
    click HTML "https://github.com/cvazzz/ntt-hackaton/blob/master/index.html"
    click Main "https://github.com/cvazzz/ntt-hackaton/blob/master/src/main.tsx"
    click App "https://github.com/cvazzz/ntt-hackaton/blob/master/src/App.tsx"
    click Accordion "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/ui/accordion.tsx"
    click Button "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/ui/button.tsx"
    click Dialog "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/ui/dialog.tsx"
    click AppHeader "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/app-header.tsx"
    click AppSidebar "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/app-sidebar.tsx"
    click AppLayout "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/app-layout.tsx"
    click BorrowerDashboard "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/borrower/borrower-dashboard.tsx"
    click LoanRequestForm "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/borrower/loan-request-form.tsx"
    click IBExplorerBorrower "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/borrower/investment-boards-explorer.tsx"
    click LenderDashboard "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/lender/lender-dashboard.tsx"
    click LoanMarketplace "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/lender/loan-marketplace.tsx"
    click BoardDetails "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/boards/board-details.tsx"
    click BoardOverview "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/boards/investment-board.tsx"
    click InvestmentDeposit "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/boards/investment-deposit.tsx"
    click InvestmentVoting "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/boards/investment-voting.tsx"
    click StartupReq "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/boards/startup-requirements.tsx"
    click LoanActivity "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/loan-activity.tsx"
    click LoanInvestment "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/loan-investment.tsx"
    click LoanRepaymentChart "https://github.com/cvazzz/ntt-hackaton/blob/master/src/components/loan-repayment-chart.tsx"
    click DashboardPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/Dashboard.tsx"
    click LoanDetailsPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/LoanDetails.tsx"
    click ActiveLoanDetails "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/ActiveLoanDetails.tsx"
    click BoardsList "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/Boards.tsx"
    click BoardDetailsPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/BoardDetails.tsx"
    click BoardInvPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/BoardInvestment.tsx"
    click MyInvestmentsPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/MyInvestments.tsx"
    click MyLoansPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/MyLoans.tsx"
    click RequestLoanPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/RequestLoan.tsx"
    click RepaymentCalPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/RepaymentCalendar.tsx"
    click IBExplorerPage "https://github.com/cvazzz/ntt-hackaton/blob/master/src/pages/InvestmentBoardsExplorer.tsx"
    click Context "https://github.com/cvazzz/ntt-hackaton/blob/master/src/contexts/user-role-context.tsx"
    click HookMobile "https://github.com/cvazzz/ntt-hackaton/blob/master/src/hooks/use-mobile.tsx"
    click HookToast "https://github.com/cvazzz/ntt-hackaton/blob/master/src/hooks/use-toast.ts"
    click Utils "https://github.com/cvazzz/ntt-hackaton/blob/master/src/lib/utils.ts"
    click Service "https://github.com/cvazzz/ntt-hackaton/blob/master/src/services/investment-boards-service.ts"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366d6,stroke-width:1px
    classDef feature fill:#E8F6D0,stroke:#22863A,stroke-width:1px
    classDef service fill:#FFE8D0,stroke:#D1860D,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#6a737d,stroke-width:1px,stroke-dasharray: 5 5
    classDef state fill:#E8FFE8,stroke:#22863A,stroke-width:1px
    classDef entry fill:#FFF1E5,stroke:#D1860D,stroke-width:1px
    classDef page fill:#F0FFF0,stroke:#2C912C,stroke-width:1px
```
