# edwinisac/bank-front architecture

> Architecture diagram of the GitHub repository edwinisac/bank-front, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edwinisac/bank-front
- Repository: https://github.com/edwinisac/bank-front

## Overview

1. **Overall shape**
   - This is a **client-side React single-page application** built with **Vite**.
   - The app is organized around a loan/recovery operations workflow: authentication, dashboard operations, agent management, and reporting.
   - There is **no server-side code in the repo**, so the visible architecture is front-end only, with any data persistence likely coming from a mocked/local source such as `db.json`.

2. **Application entry and shell**
   - `src/main.jsx` is the React bootstrap point.
   - `src/App.jsx` appears to be the top-level composition layer, while `src/Layout/MainLayout.jsx` likely defines the shared shell around the app.
   - `Navbar.jsx` is a persistent navigation component, suggesting a common frame used across authenticated pages.

3. **Authentication boundary**
   - `src/context/AuthContext.jsx` provides the app’s auth state and authentication-related actions.
   - `src/protection/Protect.jsx` acts as a route guard or access gate for private sections.
   - `src/pages/login/AuthPage.jsx` is the entry point for unauthenticated users.
   - Architecturally, this creates a clear split between public login and protected operational screens.

4. **Core operational dashboard**
   - `src/pages/dashboard/DashBoard.jsx` is the main executive/operations view.
   - It is composed of smaller dashboard panels:
     - `Intro.jsx`
     - `AlertsPanel.jsx`
     - `RecoveryPipeline.jsx`
     - `OverdueLoans.jsx`
     - `AssignLoanDashboard.jsx`
   - These components imply the dashboard is used to monitor loan recovery status, overdue items, and assignment workflows in one consolidated surface.

5. **Agent management subsystem**
   - `src/pages/agents/AgentsDisplay.jsx` is the main list/view for agents.
   - `AgentCard.jsx` represents the reusable card-level UI for a single agent.
   - `EditAgentModal.jsx` supports inline editing via modal interaction.
   - This subsystem is likely centered on reviewing agent performance and maintaining agent records.

6. **Loan interaction and modal workflows**
   - `src/components/Form.jsx` suggests a shared form used for creating or editing loan-related records.
   - `LoanModal.jsx` and `LoanDetailsModal.jsx` indicate modal-driven workflows for assigning loans and inspecting loan details.
   - These components form a transactional UI layer separate from the main dashboard summaries.

7. **Reporting and analytics**
   - `src/pages/reports/ReportDisplay.jsx` is the container for reporting screens.
   - Supporting visualization components include:
     - `AgentsPerformanceChart.jsx`
     - `OverdueCollectionPie.jsx`
     - `RecoveryTrends.jsx`
     - `TransactionsTable.jsx`
   - This section is the analytics boundary of the app, turning operational data into chart and table views for decision-making.

8. **Data flow and state sharing**
   - The app appears to rely primarily on **React props and context** for state propagation.
   - Authentication state is centralized in `AuthContext`, while other domain data likely flows from page containers into presentational components and modals.
   - The absence of a dedicated `api/` or `services/` folder suggests the repository is either using local/mock data or keeps data access embedded in page components.

9. **Mock or local data layer**
   - The presence of `db.json` is the strongest signal of a **mock backend or fixture-driven setup**.
   - For an architecture diagram, it is reasonable to show a local JSON-based data source feeding dashboard, agent, loan, and report views during development.

10. **Styling and component boundaries**
   - Styling is co-located with components and pages via individual CSS files, such as `form.css`, `dashboard.css`, `reportDisplay.css`, etc.
   - Global styles live in `src/index.css` and `src/App.css`.
   - This means the visual architecture is strongly component-scoped rather than driven by a central design system.

11. **Assets and static content**
   - `src/assets/hero-images` holds visual assets used by the UI.
   - `public/` provides Vite static hosting support for assets that need direct public access.
   - These are supporting resources, not primary application logic.

12. **Tooling and runtime**
   - The repo is a standard **React + Vite** setup with ESLint configured (`eslint.config.js`) and Vite build config (`vite.config.js`).
   - This is a browser runtime application; there is no evidence of SSR, backend workers, or deployment-specific infrastructure in the repository itself.

Main entry points: [`src/pages/dashboard/DashBoard.jsx`](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/DashBoard.jsx) (Dashboard), [`src/pages/reports/ReportDisplay.jsx`](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/ReportDisplay.jsx) (Reports), [`src/App.jsx`](https://github.com/edwinisac/bank-front/blob/main/src/App.jsx) (App), [`src/protection/Protect.jsx`](https://github.com/edwinisac/bank-front/blob/main/src/protection/Protect.jsx) (Protect)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_main(("main<br/>bootstrap<br/>[main.jsx]"))
  node_app["App<br/>composition<br/>[App.jsx]"]
  node_layout["Main layout<br/>shell<br/>[MainLayout.jsx]"]
  node_navbar["Navbar<br/>[Navbar.jsx]"]
end

subgraph group_auth["Auth"]
  node_authctx["Auth context<br/>state<br/>[AuthContext.jsx]"]
  node_protect{{"Protect<br/>guard<br/>[Protect.jsx]"}}
  node_login["Login<br/>page<br/>[AuthPage.jsx]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Dashboard<br/>page<br/>[DashBoard.jsx]"]
  node_intro["Intro<br/>panel<br/>[Intro.jsx]"]
  node_alerts["Alerts<br/>panel<br/>[AlertsPanel.jsx]"]
  node_pipeline["Pipeline<br/>panel"]
  node_overdue["Overdue<br/>panel<br/>[OverdueLoans.jsx]"]
  node_assign["Assign loans<br/>panel"]
end

subgraph group_agents["Agents"]
  node_agentsview["Agents<br/>page<br/>[AgentsDisplay.jsx]"]
  node_agentcard["Agent card<br/>[AgentCard.jsx]"]
  node_editagent["Edit agent<br/>modal<br/>[EditAgentModal.jsx]"]
end

subgraph group_loans["Loans"]
  node_form["Form<br/>[Form.jsx]"]
  node_loanmodal["Loan modal<br/>[LoanModal.jsx]"]
  node_loandetails["Loan details<br/>modal"]
end

subgraph group_reports["Reports"]
  node_reportsview["Reports<br/>page<br/>[ReportDisplay.jsx]"]
  node_perfchart(("Performance<br/>chart"))
  node_piechart(("Overdue pie<br/>chart"))
  node_trendchart(("Trends<br/>chart<br/>[RecoveryTrends.jsx]"))
  node_transactions["Transactions<br/>table"]
end

subgraph group_data["Data"]
  node_db[("db.json<br/>mock data<br/>[db.json]")]
end

node_main -->|"boots"| node_app
node_app -->|"provides"| node_authctx
node_app -->|"routes"| node_protect
node_app -->|"wraps"| node_layout
node_layout -->|"includes"| node_navbar
node_app -->|"public"| node_login
node_protect -->|"allows"| node_dashboard
node_protect -->|"allows"| node_agentsview
node_protect -->|"allows"| node_reportsview
node_dashboard -->|"contains"| node_intro
node_dashboard -->|"contains"| node_alerts
node_dashboard -->|"contains"| node_pipeline
node_dashboard -->|"contains"| node_overdue
node_dashboard -->|"contains"| node_assign
node_agentsview -->|"renders"| node_agentcard
node_agentsview -->|"edits"| node_editagent
node_loanmodal -->|"uses"| node_form
node_loandetails -.->|"shares"| node_form
node_dashboard -->|"opens"| node_loanmodal
node_dashboard -->|"opens"| node_loandetails
node_reportsview -->|"contains"| node_perfchart
node_reportsview -->|"contains"| node_piechart
node_reportsview -->|"contains"| node_trendchart
node_reportsview -->|"contains"| node_transactions
node_db -.->|"feeds"| node_dashboard
node_db -.->|"feeds"| node_agentsview
node_db -.->|"feeds"| node_reportsview
node_authctx -->|"authenticates"| node_login
node_authctx -->|"checks"| node_protect

click node_main "https://github.com/edwinisac/bank-front/blob/main/src/main.jsx"
click node_app "https://github.com/edwinisac/bank-front/blob/main/src/App.jsx"
click node_layout "https://github.com/edwinisac/bank-front/blob/main/src/Layout/MainLayout.jsx"
click node_navbar "https://github.com/edwinisac/bank-front/blob/main/src/components/Navbar.jsx"
click node_authctx "https://github.com/edwinisac/bank-front/blob/main/src/context/AuthContext.jsx"
click node_protect "https://github.com/edwinisac/bank-front/blob/main/src/protection/Protect.jsx"
click node_login "https://github.com/edwinisac/bank-front/blob/main/src/pages/login/AuthPage.jsx"
click node_dashboard "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/DashBoard.jsx"
click node_intro "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/Intro.jsx"
click node_alerts "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/AlertsPanel.jsx"
click node_pipeline "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/RecoveryPipeline.jsx"
click node_overdue "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/OverdueLoans.jsx"
click node_assign "https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/AssignLoanDashboard.jsx"
click node_agentsview "https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/AgentsDisplay.jsx"
click node_agentcard "https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/AgentCard.jsx"
click node_editagent "https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/EditAgentModal.jsx"
click node_form "https://github.com/edwinisac/bank-front/blob/main/src/components/Form.jsx"
click node_loanmodal "https://github.com/edwinisac/bank-front/blob/main/src/components/LoanModal.jsx"
click node_loandetails "https://github.com/edwinisac/bank-front/blob/main/src/components/LoanDetailsModal.jsx"
click node_reportsview "https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/ReportDisplay.jsx"
click node_perfchart "https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/AgentsPerformanceChart.jsx"
click node_piechart "https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/OverdueCollectionPie.jsx"
click node_trendchart "https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/RecoveryTrends.jsx"
click node_transactions "https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/TransactionsTable.jsx"
click node_db "https://github.com/edwinisac/bank-front/blob/main/db.json"

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_main,node_app,node_layout,node_navbar,node_db toneBlue
class node_authctx,node_protect,node_login toneAmber
class node_dashboard,node_intro,node_alerts,node_pipeline,node_overdue,node_assign toneMint
class node_agentsview,node_agentcard,node_editagent toneRose
class node_form,node_loanmodal,node_loandetails toneIndigo
class node_reportsview,node_perfchart,node_piechart,node_trendchart,node_transactions toneTeal
```

## Components

### App Shell

Application bootstrap and shared frame

- [main](https://github.com/edwinisac/bank-front/blob/main/src/main.jsx): bootstrap · React entry point · `src/main.jsx`
- [App](https://github.com/edwinisac/bank-front/blob/main/src/App.jsx): composition · Top-level application routing/composition · `src/App.jsx`
- [Main layout](https://github.com/edwinisac/bank-front/blob/main/src/Layout/MainLayout.jsx): shell · Shared authenticated page frame · `src/Layout/MainLayout.jsx`
- [Navbar](https://github.com/edwinisac/bank-front/blob/main/src/components/Navbar.jsx): nav · Persistent navigation component · `src/components/Navbar.jsx`

### Auth

Authentication and route protection

- [Auth context](https://github.com/edwinisac/bank-front/blob/main/src/context/AuthContext.jsx): state · Authentication state and actions · `src/context/AuthContext.jsx`
- [Protect](https://github.com/edwinisac/bank-front/blob/main/src/protection/Protect.jsx): guard · Private route access gate · `src/protection/Protect.jsx`
- [Login](https://github.com/edwinisac/bank-front/blob/main/src/pages/login/AuthPage.jsx): page · Unauthenticated sign-in screen · `src/pages/login/AuthPage.jsx`

### Dashboard

Operational loan recovery overview

- [Dashboard](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/DashBoard.jsx): page · Operations overview dashboard · `src/pages/dashboard/DashBoard.jsx`
- [Intro](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/Intro.jsx): panel · Dashboard intro/summary panel · `src/pages/dashboard/Intro.jsx`
- [Alerts](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/AlertsPanel.jsx): panel · Operational alerts panel · `src/pages/dashboard/AlertsPanel.jsx`
- [Pipeline](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/RecoveryPipeline.jsx): panel · Recovery pipeline view · `src/pages/dashboard/RecoveryPipeline.jsx`
- [Overdue](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/OverdueLoans.jsx): panel · Overdue loans summary · `src/pages/dashboard/OverdueLoans.jsx`
- [Assign loans](https://github.com/edwinisac/bank-front/blob/main/src/pages/dashboard/AssignLoanDashboard.jsx): panel · Loan assignment dashboard panel · `src/pages/dashboard/AssignLoanDashboard.jsx`

### Agents

Agent management screens

- [Agents](https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/AgentsDisplay.jsx): page · Agent management screen · `src/pages/agents/AgentsDisplay.jsx`
- [Agent card](https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/AgentCard.jsx): card · Reusable agent display card · `src/pages/agents/AgentCard.jsx`
- [Edit agent](https://github.com/edwinisac/bank-front/blob/main/src/pages/agents/EditAgentModal.jsx): modal · Agent editing modal · `src/pages/agents/EditAgentModal.jsx`

### Loans

Loan interaction modals and forms

- [Form](https://github.com/edwinisac/bank-front/blob/main/src/components/Form.jsx): form · Shared loan/record form · `src/components/Form.jsx`
- [Loan modal](https://github.com/edwinisac/bank-front/blob/main/src/components/LoanModal.jsx): modal · Loan assignment/edit modal · `src/components/LoanModal.jsx`
- [Loan details](https://github.com/edwinisac/bank-front/blob/main/src/components/LoanDetailsModal.jsx): modal · Loan detail inspection modal · `src/components/LoanDetailsModal.jsx`

### Reports

Analytics and reporting views

- [Reports](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/ReportDisplay.jsx): page · Analytics and reporting screen · `src/pages/reports/ReportDisplay.jsx`
- [Performance](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/AgentsPerformanceChart.jsx): chart · Agent performance chart · `src/pages/reports/AgentsPerformanceChart.jsx`
- [Overdue pie](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/OverdueCollectionPie.jsx): chart · Overdue collection pie chart · `src/pages/reports/OverdueCollectionPie.jsx`
- [Trends](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/RecoveryTrends.jsx): chart · Recovery trends chart · `src/pages/reports/RecoveryTrends.jsx`
- [Transactions](https://github.com/edwinisac/bank-front/blob/main/src/pages/reports/TransactionsTable.jsx): table · Transactions table view · `src/pages/reports/TransactionsTable.jsx`

### Data

Local/mock data source

- [db.json](https://github.com/edwinisac/bank-front/blob/main/db.json): mock data · Local JSON-backed data source · `db.json`

## Connections

- main → App: boots · React mounts the application
- App → Auth context: provides · Auth state is made available to the app
- App → Protect: routes · Private sections are guarded
- App → Main layout: wraps · Shared shell is composed around screens
- Main layout → Navbar: includes · Persistent navigation inside the shell
- App → Login: public · Unauthenticated entry screen
- Protect → Dashboard: allows · Protected operational view
- Protect → Agents: allows · Protected agent management view
- Protect → Reports: allows · Protected reporting view
- Dashboard → Intro: contains · Dashboard summary panel
- Dashboard → Alerts: contains · Alerts panel
- Dashboard → Pipeline: contains · Recovery pipeline panel
- Dashboard → Overdue: contains · Overdue loans panel
- Dashboard → Assign loans: contains · Assignment workflow panel
- Agents → Agent card: renders · Agent list is composed from cards
- Agents → Edit agent: edits · Inline agent editing via modal
- Loan modal → Form: uses · Shared form drives loan transactions
- Loan details → Form: shares · Loan detail flows share form infrastructure
- Dashboard → Loan modal: opens · Dashboard can launch loan actions
- Dashboard → Loan details: opens · Dashboard can inspect loan details
- Reports → Performance: contains · Agent performance visualization
- Reports → Overdue pie: contains · Overdue collections breakdown
- Reports → Trends: contains · Recovery trend visualization
- Reports → Transactions: contains · Tabular transaction reporting
- db.json → Dashboard: feeds · Mock data supports dashboard views
- db.json → Agents: feeds · Mock data supports agent management
- db.json → Reports: feeds · Mock data supports reporting views
- Auth context → Login: authenticates · Login updates auth state
- Auth context → Protect: checks · Route guard reads auth state
