# benameuraimad-beep/excel architecture

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

- Interactive diagram: https://gitdiagram.com/benameuraimad-beep/excel
- Repository: https://github.com/benameuraimad-beep/excel

## Overview

FinSight AI is a browser-based financial analysis dashboard. Users can sign in or continue as guests, upload a spreadsheet for parsed financial metrics and generated insights, explore dashboard charts and reports, and ask an advisor questions about the data. Sample templates, exports, authentication, localization, and PWA installation are additional capabilities. The README is empty; relationships below rely on the supplied excerpts and source index, so unsampled subsystem links are omitted where their callers are not shown.

Main entry points: [`src/App.tsx`](https://github.com/benameuraimad-beep/excel/blob/main/src/App.tsx) (Dashboard App), [`src/components/ReportsView.tsx`](https://github.com/benameuraimad-beep/excel/blob/main/src/components/ReportsView.tsx) (Financial Reports), [`src/components/AdvisorChat.tsx`](https://github.com/benameuraimad-beep/excel/blob/main/src/components/AdvisorChat.tsx) (Advisor Chat), [`src/context/AuthContext.tsx`](https://github.com/benameuraimad-beep/excel/blob/main/src/context/AuthContext.tsx) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["Dashboard App<br/>[App.tsx]"]
end

subgraph group_analysis["Financial Analysis"]
  node_formatters["Number Formatting<br/>[formatters.ts]"]
  node_upload["Spreadsheet Upload<br/>[UploadSection.tsx]"]
  node_parser["Spreadsheet Parser<br/>[excelParser.ts]"]
  node_insights["Insight Generator"]
  node_kpis["KPI Cards<br/>[KpiCards.tsx]"]
  node_revenue["Revenue Chart"]
  node_expenses["Expense Chart"]
  node_reports["Financial Reports<br/>[ReportsView.tsx]"]
  node_print["Print Report"]
  node_exporter["Workbook Exporter<br/>[excelExporter.ts]"]
  node_samples["Sample Templates<br/>[sampleData.ts]"]
  node_sampleview["Template Picker"]
end

subgraph group_advisory["Advisor"]
  node_chatview["Advisor View"]
  node_chat["Advisor Chat<br/>[AdvisorChat.tsx]"]
  node_chatservice["Chat Service<br/>[aiChatService.ts]"]
  node_speech["Speech Recognition"]
  node_chatapi{{"Chat API"}}
end

subgraph group_platform["Identity and Preferences"]
  node_authview["Sign-in View<br/>[AuthView.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_supabase[("Supabase Auth<br/>[supabase.ts]")]
  node_preferences["Language and Theme"]
  node_translations["Translations<br/>[translations.ts]"]
  node_pwa["PWA Install Hook<br/>[usePWAInstall.ts]"]
  node_installprompt["Install Prompt"]
end

node_user(("User"))

node_user -.->|"uses"| node_app
node_app -->|"checks session"| node_auth
node_authview -->|"signs in"| node_auth
node_auth -->|"authenticates"| node_supabase
node_app -->|"parses upload"| node_parser
node_app -->|"generates insights"| node_insights
node_app -->|"renders"| node_kpis
node_app -->|"renders"| node_revenue
node_app -.->|"renders"| node_upload
node_app -.->|"routes to"| node_reports
node_app -.->|"renders"| node_sampleview
node_sampleview -->|"reads templates"| node_samples
node_reports -->|"exports workbook"| node_exporter
node_reports -->|"renders print header"| node_print
node_app -.->|"renders"| node_expenses
node_chatview -->|"renders"| node_chat
node_chat -->|"requests advice"| node_chatservice
node_chat -->|"uses speech input"| node_speech
node_chatservice -->|"posts request"| node_chatapi
node_preferences -->|"loads translations"| node_translations
node_preferences -->|"formats currency"| node_formatters
node_installprompt -->|"uses install hook"| node_pwa

click node_app "https://github.com/benameuraimad-beep/excel/blob/main/src/App.tsx"
click node_authview "https://github.com/benameuraimad-beep/excel/blob/main/src/components/AuthView.tsx"
click node_auth "https://github.com/benameuraimad-beep/excel/blob/main/src/context/AuthContext.tsx"
click node_supabase "https://github.com/benameuraimad-beep/excel/blob/main/src/lib/supabase.ts"
click node_preferences "https://github.com/benameuraimad-beep/excel/blob/main/src/context/ThemeLanguageContext.tsx"
click node_translations "https://github.com/benameuraimad-beep/excel/blob/main/src/i18n/translations.ts"
click node_formatters "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/formatters.ts"
click node_upload "https://github.com/benameuraimad-beep/excel/blob/main/src/components/UploadSection.tsx"
click node_parser "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/excelParser.ts"
click node_insights "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/aiInsightsGenerator.ts"
click node_kpis "https://github.com/benameuraimad-beep/excel/blob/main/src/components/KpiCards.tsx"
click node_revenue "https://github.com/benameuraimad-beep/excel/blob/main/src/components/RevenueTrendChart.tsx"
click node_expenses "https://github.com/benameuraimad-beep/excel/blob/main/src/components/ExpenseDistributionChart.tsx"
click node_reports "https://github.com/benameuraimad-beep/excel/blob/main/src/components/ReportsView.tsx"
click node_print "https://github.com/benameuraimad-beep/excel/blob/main/src/components/PrintReportTemplate.tsx"
click node_exporter "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/excelExporter.ts"
click node_samples "https://github.com/benameuraimad-beep/excel/blob/main/src/data/sampleData.ts"
click node_sampleview "https://github.com/benameuraimad-beep/excel/blob/main/src/components/SampleTemplatesModal.tsx"
click node_chatview "https://github.com/benameuraimad-beep/excel/blob/main/src/components/ChatAdvisorView.tsx"
click node_chat "https://github.com/benameuraimad-beep/excel/blob/main/src/components/AdvisorChat.tsx"
click node_chatservice "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/aiChatService.ts"
click node_speech "https://github.com/benameuraimad-beep/excel/blob/main/src/utils/useSpeechRecognition.ts"
click node_pwa "https://github.com/benameuraimad-beep/excel/blob/main/src/hooks/usePWAInstall.ts"
click node_installprompt "https://github.com/benameuraimad-beep/excel/blob/main/src/components/PWAInstallPrompt.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_app,node_user toneBlue
class node_formatters,node_upload,node_parser,node_insights,node_kpis,node_revenue,node_expenses,node_reports,node_print,node_exporter,node_samples,node_sampleview toneAmber
class node_chatview,node_chat,node_chatservice,node_speech,node_chatapi toneMint
class node_authview,node_auth,node_supabase,node_preferences,node_translations,node_pwa,node_installprompt toneRose
```

## Components

### Application

- [Dashboard App](https://github.com/benameuraimad-beep/excel/blob/main/src/App.tsx): `src/App.tsx`

### Financial Analysis

- [Number Formatting](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/formatters.ts): `src/utils/formatters.ts`
- [Spreadsheet Upload](https://github.com/benameuraimad-beep/excel/blob/main/src/components/UploadSection.tsx): `src/components/UploadSection.tsx`
- [Spreadsheet Parser](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/excelParser.ts): `src/utils/excelParser.ts`
- [Insight Generator](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/aiInsightsGenerator.ts): `src/utils/aiInsightsGenerator.ts`
- [KPI Cards](https://github.com/benameuraimad-beep/excel/blob/main/src/components/KpiCards.tsx): `src/components/KpiCards.tsx`
- [Revenue Chart](https://github.com/benameuraimad-beep/excel/blob/main/src/components/RevenueTrendChart.tsx): `src/components/RevenueTrendChart.tsx`
- [Expense Chart](https://github.com/benameuraimad-beep/excel/blob/main/src/components/ExpenseDistributionChart.tsx): `src/components/ExpenseDistributionChart.tsx`
- [Financial Reports](https://github.com/benameuraimad-beep/excel/blob/main/src/components/ReportsView.tsx): `src/components/ReportsView.tsx`
- [Print Report](https://github.com/benameuraimad-beep/excel/blob/main/src/components/PrintReportTemplate.tsx): `src/components/PrintReportTemplate.tsx`
- [Workbook Exporter](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/excelExporter.ts): `src/utils/excelExporter.ts`
- [Sample Templates](https://github.com/benameuraimad-beep/excel/blob/main/src/data/sampleData.ts): `src/data/sampleData.ts`
- [Template Picker](https://github.com/benameuraimad-beep/excel/blob/main/src/components/SampleTemplatesModal.tsx): `src/components/SampleTemplatesModal.tsx`

### Advisor

- [Advisor View](https://github.com/benameuraimad-beep/excel/blob/main/src/components/ChatAdvisorView.tsx): `src/components/ChatAdvisorView.tsx`
- [Advisor Chat](https://github.com/benameuraimad-beep/excel/blob/main/src/components/AdvisorChat.tsx): `src/components/AdvisorChat.tsx`
- [Chat Service](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/aiChatService.ts): `src/utils/aiChatService.ts`
- [Speech Recognition](https://github.com/benameuraimad-beep/excel/blob/main/src/utils/useSpeechRecognition.ts): `src/utils/useSpeechRecognition.ts`
- **Chat API**

### Identity and Preferences

- [Sign-in View](https://github.com/benameuraimad-beep/excel/blob/main/src/components/AuthView.tsx): `src/components/AuthView.tsx`
- [Authentication](https://github.com/benameuraimad-beep/excel/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase Auth](https://github.com/benameuraimad-beep/excel/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Language and Theme](https://github.com/benameuraimad-beep/excel/blob/main/src/context/ThemeLanguageContext.tsx): `src/context/ThemeLanguageContext.tsx`
- [Translations](https://github.com/benameuraimad-beep/excel/blob/main/src/i18n/translations.ts): `src/i18n/translations.ts`
- [PWA Install Hook](https://github.com/benameuraimad-beep/excel/blob/main/src/hooks/usePWAInstall.ts): `src/hooks/usePWAInstall.ts`
- [Install Prompt](https://github.com/benameuraimad-beep/excel/blob/main/src/components/PWAInstallPrompt.tsx): `src/components/PWAInstallPrompt.tsx`

### Other components

- **User**

## Connections

- User → Dashboard App: uses
- Dashboard App → Authentication: checks session (evidence: `src/App.tsx`)
- Sign-in View → Authentication: signs in (evidence: `src/components/AuthView.tsx`)
- Authentication → Supabase Auth: authenticates (evidence: `src/context/AuthContext.tsx`)
- Dashboard App → Spreadsheet Parser: parses upload (evidence: `src/App.tsx`)
- Dashboard App → Insight Generator: generates insights (evidence: `src/App.tsx`)
- Dashboard App → KPI Cards: renders (evidence: `src/App.tsx`)
- Dashboard App → Revenue Chart: renders (evidence: `src/App.tsx`)
- Dashboard App → Spreadsheet Upload: renders (evidence: `src/App.tsx`)
- Dashboard App → Financial Reports: routes to (evidence: `src/App.tsx`)
- Dashboard App → Template Picker: renders (evidence: `src/App.tsx`)
- Template Picker → Sample Templates: reads templates (evidence: `src/components/SampleTemplatesModal.tsx`)
- Financial Reports → Workbook Exporter: exports workbook (evidence: `src/components/ReportsView.tsx`)
- Financial Reports → Print Report: renders print header (evidence: `src/components/ReportsView.tsx`)
- Dashboard App → Expense Chart: renders (evidence: `src/App.tsx`)
- Advisor View → Advisor Chat: renders (evidence: `src/components/ChatAdvisorView.tsx`)
- Advisor Chat → Chat Service: requests advice (evidence: `src/components/AdvisorChat.tsx`)
- Advisor Chat → Speech Recognition: uses speech input (evidence: `src/components/AdvisorChat.tsx`)
- Chat Service → Chat API: posts request (evidence: `src/utils/aiChatService.ts`)
- Language and Theme → Translations: loads translations (evidence: `src/context/ThemeLanguageContext.tsx`)
- Language and Theme → Number Formatting: formats currency (evidence: `src/context/ThemeLanguageContext.tsx`)
- Install Prompt → PWA Install Hook: uses install hook (evidence: `src/components/PWAInstallPrompt.tsx`)
