MERN Stack Developer Hiring Task
MERN Stack Developer Hiring Task
Duration: 1 Week
Please submit all deliverables weather completed or incomplete by Thursday, 6th March 2025, 11:59 P.M.
Detailed Objective
Detailed Requirements
Models
• User Model
o Fields: username (unique), email, password (hashed), role (Manager/Operator), and department
(e.g., Assembly, Quality Control).
• Production Order Model
o Fields: orderId (auto-incrementing custom ID: PROD-001), productName, quantity, priority
(High/Medium/Low), and status (Planned -> In Production -> Quality Check -> Completed).
o Includes: materialsUsed (array of objects with { materialId, quantity } referencing Material Model),
workstationId (reference to Workstation Model), startDate, endDate, and createdBy (reference to
User).
• Material Model
o Fields: name, currentStock, and minimumStockLevel.
• Workstation Model
o Fields: name, status (Active/Under Maintenance).
API Endpoints
• Auth
o POST /api/auth/register: Register users with role validation (Managers can register Operators).
o POST /api/auth/login: Return JWT with user role.
• Production Orders (Protected)
o GET /api/orders?status=In_Production&workstation=Assembly : Filter orders by status/workstation.
o POST /api/orders: Create an order (only Managers).
o PUT /api/orders/:id/status: Update status (e.g., Operator moves from "In Production" to
"Quality Check").
o DELETE /api/orders/:id: Delete orders (only Managers).
• Materials
o PUT /api/materials/:id: Update stock levels after an order is completed.
• Analytics
o GET /api/analytics/overview: Return metrics like totalOrders, ordersByStatus, materialUsage.
Middleware
Database
• Seed initial data for materials (e.g., Steel, Plastic) and workstations (e.g., Welding, Packaging).
• Use MongoDB aggregation to calculate material usage per order.
• Login/Registration
o Role-based registration form (dropdown for role and department).
o Display error toasts for invalid credentials.
• Dashboard (Role-Specific)
o Managers:
▪ Create/delete orders via a modal form with dropdowns for materials and
workstations.
▪ View real-time metrics (e.g., pie chart for order status distribution).
o Operators:
▪ Update order status using Shadcn’s DropdownMenu.
▪ Log material usage per order.
o Shared:
▪ Table of orders with sorting, pagination, and filters (status, workstation, priority).
▪ Highlight delayed orders (where endDate < currentDate).
State Management
UI Components (Shadcn)
Routing
• You are encouraged to utilize AI tools (e.g., V0, Bolt, or Lovable AI) to streamline and enhance UI
development.
• Consider deploying your frontend using free hosting services such as Netlify or Render to provide a
live demo.
Technical Requirements
Backend
• Use mongoose for schema validation and establishing relationships (references between models).
• Hash passwords using bcryptjs and generate JWT tokens with jsonwebtoken.
• Deploy MongoDB on Atlas with a production-ready cluster.
Frontend
• Code Repository:
o Backend: Place code under server/ (models, routes, controllers, middleware).
o Frontend: Place code under client/ (src/components, src/pages, src/redux).
• Documentation:
o Include a README.md with setup instructions (e.g., MongoDB URI, .env variables).
o Provide a Postman collection for testing all endpoints (include sample requests).
• Live Demo:
o Deploy the application using free hosting services (e.g., Netlify, Render) and provide a link to
a running demo.
• Submission Criteria:
o Submit a GitHub repository link containing the full codebase.
o Provide a link to the live demo application.
o Ensure that all endpoints and features are fully functional and documented.
o Submission form: Google Form
o Please submit all deliverables weather completed or incomplete by Thursday, 6th March
2025, 11:59 P.M.
Evaluation Criteria
• Functionality (40%):
o Role-based access, CRUD operations, dynamic filters, and real-time updates.
• Code Quality (30%):
o Clean Redux state management, efficient API calls, proper error handling, and reusable
components.
• Manufacturing Relevance (20%):
o Logical status transitions, material tracking, and workstation management.
• Security & UI/UX (10%):
o JWT validation, password hashing, and an intuitive, Shadcn-based UI.