A modern React-based frontend for the Loan Management and Debt Collection System. This application provides a comprehensive dashboard for managing loans, tracking customer information, and facilitating debt collection activities.
- Modern Dashboard - Clean, responsive interface with real-time data
- Loan Management - View, search, filter, and manage loans effectively
- Customer Information - Comprehensive customer profiles and contact management
- Advanced Search - Multi-field search with filters and quick actions
- Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
- Authentication - Secure JWT-based authentication system
- Offline Support - Basic functionality available when offline
- Export Capabilities - Export loan data to CSV for external processing
- Real-time Updates - Live updates for loan status changes
- React 18 - Modern React with hooks and functional components
- Tailwind CSS - Utility-first CSS framework for styling
- Lucide React - Beautiful, customizable icons
- Axios - HTTP client for API communication
- React Scripts - Build tools and development server
Before running this application, make sure you have:
- Node.js (version 16 or higher)
- npm or yarn package manager
- Backend API running (see backend documentation)
# Clone the repository
git clone <repository-url>
cd frontend
# Install dependencies
npm install
# Or using yarn
yarn installCreate a .env file in the root directory:
# API Configuration
REACT_APP_API_URL=http://localhost:5000/api
# Application Configuration
REACT_APP_ENV=development
REACT_APP_NAME=Loan Management System
REACT_APP_VERSION=1.0.0
# Feature Flags (optional)
REACT_APP_ENABLE_DARK_MODE=false
REACT_APP_ENABLE_NOTIFICATIONS=true
REACT_APP_ENABLE_EXPORT=true
REACT_APP_ENABLE_BULK_OPS=true# Start the development server
npm start
# Or using yarn
yarn startThe application will open at http://localhost:3000
For development and testing:
- Username:
admin - Password:
admin123
frontend/
βββ public/ # Static files
β βββ index.html # HTML template
β βββ manifest.json # PWA manifest
β βββ favicon.ico # Application icon
βββ src/
β βββ components/ # React components
β β βββ LoginForm.js # Authentication component
β β βββ DashboardHeader.js # Header navigation
β β βββ StatsCards.js # Dashboard statistics
β β βββ SearchAndFilters.js # Search functionality
β β βββ LoansTable.js # Loan data table
β β βββ LoanDetailsModal.js # Detailed loan view
β βββ services/ # API services
β β βββ apiService.js # HTTP client and API calls
β βββ utils/ # Utility functions
β β βββ formatters.js # Data formatting utilities
β β βββ constants.js # Application constants
β βββ App.js # Main application component
β βββ index.js # Application entry point
βββ .env # Environment variables
βββ .gitignore # Git ignore rules
βββ package.json # Dependencies and scripts
βββ README.md # This file
- Main application wrapper
- Handles authentication state
- Manages global data and error handling
- Coordinates between all child components
- User authentication interface
- Input validation and error handling
- Responsive design for all devices
- Navigation and user information
- Logout functionality
- Mobile-responsive menu
- Dashboard statistics display
- Loan metrics and KPIs
- Performance indicators
- Advanced search functionality
- Multi-field filtering
- Quick filter presets
- Export capabilities
- Sortable data table
- Loan listing with pagination
- Bulk selection and actions
- Priority indicators
- Detailed loan information
- Customer contact integration
- Status update functionality
- Activity notes and history
- Centralized API communication
- Authentication token management
- Error handling and retry logic
- Request/response interceptors
- Currency formatting (Nigerian Naira)
- Date and time formatting
- Phone number formatting
- Data validation helpers
- Application configuration
- API endpoints
- Status codes and labels
- Feature flags
# Development
npm start # Start development server
npm test # Run test suite
npm run build # Build for production
npm run eject # Eject from Create React App
# Linting and Formatting
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint errors
npm run format # Format code with Prettier# Create production build
npm run build
# The build folder contains the production-ready files- Connect your GitHub repository to Netlify
- Set build command:
npm run build - Set publish directory:
build - Add environment variables in Netlify dashboard
- Deploy automatically on git push
- Install Vercel CLI:
npm i -g vercel - Run
vercelin project directory - Follow the setup prompts
- Set environment variables in Vercel dashboard
- Run
npm run build - Upload
buildfolder contents to your web server - Configure server to serve
index.htmlfor all routes (SPA)
REACT_APP_API_URL=https://your-backend-app.onrender.com/api
REACT_APP_ENV=production- Open the application in your browser
- Enter your username and password
- Click "Sign In" or press Enter
- Use "Demo Credentials" button for quick access during development
- Statistics Cards - View loan metrics and collection performance
- Search Bar - Find loans by customer name, phone, ID, or loan details
- Filters - Filter by status, type, date range
- Quick Filters - Pre-configured filter presets
- View Loans - Click the eye icon to see detailed information
- Contact Customers - Use phone or email buttons for direct contact
- Update Status - Mark loans as closed when payments are received
- Add Notes - Track follow-up activities and customer interactions
- Bulk Operations - Select multiple loans for batch updates
- Export Data - Download loan information as CSV
- Offline Access - Basic functionality available without internet
- Mobile Support - Full functionality on mobile devices
- JWT Authentication - Secure token-based authentication
- Input Validation - Client-side validation for all forms
- CORS Protection - Configured for secure API communication
- XSS Prevention - React's built-in XSS protection
- Secure Storage - Sensitive data stored securely in localStorage
- Code Splitting - Automatic code splitting with React.lazy()
- Lazy Loading - Components loaded on demand
- Memoization - React.memo for expensive components
- Debounced Search - Optimized search performance
- Efficient Rendering - Optimized re-renders with proper key props
The application uses Tailwind CSS for styling:
- Utility Classes - Comprehensive utility-first CSS
- Responsive Design - Mobile-first responsive utilities
- Dark Mode Ready - Dark mode support (when enabled)
- Custom Components - Consistent design system
To customize the appearance:
- Modify Tailwind classes in components
- Add custom CSS in
src/index.css - Update color scheme in
tailwind.config.js
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Generate coverage report
npm test -- --coverage- Verify backend server is running
- Check API URL in environment variables
- Ensure CORS is configured correctly
- Clear browser localStorage
- Check JWT token expiration
- Verify credentials with backend
- Delete
node_modulesand reinstall - Clear npm cache:
npm cache clean --force - Check Node.js version compatibility
Enable debug mode by adding to .env:
REACT_APP_DEBUG=true// Login
POST /api/auth/login
{
"username": "admin",
"password": "admin123"
}
// Response
{
"token": "jwt_token_here",
"user": {
"id": "user_id",
"username": "admin",
"role": "admin"
}
}// Get loans with filters
GET /api/loans?search=term&status=open&type=Business
// Get loan details
GET /api/loans/:id
// Update loan status
PUT /api/loans/:id/status
{
"status": "closed"
}- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make changes and commit:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
- Use ESLint configuration
- Follow React best practices
- Write meaningful commit messages
- Add comments for complex logic
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Email: support@yourcompany.com
- Documentation: [Link to documentation]
- Issues: [GitHub Issues]
- Real-time notifications
- Advanced reporting dashboard
- Mobile app (React Native)
- Multi-language support
- Advanced user permissions
- Integration with SMS services
- Payment gateway integration
- Document management
- Advanced analytics
- API webhooks
Built with β€οΈ using React and modern web technologies