A comprehensive Django-based Non-Banking Financial Company (NBFC) management system that handles employee management, loan processing, attendance tracking, salary management, and more.
The fastest way to deploy on a new VM:
Use the automated deployment script that handles everything for you:
./deploy.sh <NEW_IP_ADDRESS>Example:
./deploy.sh 40.90.224.166- β Backs up existing configuration
- β
Creates new
.envfrom template - β Updates HOST_IP automatically
- β Stops old containers
- β Builds and starts new containers
- β Waits for services to initialize
- β Provides access URLs and next steps
- Automatic Backup: Creates timestamped backup of existing
.env - Zero Configuration: Just provide the IP address
- Health Checks: Verifies deployment success
- User Guidance: Shows next steps and access URLs
- Error Handling: Graceful failure with helpful logs
For manual deployments, you only need to update ONE value:
- Copy
.env.exampleto.env - Update the
HOST_IPvalue in.env:HOST_IP=YOUR_NEW_VM_IP_HERE
- Everything else (Django settings, Docker, nginx, API endpoints) automatically syncs!
-
Employee Management
- Employee profiles and details
- Organization-based employee segregation
- Bulk employee creation
- Employee statistics and analytics
-
Loan Management
- Loan application and processing
- Multiple loan types support
- Interest rate management
- Loan status tracking
- Bulk loan creation
- Loan statistics and analytics
-
Attendance System
- Daily attendance tracking
- Multiple attendance statuses (present, absent, late, half-day, leave)
- Attendance verification
- Attendance statistics
-
Salary Management
- Salary calculation and processing
- Basic salary, allowances, and deductions
- Salary approval workflow
- Salary statistics and analytics
- Organization-based multi-tenancy
- Role-based access control
- Document management
- Transaction logging
- Dashboard analytics
- Bulk data upload capabilities
- API-first architecture
- Backend: Django & Django REST Framework
- Database: SQLite (Development) / PostgreSQL (Production)
- Authentication: JWT-based authentication
- API Documentation: Swagger/OpenAPI
- Frontend: (To be implemented)
nbfc-django/
βββ nbfc_accounts/ # Account management
βββ nbfc_attendance/ # Attendance tracking
βββ nbfc_auth/ # Authentication and authorization
βββ nbfc_bulk_upload/ # Bulk data upload functionality
βββ nbfc_dashboard/ # Dashboard and analytics
βββ nbfc_documents/ # Document management
βββ nbfc_employees/ # Employee management
βββ nbfc_loan_deficit/ # Loan deficit tracking
βββ nbfc_loans/ # Loan management
βββ nbfc_organizations/ # Organization management
βββ nbfc_repayments/ # Loan repayment tracking
βββ nbfc_salaries/ # Salary management
βββ nbfc_settings/ # System settings
βββ nbfc_transaction_logs/# Transaction logging
βββ nbfc_django/ # Core project settings
For new VM deployment using the deployment script:
- Clone the repository:
git clone <repository-url>
cd nbfc-django- Make script executable:
chmod +x deploy.sh- Deploy with one command:
./deploy.sh YOUR_VM_IP_ADDRESS- Create superuser (after deployment):
docker compose exec web python manage.py createsuperuser- Test the deployment:
curl http://YOUR_VM_IP:8000/api/- Clone and configure:
git clone <repository-url>
cd nbfc-django
cp .env.example .env- Update ONLY the IP address in
.env:
# Edit .env file
HOST_IP=40.90.224.166 # Replace with your VM IP- Deploy with Docker:
docker-compose up -dThat's it! Everything else automatically syncs from the HOST_IP value.
- Clone the repository:
git clone <repository-url>
cd nbfc-django- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtNote: If you plan to use PostgreSQL, install the PostgreSQL adapter:
pip install psycopg2-binaryFor development, SQLite is used by default and requires no additional setup.
- Configure environment variables:
cp .env.example .env
# Edit .env with HOST_IP=127.0.0.1 for local development- Run migrations:
python manage.py migrate- Create superuser:
python manage.py createsuperuser- Run development server:
python manage.py runserver- Single Point Configuration: Update only
HOST_IPin.env - Auto-generated Settings: Django settings automatically adapt
- Flexible nginx: Works with any IP or domain
- Docker Integration: Compose file uses environment variables
- API Compatibility: All endpoints work with any host configuration
- Deployment Script: One-command deployment with automatic configuration
# Deploy to new IP
./deploy.sh 40.90.224.166
# Check deployment status
docker compose ps
# View logs
docker compose logs
# Create superuser
docker compose exec web python manage.py createsuperuser# Stop services
docker compose down
# Build and start
docker compose up -d --build
# View logs
docker compose logs -f
# Access container shell
docker compose exec web bashThe API documentation is available at /api/docs/ when running the development server. The project includes a Postman collection (nbfc_api_collection.json) for API testing.
-
Code Style
- Follow PEP 8 guidelines
- Use meaningful variable and function names
- Add docstrings for functions and classes
-
Git Workflow
- Create feature branches for new features
- Write meaningful commit messages
- Keep commits atomic and focused
-
Testing
- Write unit tests for new features
- Run tests before committing changes
- Maintain test coverage
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request