0% found this document useful (0 votes)
5 views

MERN Stack Developer Hiring Task

The document outlines a task for hiring a MERN Stack Developer to create a Production Line Management System that tracks manufacturing workflows. Key requirements include role-based access using JWT, CRUD operations for production data, and utilizing Redux Toolkit for state management. Deliverables must be submitted by March 6, 2025, and include a code repository, documentation, and a live demo of the application.

Uploaded by

realsv123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

MERN Stack Developer Hiring Task

The document outlines a task for hiring a MERN Stack Developer to create a Production Line Management System that tracks manufacturing workflows. Key requirements include role-based access using JWT, CRUD operations for production data, and utilizing Redux Toolkit for state management. Deliverables must be submitted by March 6, 2025, and include a code repository, documentation, and a live demo of the application.

Uploaded by

realsv123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MERN Stack Developer Hiring Task

Duration: 1 Week

Submission form: Google Form

Please submit all deliverables weather completed or incomplete by Thursday, 6th March 2025, 11:59 P.M.

Detailed Objective

Develop a Production Line Management System to track manufacturing workflows—including production


orders, materials, workstations, and employee roles. The system must:

• Allow managers to create and monitor production orders.


• Enable operators to update order statuses and log material usage.
• Use JWT authentication for role-based access (Manager, Operator).
• Implement Redux Toolkit for global state management (e.g., orders, materials).
• Utilize Shadcn components for a clean, responsive UI.
• Demonstrate full CRUD operations for production data.

Additional Tools & Hosting:


You may leverage AI tools such as V0, Bolt, or Lovable AI to assist in creating and enhancing the UI. Free
hosting services like Netlify and Render can be used to host the application.

Detailed Requirements

Backend (Node.js, Express.js, MongoDB)

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

• Role-based access control (e.g., Operators cannot delete orders).


• Validate JWT token for protected routes.
• Use express-validator to ensure fields like quantity > 0 and dueDate is a future date.

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.

Frontend (React, Redux Toolkit, Shadcn)

Pages & Features

• 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

• Redux Toolkit Slices:


o authSlice: Store JWT, user role, and department.
o ordersSlice: Manage CRUD operations, filtering, and sorting.
o materialsSlice: Track stock levels and low-stock alerts.
• Async Thunks:
o Fetch orders/materials on app load.
o Handle API errors gracefully (e.g., "Failed to update order").

UI Components (Shadcn)

• Tables: Use DataTable with customizable columns for orders.


• Forms: Implement Form, Input, and Select components for order creation.
• Visualization: Use Card and Badge for metrics (e.g., Low Stock: 5 materials).
• Notifications: Toast messages for success/error actions.

Routing

• Implement protected routes (e.g., /dashboard accessible only after login).


• Redirect Operators to a simplified view without delete/update permissions.

Additional UI & Hosting Guidelines

• 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

• Use axios with interceptors to attach the JWT token to headers.


• Implement responsive design suitable for factory-floor tablets (e.g., landscape layout).
• Write reusable components (e.g., a StatusBadge with color-coded statuses).

Deliverables & Submission Criteria

• 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.

You might also like