How abhii-2010/sadagati-microfinance-backup works
Sadagati is a microfinance operations application: staff sign in, manage borrowers and loan applications, review and disburse loans, record collections, and monitor accounting and audit information. The React client presents role-oriented workflows and centralizes session and application state; its API client connects to an Express backend whose routes dispatch to domain controllers and services. The backend persists through Prisma, with Redis supporting session operations. The README is only a Vite template, so product capabilities are inferred from the source tree and sampled references; unsampled domain links are omitted or marked unverified.
Main entry points: App.jsx App shell · app.ts Express application · authMiddleware.ts Authorization middleware · authController.ts Authentication
Components 29
Operations Client
- App shell
src/App.jsx - Session and state
src/context/DashboardContext.jsx - API client
src/services/apiClient.js
Lending Operations
- Loan workflows
src/components/views/LoanApplicationsView.jsx - Field operations
src/components/views/FieldVisitsView.jsx - Loan calculations
src/services/loanCalculationService.js - Holiday scheduling
src/services/holidayEngine.js
Administration
- Accounting views
src/components/views/AccountingView.jsx - Admin views
src/components/views/UserManagementView.jsx - Data migration
src/components/views/DataMigrationView.jsx - Accounting controller
backend/src/controllers/accountingController.ts - User controller
backend/src/controllers/userController.ts
API and Security
- Express application
backend/src/app.ts - Authentication routes
backend/src/routes/authRoutes.ts - Authentication
backend/src/controllers/authController.ts - Authorization middleware
backend/src/middleware/authMiddleware.ts - Lending routes
backend/src/routes/loanApplicationRoutes.ts - Payment routes
backend/src/routes/paymentRoutes.ts - Accounting routes
backend/src/routes/accountingRoutes.ts - User routes
backend/src/routes/userRoutes.ts
Persistence and Services
- Accounting service
backend/src/services/accountingService.ts - Payment service
backend/src/services/paymentService.ts - Loan services
backend/src/services/loanApplicationService.ts - Database client
backend/src/config/database.ts - PostgreSQL
- Redis sessions
backend/src/config/redis.ts - Token and password crypto
backend/src/services/cryptoService.ts - Audit service
backend/src/services/auditService.ts
Other components
- Staff user
Connections 36
- Staff user → App shell: uses
- App shell → Session and state: loads state
src/App.jsx - App shell → Loan workflows: renders
src/App.jsx - App shell → Field operations: renders
src/App.jsx - App shell → Accounting views: renders
src/App.jsx - App shell → Admin views: renders
src/App.jsx - App shell → Data migration: renders
src/App.jsx - Session and state → API client: calls
src/context/DashboardContext.jsx - Session and state → Loan calculations: uses
src/context/DashboardContext.jsx - Loan calculations → Holiday scheduling: uses
src/services/loanCalculationService.js - API client → Express application: HTTP requests
- Express application → Authentication routes: mounts
backend/src/app.ts - Express application → Lending routes: mounts
backend/src/app.ts - Express application → Payment routes: mounts
backend/src/app.ts - Express application → Accounting routes: mounts
backend/src/app.ts - Express application → User routes: mounts
backend/src/app.ts - Authentication routes → Authentication: dispatches
backend/src/routes/authRoutes.ts - Authentication routes → Authorization middleware: guards
backend/src/routes/authRoutes.ts - Payment routes → Authorization middleware: guards
backend/src/routes/paymentRoutes.ts - Accounting routes → Authorization middleware: guards
backend/src/routes/accountingRoutes.ts - Accounting routes → Accounting controller: dispatches
backend/src/routes/accountingRoutes.ts - User routes → User controller: dispatches
backend/src/routes/userRoutes.ts - Accounting controller → Accounting service: calls
backend/src/controllers/accountingController.ts - User controller → Database client: queries
backend/src/controllers/userController.ts - User controller → Token and password crypto: hashes passwords
backend/src/controllers/userController.ts - User controller → Audit service: records changes
backend/src/controllers/userController.ts - Authentication → Database client: queries
backend/src/controllers/authController.ts - Authentication → Token and password crypto: verifies credentials
backend/src/controllers/authController.ts - Authentication → Redis sessions: revokes tokens
backend/src/controllers/authController.ts - Authentication → Audit service: records events
backend/src/controllers/authController.ts - Authorization middleware → Token and password crypto: verifies tokens
backend/src/middleware/authMiddleware.ts - Authorization middleware → Redis sessions: checks revocation
backend/src/middleware/authMiddleware.ts - Authorization middleware → Database client: loads user
backend/src/middleware/authMiddleware.ts - Accounting service → Database client: queries
backend/src/services/accountingService.ts - Accounting service → Audit service: records events
backend/src/services/accountingService.ts - Database client → PostgreSQL: connects
backend/src/config/database.ts