A comprehensive MERN stack application for managing repair services with real-time updates, notifications, and advanced analytics.
- User Management: Complete CRUD operations with role-based access control
- Job Management: Create, assign, track, and manage repair jobs with drag & drop interface
- Dispute Resolution: Handle customer disputes with comment system and escalation
- Real-time Notifications: WebSocket-powered live updates and Firebase Cloud Messaging
- Advanced Analytics: Interactive charts and reports with export functionality
- File Upload System: Secure file handling for avatars, job attachments, and dispute evidence
- Multilingual Support: English and Urdu translations
- Responsive Design: Mobile-first approach with modern UI
- SEO Optimized: Meta tags, structured data, and performance optimization
- Interactive Demo: Live preview integration with admin dashboard
- RESTful APIs: Complete CRUD operations for all entities
- JWT Authentication: Secure token-based authentication with refresh tokens
- Role-Based Access Control: Admin, Support, Technician, and Viewer roles
- Two-Factor Authentication: TOTP-based 2FA with backup codes
- Real-time Communication: Socket.IO for live updates
- File Upload: Multer-based secure file handling
- Rate Limiting: Protection against abuse and DDoS attacks
- Security Middleware: Helmet, CORS, and input validation
- React.js 18 - Admin dashboard with hooks and context API
- Next.js 14 - Landing page with SSR and TypeScript
- Tailwind CSS - Utility-first CSS framework
- Chart.js - Interactive charts and analytics
- Socket.IO Client - Real-time communication
- Node.js - Runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database with Mongoose ODM
- Socket.IO - Real-time bidirectional communication
- JWT - JSON Web Tokens for authentication
- Multer - File upload middleware
- Speakeasy - Two-factor authentication
- QRCode - QR code generation for 2FA setup
- Helmet - Security headers
- Rate Limiting - API protection
- CORS - Cross-origin resource sharing
- bcrypt - Password hashing
- Input Validation - Data sanitization
- File Type Validation - Secure file uploads
- Node.js 18+ and npm
- MongoDB 5.0+
- Git
git clone <repository-url>
cd smartfixcd server
npm install
cp .env.example .env
# Configure environment variables in .env
npm run devcd ..
npm install
npm startcd landing
npm install
npm run dev# Server Configuration
PORT=4000
NODE_ENV=development
FRONTEND_ORIGIN=http://localhost:3000
# Database
MONGODB_URI=mongodb://localhost:27017/smartfix
# JWT Configuration
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES_IN=24h
JWT_REFRESH_SECRET=your_refresh_secret_key_here
JWT_REFRESH_EXPIRES_IN=7d
# Firebase Configuration (Optional)
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_PRIVATE_KEY=your_firebase_private_key
FIREBASE_CLIENT_EMAIL=your_firebase_client_emailREACT_APP_API_URL=http://localhost:4000/api
REACT_APP_SOCKET_URL=http://localhost:4000
REACT_APP_FIREBASE_VAPID_KEY=your_firebase_vapid_keyNEXT_PUBLIC_ADMIN_ORIGIN=http://localhost:3000POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/refresh- Refresh JWT tokenGET /api/auth/me- Get current user profilePUT /api/auth/me- Update user profilePOST /api/auth/logout- User logout
POST /api/auth/2fa/setup- Initialize 2FA setupPOST /api/auth/2fa/enable- Enable 2FA after verificationPOST /api/auth/2fa/disable- Disable 2FAPOST /api/auth/2fa/verify- Verify 2FA tokenGET /api/auth/2fa/status- Get 2FA status
GET /api/users- List users with pagination and filtersGET /api/users/:id- Get user by IDPOST /api/users- Create new user (Admin only)PUT /api/users/:id- Update userDELETE /api/users/:id- Delete user (Admin only)POST /api/users/bulk-action- Bulk user operations
GET /api/jobs- List jobs with pagination and filtersGET /api/jobs/:id- Get job by IDPOST /api/jobs- Create new jobPUT /api/jobs/:id- Update jobDELETE /api/jobs/:id- Delete jobPUT /api/jobs/:id/status- Update job statusPUT /api/jobs/:id/assign- Assign technician to job
GET /api/disputes- List disputesGET /api/disputes/:id- Get dispute by IDPOST /api/disputes- Create new disputePUT /api/disputes/:id- Update disputePOST /api/disputes/:id/comments- Add comment to disputePUT /api/disputes/:id/resolve- Resolve dispute
POST /api/upload/avatar- Upload user avatarPOST /api/upload/job/:jobId- Upload job attachmentsPOST /api/upload/dispute/:disputeId- Upload dispute attachmentsDELETE /api/upload/file/:type/:id/:filename- Delete file
GET /api/analytics/overview- Dashboard overview statsGET /api/analytics/trends- Trend dataGET /api/analytics/performance- Performance metricsGET /api/analytics/export- Export analytics data
- JWT-based authentication with refresh tokens
- Role-based access control (Admin, Support, Technician, Viewer)
- Account lockout after failed login attempts
- Password strength requirements
- Two-factor authentication with TOTP
- Password hashing with bcrypt (12 rounds)
- Input validation and sanitization
- SQL injection prevention
- XSS protection with Helmet
- CSRF protection
- Rate limiting on API endpoints
- File type validation
- File size limits
- Secure file storage
- Path traversal prevention
- Malware scanning (configurable)
authenticate- User authenticationjoin-user-room- Join personal roomjoin-admin-room- Join admin roomupdate-job-status- Real-time job updatessend-notification- Send notificationsuser-status-change- User online/offline status
- Firebase Cloud Messaging integration
- Device token management
- Targeted notifications by user/role
- Notification history and read status
cd server
npm test
npm run test:coveragenpm test
npm run test:coveragenpm run test:e2e# Backend
cd server
npm run build
# Frontend
cd ..
npm run build
# Landing Page
cd landing
npm run builddocker-compose up -d- Development: Local development with hot reload
- Staging: Pre-production testing environment
- Production: Optimized build with security hardening
- Database indexing for optimal query performance
- Connection pooling for MongoDB
- Caching strategies for frequently accessed data
- Compression middleware for API responses
- Async/await patterns for non-blocking operations
- Code splitting and lazy loading
- Image optimization and compression
- Bundle size optimization
- Service worker for offline functionality
- CDN integration for static assets
- Error tracking and reporting
- Performance metrics collection
- User activity analytics
- API response time monitoring
- Database query performance
- Structured logging with Winston
- Log rotation and archival
- Error log aggregation
- Audit trail for sensitive operations
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
I'm always open to discussing new projects, creative ideas, or opportunities to be part of your visions.
Email: hanzlashahzadhanzlashahzad@gmail.com
LinkedIn: https://www.linkedin.com/in/hanzla-shahzad
GitHub: https://github.com/hanzlashahzad01/hanzlashahzad01
- β Core CRUD operations
- β Authentication system
- β Real-time features
- β File upload system
- β Two-factor authentication
- π± Mobile applications (React Native)
- π Third-party integrations (Payment gateways, Maps)
- π€ AI-powered job assignment
- π Advanced analytics and reporting
- π Multi-tenant architecture
SmartFix Admin is currently under active development.
Core dashboard structure and UI setup are completed.
Upcoming updates will include:
- Backend API integration
- Role-based authentication
- Service request management
- Analytics dashboard
This project is part of my continuous learning and real-world admin panel development practice.
SmartFix - Streamlining service management with modern technology.
Made by Hanzla Shahzad π₯π