A comprehensive Django-based web application for managing employee data with advanced filtering capabilities and Excel export functionality. Built specifically for organizations that need efficient employee data management with geographic-aware filtering for Nepal.
- Employee Management: Complete CRUD operations for employee records with clickable navigation
- Department Management: Add, view, update, and delete departments
- Advanced Filtering: Multi-criteria filtering with real-time results
- Excel Export: Export filtered data to Excel (.xlsx) format with integrated table header controls
- Geographic Intelligence: Nepal province-district mapping with smart filtering
- Real-time Search: Live search by employee name and address
- Responsive Design: Mobile-first approach with adaptive layouts
- Department Filtering: Filter employees by their departments
- Geographic Filtering:
- Province-based filtering (7 provinces of Nepal)
- District-based filtering with province auto-selection
- Smart province-district relationship mapping
- Salary Filtering:
- Exact amount matching
- Greater than / Less than comparisons
- Range-based filtering (between two amounts)
- Date Filtering:
- Creation date filtering (exact, before, after, between)
- Last updated date filtering (exact, before, after, between)
- Dual Filter Modes: Simple search and Advanced multi-criteria filtering with collapsible options
- AJAX-powered Interface: No page refresh required for filtering
- Modular Architecture: Clean separation of HTML, CSS, and JavaScript
- Responsive Design: Mobile-friendly interface with CSS Grid and Flexbox
- Real-time Updates: Dynamic table updates without reload
- Form Validation: Client and server-side validation
- Message System: Success/error notifications
- Humanized Dates: User-friendly date formatting
- Class-based JavaScript: Object-oriented code organization
- Interactive Navigation: Clickable employee IDs and names for direct access to detail pages
- Backend: Django 3.2.5
- Database: SQLite (development)
- Frontend: HTML5, CSS3 (modular architecture), JavaScript ES6+ Classes
- JavaScript Libraries: jQuery, XLSX.js for Excel export
- Styling: Modular CSS with component-based architecture
- Date Handling: Django Humanize for natural time formatting
- Responsive Framework: Custom CSS Grid and Flexbox implementation
- Python 3.8 or higher
- pip (Python package manager)
- Virtual environment (recommended)
- Modern web browser with ES6+ support
git clone <repository-url>
cd EmployeeExcelManagerpython -m venv env# Windows
env\Scripts\activate
# macOS/Linux
source env/bin/activatepip install -r requirements.txtpython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverVisit http://127.0.0.1:8000/ to access the application.
tabletoexcel/
βββ tabletoexcel/ # Main project directory
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ wsgi.py # WSGI configuration
βββ home/ # Main application
β βββ models.py # Database models (Employee, Department)
β βββ views.py # View functions and classes
β βββ forms.py # Django forms
β βββ urls.py # App URL patterns
β βββ admin.py # Admin configuration
βββ templates/ # HTML templates
β βββ base.html # Base template with modular CSS/JS loading
β βββ home/ # App-specific templates
β βββ index.html # Homepage
β βββ employeetable.html # Advanced employee table
β βββ addemployee.html # Employee creation form
β βββ updateemployee.html# Employee update form
β βββ employeedetail.html# Employee detail view
β βββ adddepartment.html # Department creation
β βββ updatedepartment.html# Department update
β βββ departmentdetail.html# Department detail view
βββ static/ # Static files (modular architecture)
β βββ css/ # Modular CSS files
β β βββ base.css # Foundation styles and typography
β β βββ styles.css # Shared component library
β β βββ index.css # Homepage specific styles
β β βββ employeetable.css # Table and filtering styles
β β βββ addemployee.css # Employee form styles
β β βββ updateemployee.css # Employee update styles
β β βββ employeedetail.css # Detail page styles
β β βββ adddepartment.css # Department form styles
β β βββ updatedepartment.css# Department update styles
β β βββ departmentdetail.css# Department detail styles
β βββ js/ # Modular JavaScript files
β β βββ employee-table.js # Table management and filtering
β β βββ province-district.js# Geographic relationship handler
β β βββ employee-search.js # Search functionality
β β βββ xlsxfile.js # Excel export library
β βββ img/ # Images and assets
β βββ logo.png # Application logo
βββ requirements.txt # Python dependencies
βββ manage.py # Django management script
- name: CharField (Employee full name)
- department: ForeignKey (Link to Department)
- salary: IntegerField (Employee salary)
- province: CharField (Nepal province selection)
- district: CharField (Nepal district selection)
- address: TextField (Detailed address)
- zip_code: IntegerField (Postal code)
- date_created: DateTimeField (Auto-generated)
- date_updated: DateTimeField (Auto-updated)- title: CharField (Department name)
- date_created: DateTimeField (Auto-generated)
- date_updated: DateTimeField (Auto-updated)- base.css: Foundation styles, typography, global elements
- styles.css: Shared component library (buttons, forms, cards, navigation)
- Page-specific CSS: Individual files for each template's unique styling
- Responsive Design: Mobile-first approach with breakpoints at 480px, 768px, 992px
- Theme Consistency: Each page has its own color theme while maintaining cohesive design
- EmployeeTableManager: Comprehensive table operations, filtering, and Excel export
- ProvinceDistrictHandler: Geographic relationship management with backward compatibility
- EmployeeSearchHandler: Live search functionality for employee lists
- Modular Loading: Each template loads only required JavaScript modules
- CSS Grid Layouts: Advanced responsive grids that adapt to screen size
- Flexible Components: Cards, forms, and tables that scale appropriately
- Touch-friendly: Enhanced button sizes and interaction areas for mobile
- Progressive Enhancement: Works without JavaScript, enhanced with it
- Navigate to "Add Employee" page
- Fill in employee details including department, salary, and location
- Province-district selection is geographically aware with dynamic population
- Submit to save the employee record
- Go to "Add Department" to create new departments
- View all departments in the department list
- Edit or delete departments as needed
- Department deletion checks for associated employees
- Simple Filter: Use the search box to find employees by name or address
- Advanced Filter:
- Toggle between Simple and Advanced modes
- Select multiple criteria (department, location, salary, dates)
- Multiple criteria work with AND logic - results must match ALL selected filters
- Use "More Filters" to access collapsible date and salary range options
- Click "Filter" to apply criteria
- Use "Get Initial Data" to reset filters
- Combined Filtering Examples:
- Department: "IT" + Province: "Province No.1" = Shows only IT employees in Province No.1
- Salary: "> 50,000" + Department: "HR" = Shows only HR employees earning more than 50,000
- Multiple filters narrow down results progressively
- Apply desired filters to narrow down data
- Click "Export to Excel" button in the table header
- Confirm export in the popup dialog
- Excel file (.xlsx) will be downloaded automatically with filtered data
- Clickable Employee Data: Click on employee ID or name to view detailed information
- Breadcrumb Navigation: Clear page hierarchy with clickable breadcrumbs
- Quick Actions: Integrated table header with Add Employee, Manage Departments buttons
- Responsive Menus: Mobile-friendly navigation that adapts to screen size
The system includes comprehensive Nepal geographic data:
- 7 Provinces: Province No.1 through Province No.7
- 77 Districts: Complete district mapping for all provinces
- Smart Filtering: Selecting a district automatically filters relevant provinces
- Geographic Validation: Province-district relationships are maintained
- Dynamic Dropdowns: Real-time population of district options based on province selection
- Province No.1: 14 districts (Bhojpur, Dhankuta, Ilam, Jhapa, Khotang, Morang, Okhaldhunga, Panchthar, Sankhuwasabha, Solukhumbu, Sunsari, Taplejung, Terhathum, Udayapur)
- Province No.2: 8 districts (Bara, Dhanusha, Mathottari, Parsa, Rautahat, Saptari, Sarlahi, Siraha)
- Province No.3: 13 districts (Bhaktapur, Chitwan, Dhading, Dolakha, Kathmandu, Kavrepalanchok, Lalitpur, Makwanpur, Nuwakot, Rasuwa, Ramechhap, Sindhupalchok, Sindhuli)
- Province No.4: 11 districts (Baglung, Gorkha, Kaski, Lamjung, Manang, Mustang, Myagdi, Nawalpur, Parbat, Syangia, Tanahun)
- Province No.5: 12 districts (Arghakhanchi, Banke, Bardiya, Dang, Eastern Rukum, Gulmi, Kapilvastu, Palpa, Parasi, Pyuthan, Rolpa, Rupandehi)
- Province No.6: 10 districts (Dailekh, Dolpa, Humla, Jajarkot, Jumla, Kalikot, Mugu, Salyan, Surkhet, Western Rukum)
- Province No.7: 9 districts (Achham, Baitadi, Bajhang, Bajura, Dadeldhura, Darchula, Doti, Kailali, Kanchanpur)
- Department + Province: IT Department AND Province No.1 = Only IT employees in Province No.1
- Salary + Location: Salary > 50,000 AND Kathmandu District = High earners in Kathmandu only
- Date + Department + Salary: Created after 2023-01-01 AND HR Department AND Salary between 30,000-60,000
- All filters work together to progressively narrow down results
- Exact: Find employees with exactly Rs. 50,000 salary
- More Than: Find employees earning more than Rs. 40,000
- Less Than: Find employees earning less than Rs. 60,000
- Between: Find employees earning between Rs. 30,000 and Rs. 70,000
- Exact: Employees added on a specific date
- Before: Employees added before a certain date
- After: Employees added after a certain date
- Between: Employees added within a date range
- Toggle Filters: Switch between Simple and Advanced filtering modes with smooth animations
- Expandable Options: "More Filters" button reveals additional criteria with slide transitions
- Real-time Updates: Table updates instantly without page refresh
- Responsive Table: Hover effects, clickable elements, and mobile-friendly design
- Loading Animations: Smooth transitions and user feedback
- Message Notifications: Success/error messages with auto-hide functionality
- Color Themes: Each page has distinct color themes (green for tables, blue for details, orange for updates)
- Typography: Dosis font family with optimized loading and fallbacks
- Spacing System: Consistent padding, margins, and gap values throughout
- Component Library: Reusable buttons, cards, forms, and navigation elements
- Accessibility: Focus states, keyboard navigation, and screen reader support
- Mobile: < 480px (single column layouts, stacked elements)
- Tablet: 481px - 768px (two-column grids, adapted navigation)
- Desktop: 769px - 992px (three-column grids, full feature set)
- Large: > 992px (optimal spacing, maximum feature density)
- CSRF protection for all forms
- Input validation and sanitization
- Secure database queries with Django ORM
- Error handling for edge cases
- XSS prevention with proper template escaping
- Environment Variables: Set production environment variables
- Database: Configure PostgreSQL or MySQL for production
- Static Files: Set up static file serving (nginx/Apache) with proper caching headers
- Security: Update
ALLOWED_HOSTS, disableDEBUG - HTTPS: Configure SSL certificate
- CSS/JS Minification: Implement asset compression for production
# settings.py updates for production
DEBUG = False
ALLOWED_HOSTS = ['your-domain.com']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
# ... other database settings
}
}
# Static files configuration
STATIC_ROOT = '/path/to/static/files/'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Follow the modular CSS/JS architecture patterns
- Ensure responsive design compatibility
- Test across multiple browsers and devices
- Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
GET /- Home page with feature overviewGET /employee-table/- Main employee table with advanced filteringPOST /post-filter/- AJAX endpoint for advanced filteringPOST /get-initial-data/- AJAX endpoint to reset filtersGET /add-employee/- Add new employee formGET /add-department/- Add new department formGET /employee/<int:pk>/- Employee detail view with navigationPOST /delete-employee/<int:pk>/- Delete employeeGET /update-employee/<int:pk>/- Update employee form with province-district handlingGET /department/<int:pk>/- Department detail viewGET /update-department/<int:pk>/- Update department formPOST /delete-department/<int:pk>/- Delete department
This project is open source. Feel free to use and modify according to your needs.
-
v2.0: Major refactoring with modular architecture
- Extracted all inline CSS to modular external files
- Implemented class-based JavaScript modules
- Added responsive design system with CSS Grid/Flexbox
- Enhanced user experience with clickable navigation
- Improved performance with caching-friendly static files
- Better maintainability and code organization
-
v1.0: Initial release with complete employee management system
- Employee and department CRUD operations
- Advanced filtering with geographic data
- Excel export functionality
- Real-time AJAX updates
- Nepal-specific province-district mapping
Built with β€οΈ for efficient employee data management
Streamline your HR processes with powerful filtering, modern responsive design, and comprehensive export capabilities