Skip to content

web application for registering and supporting migrant workers in Tamil Nadu, India. Built with Flask, SQLite, and modern web technologies.

Notifications You must be signed in to change notification settings

hari7261/MigrateWorker-CRM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tamil Nadu Migrant Worker Registration & Support System

A comprehensive web application for registering and supporting migrant workers in Tamil Nadu, India. Built with Flask, SQLite, and modern web technologies.

Version Python License


๐ŸŒŸ Features Overview

๐Ÿ‘ฅ Worker Features

  • โœ… Easy Registration - Simple form with all required details
  • โœ… Unique Worker ID - Auto-generated format: TN-MIG-YYYY-XXXXXX
  • โœ… Professional ID Card - Downloadable PDF with QR code
  • โœ… Personal Dashboard - View profile, applications, and grievances
  • โœ… Job Search - Browse and apply for verified job openings
  • โœ… Grievance System - Submit and track workplace issues
  • โœ… Multilingual - English, Tamil (เฎคเฎฎเฎฟเฎดเฏ), Hindi (เคนเคฟเค‚เคฆเฅ€)
  • โœ… Mobile Friendly - Responsive design for all devices

๐Ÿ’ผ Job Management

  • โœ… Job Listings - Browse active job opportunities
  • โœ… Detailed Job Info - Company, location, salary, requirements
  • โœ… Easy Application - Apply with optional cover letter
  • โœ… Status Tracking - Pending, Shortlisted, Selected, Rejected
  • โœ… Application History - View all past applications

๐Ÿ“ Grievance Support

  • โœ… Multiple Categories - Workplace, Payment, Health, Legal, etc.
  • โœ… Status Updates - Pending, In Progress, Resolved
  • โœ… Resolution Notes - Admin feedback on grievances
  • โœ… Timeline Tracking - Created and updated timestamps

๐Ÿ” Admin Features

  • โœ… Comprehensive Dashboard - Real-time statistics
  • โœ… Worker Management - Search, view, and manage workers
  • โœ… Grievance Management - Update status and add notes
  • โœ… Job Management - Create, edit, and manage job postings
  • โœ… Application Review - View and update application status
  • โœ… CSV Reports - Download workers and grievances data
  • โœ… User Management - Add admin and staff users
  • โœ… Role-Based Access - Admin vs Staff permissions

๐ŸŽจ UI/UX Features

  • โœ… Modern Design - Clean, professional interface
  • โœ… Orange & White Theme - Consistent branding
  • โœ… Responsive Layout - Works on all screen sizes
  • โœ… Intuitive Navigation - Easy to use for all literacy levels
  • โœ… Professional Landing Page - Hero section, features, benefits
  • โœ… Custom Components - Cards, tables, forms, modals

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)

Installation

  1. Clone or download the project
cd migrant-worker-system
  1. Install dependencies
pip install -r requirements.txt
  1. Initialize database
python setup.py
  1. Populate sample data (optional)
python populate_sample_data.py
  1. Run the application
python app.py
  1. Access the application

๐Ÿ“‹ Default Credentials

Admin Access

  • Username: admin
  • Password: admin123

Sample Workers (if populated)

  • Mobile: 9876543210 to 9876543300
  • Password: Same as mobile number

๐Ÿ“„ See SAMPLE_CREDENTIALS.md for complete list


๐Ÿ—‚๏ธ Project Structure

migrant-worker-system/
โ”œโ”€โ”€ app.py                          # Main Flask application
โ”œโ”€โ”€ setup.py                        # Database setup script
โ”œโ”€โ”€ populate_sample_data.py         # Sample data generator
โ”œโ”€โ”€ init_db.py                      # Database initialization
โ”œโ”€โ”€ requirements.txt                # Python dependencies
โ”œโ”€โ”€ translations.json               # Multilingual translations
โ”œโ”€โ”€ migrant_workers.db             # SQLite database (auto-created)
โ”‚
โ”œโ”€โ”€ static/
โ”‚   โ”œโ”€โ”€ style.css                  # Main stylesheet
โ”‚   โ”œโ”€โ”€ landing.css                # Landing page styles
โ”‚   โ””โ”€โ”€ script.js                  # JavaScript functionality
โ”‚
โ”œโ”€โ”€ templates/
โ”‚   โ”œโ”€โ”€ base.html                  # Base template
โ”‚   โ”œโ”€โ”€ landing.html               # Landing page
โ”‚   โ”œโ”€โ”€ register.html              # Worker registration
โ”‚   โ”œโ”€โ”€ worker_login.html          # Worker login
โ”‚   โ”œโ”€โ”€ worker_dashboard.html      # Worker dashboard
โ”‚   โ”œโ”€โ”€ worker_profile.html        # Worker profile
โ”‚   โ”œโ”€โ”€ grievance_form.html        # Grievance submission
โ”‚   โ”œโ”€โ”€ job_list.html              # Job listings
โ”‚   โ”œโ”€โ”€ job_detail.html            # Job details
โ”‚   โ”œโ”€โ”€ admin_login.html           # Admin login
โ”‚   โ”œโ”€โ”€ admin_dashboard.html       # Admin dashboard
โ”‚   โ”œโ”€โ”€ admin_workers.html         # Worker management
โ”‚   โ”œโ”€โ”€ admin_grievances.html      # Grievance management
โ”‚   โ”œโ”€โ”€ admin_jobs.html            # Job management
โ”‚   โ”œโ”€โ”€ admin_job_create.html      # Create job
โ”‚   โ”œโ”€โ”€ admin_job_applications.html # View applications
โ”‚   โ”œโ”€โ”€ admin_reports.html         # Download reports
โ”‚   โ”œโ”€โ”€ admin_add_user.html        # Add admin user
โ”‚   โ”œโ”€โ”€ 404.html                   # Error page
โ”‚   โ””โ”€โ”€ 500.html                   # Error page
โ”‚
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ README.md                  # This file
    โ”œโ”€โ”€ SAMPLE_CREDENTIALS.md      # Login credentials
    โ”œโ”€โ”€ FEATURES_UPDATE.md         # Feature documentation
    โ””โ”€โ”€ QUICK_START.md             # Quick start guide

๐Ÿ’พ Database Schema

Workers Table

  • Unique worker ID, personal details
  • Contact information
  • Employment details
  • Skills and qualifications
  • Password hash for login
  • Optional Aadhaar number

Grievances Table

  • Worker reference
  • Issue type and description
  • Status tracking
  • Resolution notes
  • Timestamps

Job Openings Table

  • Job details and requirements
  • Company information
  • Salary range
  • Vacancies count
  • Application deadline
  • Status (Active/Closed)

Job Applications Table

  • Worker and job references
  • Application date
  • Cover letter
  • Status tracking
  • Admin notes

Admin Users Table

  • Username and password hash
  • Role (Admin/Staff)

All tables have proper indexes for optimal performance


๐Ÿ”ง Key Technologies

  • Backend: Flask (Python)
  • Database: SQLite with optimized indexes
  • PDF Generation: ReportLab
  • QR Codes: Python qrcode library
  • Authentication: Flask-Login
  • Security: Werkzeug password hashing
  • Frontend: Custom CSS (no Bootstrap)
  • Icons: Bootstrap Icons
  • Responsive: Mobile-first design

๐ŸŒ Multilingual Support

The system supports three languages:

  1. English - Default language
  2. Tamil (เฎคเฎฎเฎฟเฎดเฏ) - Primary regional language
  3. Hindi (เคนเคฟเค‚เคฆเฅ€) - National language

Language preference is saved in cookies and persists across sessions.


๐Ÿ“Š Features in Detail

Worker Registration

  • Comprehensive form with validation
  • Required fields: Name, Age, Gender, Mobile, Origin State, Address, Employer, Skills, Emergency Contact, Password
  • Optional: Aadhaar number
  • Auto-generates unique worker ID
  • Creates secure password hash
  • Prevents duplicate mobile numbers

Professional ID Card PDF

  • Government branding with emblem
  • Worker photo placeholder with initial
  • All worker details in organized format
  • QR code for profile verification
  • Security features and watermark
  • Registration date and issuing authority
  • Professional layout with color coding
  • Downloadable as PDF

Job Application System

  • Browse active job openings
  • Filter by location, type, company
  • View detailed job descriptions
  • Submit applications with cover letter
  • Track application status
  • Receive admin feedback
  • View application history

Grievance Management

  • Six issue categories:
    • Workplace Issues
    • Payment Disputes
    • Health Issues
    • Missing/Stolen Documents
    • Abuse/Harassment
    • Legal Aid Requests
  • Status tracking (Pending โ†’ In Progress โ†’ Resolved)
  • Admin can add resolution notes
  • Timeline tracking with timestamps

Admin Dashboard

  • Real-time statistics:
    • Total workers
    • Total grievances
    • Pending grievances
    • Today's registrations
    • Total jobs
    • Active jobs
    • Total applications
    • Pending applications
  • Recent activities feed
  • Quick action buttons
  • Responsive charts and cards

๐Ÿ”’ Security Features

  • โœ… Password hashing (Werkzeug)
  • โœ… Session-based authentication
  • โœ… Role-based access control
  • โœ… SQL injection prevention (parameterized queries)
  • โœ… CSRF protection
  • โœ… Secure cookie handling
  • โœ… Input validation
  • โœ… XSS prevention

๐Ÿ“ฑ Mobile Responsiveness

  • Optimized for all screen sizes
  • Touch-friendly buttons and forms
  • Readable text on small screens
  • Collapsible navigation
  • Responsive tables
  • Mobile-first design approach

๐ŸŽฏ Use Cases

  1. Worker Registration - Migrant workers register and get official ID
  2. Job Matching - Workers find suitable employment opportunities
  3. Issue Resolution - Workers report and track workplace problems
  4. Government Tracking - Officials monitor migrant worker welfare
  5. Employer Verification - Verify worker credentials via QR code
  6. Data Analytics - Generate reports for policy decisions

๐Ÿ› ๏ธ Maintenance & Updates

Database Backup

# Backup database
copy migrant_workers.db migrant_workers_backup.db

Reset Database

# Delete and reinitialize
del migrant_workers.db
python setup.py
python populate_sample_data.py

Check Database Status

python check_workers.py

Add Indexes (if needed)

python add_indexes.py

๐Ÿ“ˆ Performance Optimization

  • Database indexes on all frequently queried columns
  • Composite indexes for complex queries
  • Efficient JOIN operations
  • Minimal database calls per page
  • Optimized PDF generation
  • Cached translations
  • Lightweight CSS (no Bootstrap)

๐Ÿ› Troubleshooting

Common Issues

Database Errors:

del migrant_workers.db
python setup.py

Port Already in Use: Edit app.py and change port:

app.run(debug=True, host='0.0.0.0', port=5001)

Missing Dependencies:

pip install --upgrade -r requirements.txt

Translation Not Working:

  • Clear browser cookies
  • Check translations.json file
  • Verify language selector in navbar

๐Ÿš€ Production Deployment

For production use:

  1. โœ… Change SECRET_KEY in app.py
  2. โœ… Set debug=False
  3. โœ… Use production WSGI server (Gunicorn/uWSGI)
  4. โœ… Set up HTTPS with SSL certificate
  5. โœ… Use PostgreSQL/MySQL instead of SQLite
  6. โœ… Enable proper logging
  7. โœ… Set up regular database backups
  8. โœ… Configure firewall rules
  9. โœ… Use environment variables for secrets
  10. โœ… Set up monitoring and alerts

๐Ÿ“ž Support & Contact

  • Government Department: Tamil Nadu Labour Department
  • Location: Chennai, Tamil Nadu
  • Purpose: Migrant Worker Welfare

๐Ÿ“„ License

This project is developed for the Tamil Nadu Government's migrant worker support initiative.


๐Ÿ™ Acknowledgments

  • Tamil Nadu Government
  • Labour Department
  • All migrant workers
  • Development team

๐Ÿ“ Changelog

Version 1.0.0 (2025-01-15)

  • โœ… Initial release
  • โœ… Worker registration and login
  • โœ… Professional ID card generation
  • โœ… Job management system
  • โœ… Grievance tracking
  • โœ… Admin dashboard
  • โœ… Multilingual support
  • โœ… Mobile responsive design
  • โœ… Database optimization
  • โœ… Sample data population

Made with โค๏ธ for Tamil Nadu Migrant Workers

Version: 1.0.0
Last Updated: January 15, 2025
Status: Production Ready โœ…

About

web application for registering and supporting migrant workers in Tamil Nadu, India. Built with Flask, SQLite, and modern web technologies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published