# mahesh2611975/credolocal architecture

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

- Interactive diagram: https://gitdiagram.com/mahesh2611975/credolocal
- Repository: https://github.com/mahesh2611975/credolocal

## Overview

MicroFinance Platform supports applicant loan underwriting and lender review, with a React client, FastAPI API, ML scoring, PostgreSQL-backed records, and optional blockchain and S3 integrations. The main applicant journey runs from registration and document submission through eligibility, EMI and lender selection, submission, and application tracking; lenders review applications in a separate dashboard. The README documents on-device SMS feature extraction, while implementation excerpts are incomplete, so unverified connections are omitted. Optional blockchain and S3 paths are shown separately.

Main entry points: [`backend/app/routers/applications.py`](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/applications.py) (Application routes), [`frontend/src/App.jsx`](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/App.jsx) (Web routes), [`backend/app/database.py`](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/database.py) (Database sessions), [`backend/app/models/models.py`](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/models/models.py) (Loan and user records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Applicant and lender experience"]
  node_web_app["Web routes<br/>[App.jsx]"]
  node_auth_pages["Sign in and register<br/>[Login.jsx]"]
  node_apply_form["Application form<br/>[ApplyForm.jsx]"]
  node_sms_features["SMS features<br/>[smsProcessor.js]"]
  node_eligibility_page["Eligibility results"]
  node_emi_page["EMI selection<br/>[EMISelection.jsx]"]
  node_lender_page["Lender selection"]
  node_tracking_page["Application tracking<br/>[MyApplications.jsx]"]
  node_lender_dashboard["Lender dashboard"]
  node_vendor_dashboard["Vendor dashboard"]
  node_client_state["Session and workflow state<br/>[AppContext.jsx]"]
  node_http_client["API client<br/>[axios.js]"]
end

subgraph group_api["API and identity"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_application_routes["Application routes<br/>[applications.py]"]
  node_lender_routes["Lender routes<br/>[lenders.py]"]
  node_auth_service["JWT and password service<br/>[auth_service.py]"]
end

subgraph group_underwriting["Underwriting and matching"]
  node_ai_service["AI analysis<br/>[ai_service.py]"]
  node_emi_service["EMI calculation<br/>[emi_service.py]"]
  node_lender_service["Lender matching<br/>[lender_service.py]"]
end

subgraph group_records["Application records"]
  node_db_session["Database sessions<br/>[database.py]"]
  node_domain_models["Loan and user records<br/>[models.py]"]
end

subgraph group_integrations["External integrations"]
  node_postgres[("PostgreSQL")]
  node_s3_service["File uploads<br/>[s3_service.py]"]
  node_s3[("AWS S3")]
  node_chain_service["Blockchain audit service"]
  node_contract["Loan application contract"]
end

node_applicant(("Applicant"))
node_lender_user(("Lender"))
node_polygon{{"Polygon network"}}

node_applicant -->|"registers or signs in"| node_auth_pages
node_applicant -->|"submits documents"| node_apply_form
node_apply_form -->|"extracts local features"| node_sms_features
node_apply_form -->|"views analysis"| node_eligibility_page
node_eligibility_page -->|"chooses repayment"| node_emi_page
node_emi_page -->|"selects lender"| node_lender_page
node_lender_page -->|"tracks submission"| node_tracking_page
node_lender_user -->|"reviews applications"| node_lender_dashboard
node_applicant -->|"views mobile dashboard"| node_vendor_dashboard
node_web_app -->|"routes to"| node_auth_pages
node_web_app -->|"routes to"| node_apply_form
node_web_app -->|"routes to"| node_eligibility_page
node_web_app -->|"routes to"| node_emi_page
node_web_app -->|"routes to"| node_lender_page
node_web_app -->|"routes to"| node_tracking_page
node_web_app -->|"routes to"| node_lender_dashboard
node_web_app -->|"routes to"| node_vendor_dashboard
node_auth_pages -->|"updates session"| node_client_state
node_client_state -->|"uses API client"| node_http_client
node_http_client -.->|"sends API requests"| node_api_entry
node_api_entry -->|"registers routes"| node_auth_routes
node_api_entry -->|"registers routes"| node_application_routes
node_api_entry -->|"registers routes"| node_lender_routes
node_auth_routes -->|"uses identity helpers"| node_auth_service
node_application_routes -->|"checks user identity"| node_auth_service
node_application_routes -->|"runs analysis"| node_ai_service
node_application_routes -->|"calculates EMI"| node_emi_service
node_application_routes -->|"requests matching"| node_lender_service
node_application_routes -->|"writes audit events"| node_chain_service
node_application_routes -->|"uses upload service"| node_s3_service
node_auth_routes -->|"gets database session"| node_db_session
node_auth_routes -->|"queries users"| node_domain_models
node_application_routes -->|"gets database session"| node_db_session
node_application_routes -->|"reads and writes records"| node_domain_models
node_lender_routes -->|"uses database session"| node_db_session
node_lender_routes -->|"uses lender records"| node_domain_models
node_auth_service -->|"loads user"| node_db_session
node_domain_models -->|"defines ORM base"| node_db_session
node_db_session -->|"connects to"| node_postgres
node_lender_service -->|"uses lender rules"| node_domain_models
node_chain_service -.->|"uses contract interface"| node_contract
node_contract -->|"deployed on"| node_polygon
node_s3_service -.->|"uploads files"| node_s3

click node_web_app "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/App.jsx"
click node_auth_pages "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/Login.jsx"
click node_apply_form "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/ApplyForm.jsx"
click node_sms_features "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/services/smsProcessor.js"
click node_eligibility_page "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/EligibilityResult.jsx"
click node_emi_page "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/EMISelection.jsx"
click node_lender_page "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/LenderSelection.jsx"
click node_tracking_page "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/MyApplications.jsx"
click node_lender_dashboard "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/LenderDashboard.jsx"
click node_vendor_dashboard "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/VendorDashboard.jsx"
click node_client_state "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/context/AppContext.jsx"
click node_http_client "https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/api/axios.js"
click node_api_entry "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/auth.py"
click node_application_routes "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/applications.py"
click node_lender_routes "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/lenders.py"
click node_auth_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/auth_service.py"
click node_ai_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/ai_service.py"
click node_emi_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/emi_service.py"
click node_lender_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/lender_service.py"
click node_db_session "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/database.py"
click node_domain_models "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/models/models.py"
click node_s3_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/s3_service.py"
click node_chain_service "https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/blockchain_service.py"
click node_contract "https://github.com/mahesh2611975/credolocal/blob/main/contracts/contracts/LoanApplicationContract.sol"

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_web_app,node_auth_pages,node_apply_form,node_sms_features,node_eligibility_page,node_emi_page,node_lender_page,node_tracking_page,node_lender_dashboard,node_vendor_dashboard,node_client_state,node_http_client toneBlue
class node_api_entry,node_auth_routes,node_application_routes,node_lender_routes,node_auth_service toneAmber
class node_ai_service,node_emi_service,node_lender_service toneMint
class node_db_session,node_domain_models toneRose
class node_postgres,node_s3_service,node_s3,node_chain_service,node_contract,node_applicant,node_lender_user,node_polygon toneIndigo
```

## Components

### Applicant and lender experience

- [Web routes](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in and register](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Application form](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/ApplyForm.jsx): `frontend/src/pages/ApplyForm.jsx`
- [SMS features](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/services/smsProcessor.js): `frontend/src/services/smsProcessor.js`
- [Eligibility results](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/EligibilityResult.jsx): `frontend/src/pages/EligibilityResult.jsx`
- [EMI selection](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/EMISelection.jsx): `frontend/src/pages/EMISelection.jsx`
- [Lender selection](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/LenderSelection.jsx): `frontend/src/pages/LenderSelection.jsx`
- [Application tracking](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/MyApplications.jsx): `frontend/src/pages/MyApplications.jsx`
- [Lender dashboard](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/LenderDashboard.jsx): `frontend/src/pages/LenderDashboard.jsx`
- [Vendor dashboard](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/pages/VendorDashboard.jsx): `frontend/src/pages/VendorDashboard.jsx`
- [Session and workflow state](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [API client](https://github.com/mahesh2611975/credolocal/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`

### API and identity

- [FastAPI app](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Application routes](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/applications.py): `backend/app/routers/applications.py`
- [Lender routes](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/routers/lenders.py): `backend/app/routers/lenders.py`
- [JWT and password service](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`

### Underwriting and matching

- [AI analysis](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`
- [EMI calculation](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/emi_service.py): `backend/app/services/emi_service.py`
- [Lender matching](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/lender_service.py): `backend/app/services/lender_service.py`

### Application records

- [Database sessions](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/database.py): `backend/app/database.py`
- [Loan and user records](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/models/models.py): `backend/app/models/models.py`

### External integrations

- **PostgreSQL**
- [File uploads](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/s3_service.py): `backend/app/services/s3_service.py`
- **AWS S3**
- [Blockchain audit service](https://github.com/mahesh2611975/credolocal/blob/main/backend/app/services/blockchain_service.py): `backend/app/services/blockchain_service.py`
- [Loan application contract](https://github.com/mahesh2611975/credolocal/blob/main/contracts/contracts/LoanApplicationContract.sol): `contracts/contracts/LoanApplicationContract.sol`

### Other components

- **Applicant**
- **Lender**
- **Polygon network**

## Connections

- Applicant → Sign in and register: registers or signs in (evidence: `README.md`)
- Applicant → Application form: submits documents (evidence: `README.md`)
- Application form → SMS features: extracts local features (evidence: `README.md`)
- Application form → Eligibility results: views analysis (evidence: `README.md`)
- Eligibility results → EMI selection: chooses repayment (evidence: `README.md`)
- EMI selection → Lender selection: selects lender (evidence: `README.md`)
- Lender selection → Application tracking: tracks submission (evidence: `README.md`)
- Lender → Lender dashboard: reviews applications (evidence: `README.md`)
- Applicant → Vendor dashboard: views mobile dashboard (evidence: `README.md`)
- Web routes → Sign in and register: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Application form: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Eligibility results: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → EMI selection: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Lender selection: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Application tracking: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Lender dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Web routes → Vendor dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Sign in and register → Session and workflow state: updates session (evidence: `frontend/src/pages/Login.jsx`)
- Session and workflow state → API client: uses API client (evidence: `frontend/src/context/AppContext.jsx`)
- API client → FastAPI app: sends API requests
- FastAPI app → Authentication routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Application routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI app → Lender routes: registers routes (evidence: `backend/app/main.py`)
- Authentication routes → JWT and password service: uses identity helpers (evidence: `backend/app/routers/auth.py`)
- Application routes → JWT and password service: checks user identity (evidence: `backend/app/routers/applications.py`)
- Application routes → AI analysis: runs analysis (evidence: `backend/app/routers/applications.py`)
- Application routes → EMI calculation: calculates EMI (evidence: `backend/app/routers/applications.py`)
- Application routes → Lender matching: requests matching (evidence: `backend/app/routers/applications.py`)
- Application routes → Blockchain audit service: writes audit events (evidence: `backend/app/routers/applications.py`)
- Application routes → File uploads: uses upload service (evidence: `backend/app/routers/applications.py`)
- Authentication routes → Database sessions: gets database session (evidence: `backend/app/routers/auth.py`)
- Authentication routes → Loan and user records: queries users (evidence: `backend/app/routers/auth.py`)
- Application routes → Database sessions: gets database session (evidence: `backend/app/routers/applications.py`)
- Application routes → Loan and user records: reads and writes records (evidence: `backend/app/routers/applications.py`)
- Lender routes → Database sessions: uses database session (evidence: `backend/app/routers/lenders.py`)
- Lender routes → Loan and user records: uses lender records (evidence: `backend/app/routers/lenders.py`)
- JWT and password service → Database sessions: loads user (evidence: `backend/app/services/auth_service.py`)
- Loan and user records → Database sessions: defines ORM base (evidence: `backend/app/models/models.py`)
- Database sessions → PostgreSQL: connects to (evidence: `README.md`)
- Lender matching → Loan and user records: uses lender rules (evidence: `backend/app/services/lender_service.py`)
- Blockchain audit service → Loan application contract: uses contract interface
- Loan application contract → Polygon network: deployed on (evidence: `README.md`)
- File uploads → AWS S3: uploads files (evidence: `README.md`)
