A complete web-based ERP/CRM for managing the end-to-end lifecycle of candidates in a manpower recruitment agency.
mlams/
āāā backend/
ā āāā server.py # Python backend ā JWT auth, SQLite DB, all APIs
āāā frontend/
ā āāā index.html # Main single-page app
ā āāā css/style.css # Full design system (dark industrial theme)
ā āāā js/
ā āāā core.js # API client, auth, routing, utilities
ā āāā pages.js # Dashboard, Leads, Lead Detail
ā āāā pages2.js # Counseling, Accounts, Cheques, Users, Reports
āāā start.sh # Start the backend server
āāā stop.sh # Stop the backend server
āāā README.md
- Python 3.8+ (with
jwtandflaskavailable ā uses stdlib only otherwise) - A modern web browser
chmod +x start.sh stop.sh bash start.sh
Open frontend/index.html directly in your browser:
file:///path/to/mlams/frontend/index.html
Or if on macOS:
open frontend/index.html
On first run, an initial Admin account is created from your .env file (ADMIN_EMAIL / ADMIN_PASSWORD).
If you did not provide a .env file, the default login is:
- Email:
[email protected] - Password:
admin123
(Note: Other roles like Tele-Caller, Counselor, and Accountant can be created by the Admin from the UI)
- Admin logs in and creates a new lead (
+ New Lead) - Admin assigns lead to a Tele-Caller
- Tele-Caller sees only their assigned leads
- Caller updates status:
Busy,Call Back,Interested,Not Interested - When marked Interested ā lead automatically moves to Counseling queue
- Counselor sees all leads in the Counseling Queue
- Logs sitting sessions:
Sitting 1 Completed,Documents Pending, etc. - When satisfied ā clicks Complete Counseling
- Lead automatically moves to Accounts stage
- Accountant sees the Accounts queue
- Records payment: amount, mode (Cash/Cheque/UPI etc.), date
- On payment ā candidate marked Completed
- Accountant records cheque details (number, bank, amount)
- Updates cheque status:
Pending ā Issued ā ClearedorBounced - Full cheque register available in Cheque Management page
| Feature | Admin | Tele-Caller | Counselor | Accountant |
|---|---|---|---|---|
| Create Leads | ā | |||
| View All Leads | ā | |||
| View Assigned Leads | ā | ā | ||
| Update Call Status | ā | ā | ||
| View Counseling Queue | ā | ā | ||
| Log Counseling Sessions | ā | ā | ||
| Complete Counseling | ā | ā | ||
| View Accounts Queue | ā | ā | ||
| Record Payments | ā | ā | ||
| Manage Cheques | ā | ā | ||
| User Management | ā | |||
| Reports & Analytics | ā |
The SQLite database (backend/mlams.db) contains:
- users ā System users with role-based access
- leads ā Candidate leads with stage/status tracking
- status_logs ā Full audit trail of every status change (who, when, what)
- counseling_sessions ā Session-by-session counseling records
- payments ā Payment transactions linked to candidates
- cheques ā Cheque records with lifecycle status
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Login, returns JWT token |
| GET | /api/auth/me | Get current user |
| GET | /api/leads | List leads (role-filtered) |
| POST | /api/leads | Create lead (Admin only) |
| GET | /api/leads/:id | Get lead details |
| PUT | /api/leads/:id/status | Update lead status |
| PUT | /api/leads/:id/assign | Reassign lead (Admin) |
| GET | /api/leads/:id/sessions | Get counseling sessions |
| POST | /api/leads/:id/sessions | Add counseling session |
| PUT | /api/leads/:id/complete-counseling | Move to accounts |
| GET | /api/leads/:id/payments | Get payments |
| POST | /api/leads/:id/payments | Record payment |
| GET | /api/leads/:id/cheques | Get cheques |
| POST | /api/leads/:id/cheques | Add cheque |
| PUT | /api/cheques/:id | Update cheque status |
| GET | /api/leads/:id/logs | Get audit log |
| GET | /api/dashboard | Role-specific dashboard stats |
| GET | /api/users | List users (Admin/Counselor) |
| POST | /api/users | Create user (Admin only) |
Copy .env.example to .env before running the system to configure:
PORT(default: 5050)HOST(default: 0.0.0.0)JWT_SECRET(auto-generated if not set)ADMIN_EMAILADMIN_PASSWORDADMIN_NAME
- JWT tokens expire after 24 hours
- Passwords are securely hashed with a random salt using Python's built-in
pbkdf2_hmac - Every API endpoint enforces role-based access
- All status transitions are logged with user ID + timestamp
- Email/SMS notifications on stage transitions
- Document upload (passport, visa docs) per candidate
- Multi-branch support
- Export to PDF/Excel
- Mobile responsive improvements
- Real-time updates via WebSocket