Amana Capital is an microfinance web application which gives users secure and trusted loans
# MicroFinance Loan Management System
A comprehensive Node.js/Express-based microfinance loan management application with a complete MySQL database backend.
## Features
- **User Management**: Role-based access (Admin/Customer)
- **Customer Management**: Profile management and KYC
- **Loan Applications**: Submit and manage loan applications
- **Loan Management**: Track active loans, EMI schedules
- **Payment Processing**: Record and track loan payments
- **Reports**: Generate business and financial reports
- **Audit Logging**: Complete audit trail of all transactions
## Tech Stack
- **Backend**: Node.js, Express.js 5.x
- **Database**: MySQL 8.0+
- **Templating**: EJS with EJS-Mate for layouts
- **Security**: BCrypt, JWT, Helmet
- **File Upload**: Multer
- **Validation**: Express-Validator
- **Session**: Express-Session
- **Logging**: Morgan
## Project Structure
microfinance/
├── config/ # Configuration files
├── controllers/ # Request handlers
├── database/ # SQL scripts, backups, migrations
├── middleware/ # Express middleware (Security, Logging, RBAC)
├── models/ # Database access layer
├── public/ # Static files (CSS, JS, images)
├── routes/ # API route definitions
├── scripts/ # Dev scripts and utilities
├── services/ # Internal Microservices
├── utils/ # Utility functions (Logger, Validator)
├── views/ # EJS templates
├── app.js # Express app setup
├── ecosystem.config.cjs # PM2 ecosystem file
├── nginx.conf # Production NGINX configuration
├── Dockerfile # Optimized multi-stage Docker build
├── RUNBOOK.md # Operational Runbook
├── server.js # Server startup
└── package.json # Dependencies
```
## Documentation
- **Runbook**: See RUNBOOK.md for operational procedures, backup/restore instructions, and troubleshooting.
## Installation
1. Clone the repository
```bas …