Full Stack Assignment
Full Stack Assignment
Develop a simple web application that allows users to raise complaints, and administrators
to view and address those complaints. The application will use MongoDB for data storage,
Node.js with Next for the backend, and React for the frontend. The system will also include
email notifications when complaints are submitted or updated.
Requirements:
1. User Interface:
● MongoDB Setup:
○ Use MongoDB to store complaints with the following structure:
■ Complaint Schema:
■ title (String)
■ description (String)
■ category (String)
■ priority (String)
■ status (String: "Pending", "In Progress", "Resolved")
■ dateSubmitted (Date)
○ Implement the following CRUD operations:
■ Users: Create complaints (POST).
■ Admins: Read complaints (GET), Update complaints (PUT), Delete
complaints (DELETE).
● API Endpoints:
○ POST /complaints – For users to create new complaints.
○ GET /complaints – For admins to view all complaints.
○ PUT /complaints/
– For admins to update complaint status or details.
○ DELETE /complaints/
– For admins to delete complaints.
● Integrate email functionality using NodeMailer (or an alternative email service like
SendGrid or Mailgun) to send email notifications in the following cases:
○ Email on New Complaint Submission:
■ When a user submits a new complaint, an email should be sent to the
admin notifying them about the new complaint.
■ The email should include details such as the complaint title, category,
priority, and description.
○ Email on Status Update:
■ When an admin updates the status of a complaint (e.g., marking it as
"Resolved"), an email should be sent to the admin confirming the
update.
■ The email should include the complaint title, the new status, and the
date it was updated.
4. Frontend (React):
Deliverables: