0% found this document useful (0 votes)
2 views4 pages

Interview Task

Uploaded by

Arun Bhardwaj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Interview Task

Uploaded by

Arun Bhardwaj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MERN Stack Interview Task – Vendor Module


Objective

Develop a Vendor Authentication & Product Approval Module using the MERN Stack
(MongoDB, [Link], [Link], [Link]).​
The focus is on clean architecture, secure authentication, API design, and basic UI.

Tech Stack (Mandatory)

S
●​ Frontend: [Link]

IE
●​ Backend: [Link] + [Link]
●​ Database: MongoDB

G
●​ Authentication: OAuth (Google) + Email/Password
●​ API: REST APIs

LO
●​ Optional: JWT for session handling

Task Scope O
1. Vendor Authentication (Signup & Login)
N
Features Required
H

1.​ Vendor Signup (Email/Password)


C

○​ Fields:
■​ Vendor Name
TE

■​ Email
■​ Password (hashed)
■​ Phone Number
LE

○​ Validation required
○​ Password encryption mandatory
2.​ Vendor Login
FY

○​ Login using Email & Password


○​ Generate JWT on successful login
3.​ OAuth Login (Google)
IN

○​ Vendor should be able to sign up / login using Google OAuth


○​ If vendor exists → login
○​ If new → auto-create vendor profile
4.​ Protected Routes
○​ Only logged-in vendors can access dashboard & product pages






INFYLE TECHNOLOGIES​
Plot 191, Industrial Area Phase 2, Chandigarh, India.​
501, 5th Floor, Block D, CCC, Vip Road, Zirakpur, Punjab.​
Call: +917347574707 | Email: Support@[Link] | Web: [Link]


2. Vendor Dashboard

After login, vendor should see:

●​ Basic vendor profile info


●​ Button to:
○​ Add Product
○​ View Submitted Products & Status

3. Add Product Module

S
IE
Product Form Fields

●​ Product Name

G
●​ Description
●​ Price

LO
●​ Category
●​ Product Image (optional – base64 / URL)
●​ Status (default: Pending Approval)
O
Behavior
N
●​ Vendor can add a product
H

●​ Product is saved with:


○​ vendorId
C

○​ status: pending
TE

●​ Vendor cannot directly publish product


4. Product Approval Flow (Admin Simulation)
LE

Admin panel UI is not required, only backend logic.


FY

Requirements

●​ API to:
○​ Fetch all products with status = pending
IN

○​ Update product status to:


■​ approved
■​ rejected
●​ Once approved:
○​ Product becomes visible in vendor product list as Approved



INFYLE TECHNOLOGIES​
Plot 191, Industrial Area Phase 2, Chandigarh, India.​
501, 5th Floor, Block D, CCC, Vip Road, Zirakpur, Punjab.​
Call: +917347574707 | Email: Support@[Link] | Web: [Link]




5. Database Schema (Expected)

Vendor Schema

●​ name
●​ email
●​ password (hashed)
●​ oauthProvider (Google / Local)

S
●​ createdAt

IE
Product Schema

G
●​ name
●​ description

LO
●​ price
●​ category
●​ image O
●​ vendorId (reference)
●​ status (pending / approved / rejected)
N
●​ createdAt
H

6. API Endpoints (Minimum Expected)


C

Auth
TE

●​ POST /api/vendor/signup
●​ POST /api/vendor/login
●​ GET /api/vendor/google (OAuth)
LE

Product
FY

●​ POST /api/product/add
●​ GET /api/product/vendor/:vendorId
●​ GET /api/product/pending
IN

●​ PUT /api/product/approve/:productId









INFYLE TECHNOLOGIES​
Plot 191, Industrial Area Phase 2, Chandigarh, India.​
501, 5th Floor, Block D, CCC, Vip Road, Zirakpur, Punjab.​
Call: +917347574707 | Email: Support@[Link] | Web: [Link]





7. Frontend Requirements

●​ Clean UI (basic CSS / Tailwind / MUI – any)


●​ Pages:
○​ Vendor Signup
○​ Vendor Login

S
○​ Vendor Dashboard
○​ Add Product Page

IE
●​ Show product status clearly (Pending / Approved / Rejected)

G
8. Bonus Points (Optional)

LO
●​ Role-based access (Vendor / Admin)
●​ Better folder structure
●​ Environment variables usage
●​ Form validation (Formik / Yup)
O
●​ Clean commit history
N
9. Submission Guidelines
H

●​ GitHub repository link


C

●​ README file must include:


○​ Setup instructions
TE

○​ Tech stack used


○​ API routes explanation
●​ Optional: Deployed link (Vercel / Render)
LE

Evaluation Criteria

●​ Code structure & readability


FY

●​ Authentication implementation
●​ API design
●​ Database modeling
IN

●​ Error handling
●​ Basic UI/UX
●​ Security best practices

INFYLE TECHNOLOGIES​
Plot 191, Industrial Area Phase 2, Chandigarh, India.​
501, 5th Floor, Block D, CCC, Vip Road, Zirakpur, Punjab.​
Call: +917347574707 | Email: Support@[Link] | Web: [Link]

You might also like