GearGuard is a comprehensive web-based maintenance and equipment management system built using Django 5.2 and PostgreSQL. It helps organizations efficiently track equipment, manage maintenance requests, assign teams, and monitor maintenance status through sophisticated role-based access control.
This project is designed to be scalable, secure, and production-ready, making it suitable for enterprise use cases such as factories, workshops, IT infrastructure, and industrial facilities.
- Four-tier role-based access control:
- Admin: Full system access, user management, team management, equipment management, reports
- Manager: Dashboard access, maintenance request management, preventive maintenance scheduling, team oversight, technician reports
- Technician: Task assignment, work tracking, time logging, completion reports
- User: Create maintenance requests, view own requests, equipment status
- User profile management with roles and avatars
- User registration system with admin approval workflow
- Active/inactive user status handling
- Comprehensive equipment tracking with:
- Equipment details (name, serial number, category, department)
- Location and specifications
- Purchase date and warranty expiry tracking
- Preventive maintenance interval configuration
- Equipment-to-team assignment
- Default technician assignment
- Scrap status and reason tracking
- Equipment filtering and search capabilities
- Equipment history and maintenance tracking
- Two request types:
- Corrective: Breakdown/repair requests
- Preventive: Scheduled maintenance tasks
- Request lifecycle tracking:
- New → In Progress → Repaired/Scrap
- Priority-based handling (Low, Medium, High, Critical)
- Request assignment to teams and technicians
- Time tracking (estimated and actual duration)
- Technician notes and resolution summaries
- Overdue request detection
- Scheduled date and due date management
- Create and manage maintenance teams
- Assign technicians to multiple teams
- Team-based request routing
- Team performance tracking
- Active/inactive team status
- Admin dashboard with system-wide statistics
- Manager dashboard with team performance metrics
- Technician reports with completed task history
- Equipment reports by category and team
- Request analytics by status and type
- Manager hours tracking
- Custom 404 error page
- Odoo-inspired modern interface design
- Responsive design for all devices
- Clean, professional color scheme
- Smooth animations and transitions
- Intuitive navigation with sidebar and top navbar
- Role-based dashboard customization
| Layer | Technology |
|---|---|
| Backend Framework | Django 5.2.9 (Python) |
| Database | PostgreSQL |
| ORM | Django ORM |
| Authentication | Django Auth System with custom role-based access |
| Frontend | Bootstrap 5.3, Bootstrap Icons |
| Templates | Django Templates |
| Deployment | WSGI / ASGI |
| Font | Inter (Google Fonts) |
GearGuard/
│
├── gearguard/ # Main Django project directory
│ ├── __init__.py
│ ├── settings.py # Django settings configuration
│ ├── urls.py # Root URL configuration
│ ├── asgi.py # ASGI configuration
│ ├── wsgi.py # WSGI configuration
│
├── maintenance/ # Main application
│ ├── models.py # Database models
│ ├── views.py # View functions and class-based views
│ ├── urls.py # Application URL patterns
│ ├── forms.py # Django forms
│ ├── admin.py # Django admin configuration
│ ├── signals.py # Django signals
│ ├── mixins.py # Permission mixins
│ ├── utils.py # Utility functions
│ ├── decorators.py # Custom decorators
│ ├── error_handlers.py # Custom error handlers (404, 500, etc.)
│ ├── management/
│ │ └── commands/ # Django management commands
│ │ ├── add_sample_data.py
│ │ ├── create_all_users.py
│ │ └── create_manager.py
│ ├── migrations/ # Database migrations
│ └── templatetags/ # Custom template tags
│
├── templates/ # HTML templates
│ ├── 404.html # Custom 404 error page
│ └── maintenance/ # Application templates
│ ├── base.html # Base template
│ ├── login.html # Login page
│ ├── admin_dashboard.html
│ ├── manager_dashboard.html
│ ├── technician_dashboard.html
│ └── ... # Other templates
│
├── gearguard-postgres-schema.sql # PostgreSQL schema (optional)
├── database.py # Database utility script
├── populate_database.py # Script to populate database with dummy data
├── manage.py # Django management script
├── requirements.txt # Python dependencies
└── README.md # This file
-
UserProfile (extends Django User)
- Role assignment (Admin, Manager, Technician, User)
- Avatar URL
- Active status
-
MaintenanceTeam
- Team name and description
- Active status
- Timestamps
-
TeamMember (Junction Table)
- Many-to-many relationship between Teams and Users
- Role in team
- Join date
-
Equipment
- Equipment details (name, serial number, category)
- Department and location
- Maintenance team assignment
- Default technician assignment
- Purchase and warranty dates
- Preventive maintenance interval
- Scrap status
-
MaintenanceRequest
- Request type (Corrective/Preventive)
- Stage (New, In Progress, Repaired, Scrap)
- Priority (Low, Medium, High, Critical)
- Equipment, team, and technician assignment
- Time tracking (start, end, duration)
- Notes and resolution summary
- Overdue detection
-
UserRegistration
- Pending user registrations
- Approval workflow
- Role requests
- Equipment → MaintenanceTeam (Many-to-One)
- Equipment → User (assigned_to_user, default_technician)
- MaintenanceRequest → Equipment (Many-to-One)
- MaintenanceRequest → MaintenanceTeam (Many-to-One)
- MaintenanceRequest → User (assigned_technician, created_by)
- TeamMember → MaintenanceTeam & User (Many-to-Many)
- Python 3.10 or higher
- PostgreSQL 12 or higher
- pip (Python package manager)
git clone https://github.com/your-username/GearGuard.git
cd GearGuard# Windows
python -m venv venv
venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Create PostgreSQL database:
CREATE DATABASE gearguard;- Update database credentials in
gearguard/settings.py:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "gearguard",
"USER": "postgres",
"PASSWORD": "your_password",
"HOST": "localhost",
"PORT": "5432", # Default PostgreSQL port
}
}python manage.py makemigrations
python manage.py migratepython manage.py createsuperuserFollow the prompts to create an admin account.
You have two options to populate the database:
Option 1: Using the standalone Python script
python populate_database.py(Located at project root: populate_database.py)
Option 2: Using Django management command
python manage.py add_sample_data(Located at: maintenance/management/commands/add_sample_data.py)
python manage.py collectstaticpython manage.py runserverThe application will be available at http://127.0.0.1:8000/
| Role | Dashboard Access | Equipment Management | Request Management | Team Management | User Management | Reports |
|---|---|---|---|---|---|---|
| Admin | ✅ Admin Dashboard | ✅ Full Access | ✅ Full Access | ✅ Full Access | ✅ Full Access | ✅ All Reports |
| Manager | ✅ Manager Dashboard | ✅ View Only | ✅ Full Access | ✅ View Only | ❌ | ✅ Manager Reports |
| Technician | ✅ Technician Dashboard | ✅ View Only | ✅ Assigned Tasks Only | ❌ | ❌ | ✅ Own Reports |
| User | ✅ User Dashboard | ✅ View Only | ✅ Create/View Own | ❌ | ❌ | ❌ |
- Admin Dashboard: System-wide statistics, equipment overview, team management, user registrations
- Manager Dashboard: Team performance, request overview, preventive maintenance calendar, technician reports
- Technician Dashboard: Assigned tasks, team requests, work history, time tracking
- User Dashboard: Personal requests, equipment status, request creation
- Kanban Board: Visual board for request status management
- Calendar View: Preventive maintenance scheduling
- Request List: Filterable list with search capabilities
- Request Detail: Comprehensive request information and updates
- Automatic scheduling based on equipment maintenance intervals
- Calendar integration
- Recurring maintenance tracking
- Next maintenance date calculation
- Start/end task functionality for technicians
- Automatic duration calculation
- Estimated vs actual duration comparison
- Hours reporting for managers
- Login as a User
- Navigate to "Create Request"
- Select equipment
- Fill in subject, description, and priority
- Submit request
- Login as Manager
- Go to "Maintenance Requests"
- Select a request
- Assign to technician and team
- Set priority and scheduled date
- Login as Technician
- View assigned tasks
- Click "Start Task" when beginning work
- Update notes and status
- Click "End Task" when finished
- Add resolution summary
Django management commands are located in maintenance/management/commands/ directory.
python manage.py add_sample_dataCreates sample teams, equipment, and maintenance requests.
- File location:
maintenance/management/commands/add_sample_data.py
python manage.py create_all_usersCreates users for all roles with default passwords.
- File location:
maintenance/management/commands/create_all_users.py
python manage.py create_managerCreates a manager user.
- File location:
maintenance/management/commands/create_manager.py
You can also use the standalone script at the project root:
python populate_database.py- File location:
populate_database.py(project root)
Important Settings:
DEBUG: Set toFalsein productionALLOWED_HOSTS: Configure for production deploymentSECRET_KEY: Generate a new secret key for productionDATABASES: Configure PostgreSQL connectionSTATIC_ROOT: Directory for collected static files
Create a .env file:
SECRET_KEY=your-secret-key-here
DEBUG=False
DB_NAME=gearguard
DB_USER=postgres
DB_PASSWORD=your-password
DB_HOST=localhost
DB_PORT=5432
Run Django tests:
python manage.py test- Set
DEBUG = False - Configure
ALLOWED_HOSTS - Generate new
SECRET_KEY - Set up PostgreSQL database
- Configure static files serving
- Set up SSL/HTTPS
- Configure email settings (for notifications)
- Set up backup strategy
- Configure logging
- Set up monitoring
python manage.py collectstaticpg_dump -U postgres gearguard > backup.sql- Verify PostgreSQL is running
- Check database credentials in
settings.py - Ensure database exists
- Check PostgreSQL port (default: 5432)
python manage.py makemigrations
python manage.py migrate --run-syncdbpython manage.py collectstaticEnsure STATIC_ROOT is configured correctly.
- Email notifications for request updates
- REST API for mobile applications
- Advanced analytics and reporting
- Equipment QR code scanning
- Mobile-responsive improvements
- Multi-language support
- Document attachment support
- Automated preventive maintenance scheduling
- Equipment maintenance history timeline
- Cost tracking and budgeting
- Manufacturing Plants: Track production equipment maintenance
- Facility Management: Manage building systems and infrastructure
- IT Infrastructure: Monitor server and network equipment
- Industrial Maintenance: Schedule and track industrial machinery
- Asset Tracking: Comprehensive equipment lifecycle management
- Healthcare Facilities: Medical equipment maintenance tracking
- Educational Institutions: Campus equipment management
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed for educational use.
GearGuard Development Team
Built with ❤️ using Django & PostgreSQL
For issues, questions, or contributions, please open an issue on the GitHub repository.
Version: 1.0.0
Last Updated: 2025
Status: Production Ready