# rapatinitishkumarreddy/spv-commitment-tracker architecture

> Architecture diagram of the GitHub repository rapatinitishkumarreddy/spv-commitment-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rapatinitishkumarreddy/spv-commitment-tracker
- Repository: https://github.com/rapatinitishkumarreddy/spv-commitment-tracker

## Overview

SPV Commitment Tracker is a browser-based app for importing commitment CSVs, reviewing row-level outcomes, and tracking funding by SPV. The main flow is upload → parse and validate → save the successful raw CSV in browser storage → revalidate it for the SPV list and detail views. The views surface target conflicts, over-subscription, accepted commitments, and rows needing review. The README documents the browser-only storage model; implementation edges below are limited to relationships visible in excerpts or the source index.

Main entry points: [`app/spvs/[slug]/_components/SpvDetailView.tsx`](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/SpvDetailView.tsx) (SPV detail view), [`lib/commitments/importCommitments.ts`](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/importCommitments.ts) (Import validation), [`app/import/_components/CsvImportForm.tsx`](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/CsvImportForm.tsx) (CSV upload form), [`app/_components/SpvList.tsx`](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvList.tsx) (SPV list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_import["CSV Import"]
  node_import_form["CSV upload form<br/>[CsvImportForm.tsx]"]
  node_import_results["Import results<br/>[ImportResults.tsx]"]
  node_row_issues["Row issue tables<br/>[RowIssuesTable.tsx]"]
  node_accepted_rows["Accepted rows table"]
end

subgraph group_domain["Commitment Domain"]
  node_csv_parser["CSV parser<br/>[parseCsv.ts]"]
  node_import_engine["Import validation"]
  node_header_check["Header validation<br/>[headers.ts]"]
  node_amount_normalize["Amount normalization<br/>[normalizeAmount.ts]"]
  node_email_normalize["Email normalization<br/>[normalizeEmail.ts]"]
  node_target_conflicts["Target conflict detection"]
  node_spv_summary["SPV summaries<br/>[summarizeSpvs.ts]"]
  node_detail_lookup["SPV detail lookup<br/>[getSpvDetail.ts]"]
end

subgraph group_storage["Browser Persistence"]
  node_browser_store[("Import store<br/>[importStore.ts]")]
  node_import_hook["Imported data hook<br/>[useImportedData.ts]"]
  node_local_storage[("Browser localStorage")]
end

subgraph group_views["SPV Views"]
  node_spv_list["SPV list<br/>[SpvList.tsx]"]
  node_summary_table["SPV summary table"]
  node_detail_view["SPV detail view<br/>[SpvDetailView.tsx]"]
  node_investor_table["Investor commitments"]
  node_review_table["Needs-review table"]
end

subgraph group_shared["Shared UI"]
  node_conflict_alert["Target conflict alert"]
  node_over_alert["Over-subscription alert"]
end

node_user(("CSV user"))

node_user -->|"uploads CSV"| node_import_form
node_import_form -->|"validates CSV"| node_import_engine
node_import_engine -->|"parses text"| node_csv_parser
node_import_engine -->|"checks headers"| node_header_check
node_import_engine -->|"normalizes amounts"| node_amount_normalize
node_import_engine -->|"normalizes email"| node_email_normalize
node_import_engine -->|"detects conflicts"| node_target_conflicts
node_import_form -->|"saves successful import"| node_browser_store
node_browser_store -->|"reads and writes"| node_local_storage
node_import_form -->|"renders outcomes"| node_import_results
node_import_results -->|"renders issues"| node_row_issues
node_import_results -->|"renders accepted rows"| node_accepted_rows
node_import_hook -->|"reads saved import"| node_browser_store
node_import_hook -->|"revalidates CSV"| node_import_engine
node_spv_list -->|"loads imported data"| node_import_hook
node_spv_list -->|"summarizes accepted rows"| node_spv_summary
node_spv_list -->|"renders SPV totals"| node_summary_table
node_summary_table -->|"describes conflicts"| node_conflict_alert
node_detail_view -->|"loads imported data"| node_import_hook
node_detail_view -->|"looks up SPV"| node_detail_lookup
node_detail_view -->|"renders commitments"| node_investor_table
node_detail_view -->|"renders review rows"| node_review_table
node_detail_view -->|"shows target warning"| node_conflict_alert
node_detail_view -->|"shows funding warning"| node_over_alert
node_user -->|"views SPVs"| node_spv_list
node_user -->|"opens SPV detail"| node_detail_view

click node_import_form "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/CsvImportForm.tsx"
click node_csv_parser "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/csv/parseCsv.ts"
click node_import_engine "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/importCommitments.ts"
click node_header_check "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/headers.ts"
click node_amount_normalize "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/normalizeAmount.ts"
click node_email_normalize "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/normalizeEmail.ts"
click node_target_conflicts "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/detectSpvTargetConflicts.ts"
click node_import_results "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/ImportResults.tsx"
click node_row_issues "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/RowIssuesTable.tsx"
click node_accepted_rows "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/AcceptedRowsTable.tsx"
click node_browser_store "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/importStore.ts"
click node_import_hook "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_lib/useImportedData.ts"
click node_spv_list "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvList.tsx"
click node_spv_summary "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/summarizeSpvs.ts"
click node_summary_table "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvSummaryTable.tsx"
click node_detail_view "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/SpvDetailView.tsx"
click node_detail_lookup "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/getSpvDetail.ts"
click node_investor_table "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/InvestorCommitmentsTable.tsx"
click node_review_table "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/NeedsReviewTable.tsx"
click node_conflict_alert "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvConflictAlert.tsx"
click node_over_alert "https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/OverSubscriptionAlert.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_import_form,node_import_results,node_row_issues,node_accepted_rows,node_user toneBlue
class node_csv_parser,node_import_engine,node_header_check,node_amount_normalize,node_email_normalize,node_target_conflicts,node_spv_summary,node_detail_lookup toneAmber
class node_browser_store,node_import_hook,node_local_storage toneMint
class node_spv_list,node_summary_table,node_detail_view,node_investor_table,node_review_table toneRose
class node_conflict_alert,node_over_alert toneIndigo
```

## Components

### CSV Import

- [CSV upload form](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/CsvImportForm.tsx): `app/import/_components/CsvImportForm.tsx`
- [Import results](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/ImportResults.tsx): `app/import/_components/ImportResults.tsx`
- [Row issue tables](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/RowIssuesTable.tsx): `app/import/_components/RowIssuesTable.tsx`
- [Accepted rows table](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/import/_components/AcceptedRowsTable.tsx): `app/import/_components/AcceptedRowsTable.tsx`

### Commitment Domain

- [CSV parser](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/csv/parseCsv.ts): `lib/csv/parseCsv.ts`
- [Import validation](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/importCommitments.ts): `lib/commitments/importCommitments.ts`
- [Header validation](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/headers.ts): `lib/commitments/headers.ts`
- [Amount normalization](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/normalizeAmount.ts): `lib/commitments/normalizeAmount.ts`
- [Email normalization](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/normalizeEmail.ts): `lib/commitments/normalizeEmail.ts`
- [Target conflict detection](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/detectSpvTargetConflicts.ts): `lib/commitments/detectSpvTargetConflicts.ts`
- [SPV summaries](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/summarizeSpvs.ts): `lib/commitments/summarizeSpvs.ts`
- [SPV detail lookup](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/getSpvDetail.ts): `lib/commitments/getSpvDetail.ts`

### Browser Persistence

- [Import store](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/lib/commitments/importStore.ts): `lib/commitments/importStore.ts`
- [Imported data hook](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_lib/useImportedData.ts): `app/_lib/useImportedData.ts`
- **Browser localStorage**

### SPV Views

- [SPV list](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvList.tsx): `app/_components/SpvList.tsx`
- [SPV summary table](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvSummaryTable.tsx): `app/_components/SpvSummaryTable.tsx`
- [SPV detail view](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/SpvDetailView.tsx): `app/spvs/[slug]/_components/SpvDetailView.tsx`
- [Investor commitments](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/InvestorCommitmentsTable.tsx): `app/spvs/[slug]/_components/InvestorCommitmentsTable.tsx`
- [Needs-review table](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/spvs/%5Bslug%5D/_components/NeedsReviewTable.tsx): `app/spvs/[slug]/_components/NeedsReviewTable.tsx`

### Shared UI

- [Target conflict alert](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/SpvConflictAlert.tsx): `app/_components/SpvConflictAlert.tsx`
- [Over-subscription alert](https://github.com/rapatinitishkumarreddy/spv-commitment-tracker/blob/main/app/_components/OverSubscriptionAlert.tsx): `app/_components/OverSubscriptionAlert.tsx`

### Other components

- **CSV user**

## Connections

- CSV user → CSV upload form: uploads CSV (evidence: `README.md`)
- CSV upload form → Import validation: validates CSV (evidence: `app/import/_components/CsvImportForm.tsx`)
- Import validation → CSV parser: parses text (evidence: `lib/commitments/importCommitments.ts`)
- Import validation → Header validation: checks headers (evidence: `lib/commitments/importCommitments.ts`)
- Import validation → Amount normalization: normalizes amounts (evidence: `lib/commitments/importCommitments.ts`)
- Import validation → Email normalization: normalizes email (evidence: `lib/commitments/importCommitments.ts`)
- Import validation → Target conflict detection: detects conflicts (evidence: `lib/commitments/importCommitments.ts`)
- CSV upload form → Import store: saves successful import (evidence: `app/import/_components/CsvImportForm.tsx`)
- Import store → Browser localStorage: reads and writes (evidence: `README.md`)
- CSV upload form → Import results: renders outcomes (evidence: `app/import/_components/CsvImportForm.tsx`)
- Import results → Row issue tables: renders issues (evidence: `app/import/_components/ImportResults.tsx`)
- Import results → Accepted rows table: renders accepted rows (evidence: `app/import/_components/ImportResults.tsx`)
- Imported data hook → Import store: reads saved import (evidence: `app/_lib/useImportedData.ts`)
- Imported data hook → Import validation: revalidates CSV (evidence: `app/_lib/useImportedData.ts`)
- SPV list → Imported data hook: loads imported data (evidence: `app/_components/SpvList.tsx`)
- SPV list → SPV summaries: summarizes accepted rows (evidence: `app/_components/SpvList.tsx`)
- SPV list → SPV summary table: renders SPV totals (evidence: `app/_components/SpvList.tsx`)
- SPV summary table → Target conflict alert: describes conflicts (evidence: `app/_components/SpvSummaryTable.tsx`)
- SPV detail view → Imported data hook: loads imported data (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- SPV detail view → SPV detail lookup: looks up SPV (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- SPV detail view → Investor commitments: renders commitments (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- SPV detail view → Needs-review table: renders review rows (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- SPV detail view → Target conflict alert: shows target warning (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- SPV detail view → Over-subscription alert: shows funding warning (evidence: `app/spvs/[slug]/_components/SpvDetailView.tsx`)
- CSV user → SPV list: views SPVs (evidence: `README.md`)
- CSV user → SPV detail view: opens SPV detail (evidence: `README.md`)
