Product Ratings and Reviews System — Full-Stack Web Application
Source: Derived from Resources/Internship Assignment 2025.pdf — an internship take-home assignment from Fitpage (contact: prasad@fitpage.in), asking candidates to build a Ratings and Reviews web application backed by REST APIs and a relational database.
Skills Required
- REST API design with Node.js and a framework (Express.js or Nest.js) — routing, controllers, request/response handling, HTTP status codes
- Relational database modeling (MySQL or PostgreSQL): tables, primary/foreign keys, composite unique constraints, indexes
- Writing and reading an ER diagram / SQL schema
- CRUD operations and parameterized SQL queries (or an ORM/query builder such as Prisma, Sequelize, TypeORM, or Knex)
- Aggregation queries (computing average rating, rating counts, star-distribution histograms)
- Frontend development with HTML, CSS, and JavaScript, or a framework (React or Next.js)
- Fetching and rendering API data on the client; managing form state and loading/error states
- Input validation on BOTH client and server (rating range 1–5, required-field checks, text length limits, sanitization)
- Enforcing business rules — preventing duplicate ratings by the same user on the same product (unique constraint + graceful 409 handling)
- Identifying a "current user" (lightweight auth, session, or a user identifier) to attribute reviews
- Git version control: clean commit history, a public repository, a clear README
- Writing setup/run/test documentation
- (Bonus) Basic text processing / tag extraction to surface "most used tags" from review text
- (Bonus) File/image upload handling and storage (local disk, S3, or similar)
- (Optional) Deployment to a hosting platform (Render, Railway, Vercel, Netlify, Fly.io, etc.)
Background a Student Needs
A student should understand the request/response cycle of a web application and how a frontend talks to a backend through HTTP/JSON REST endpoints, and how that backend persists data in a relational database. Comfort with one server framework (Express or Nest), basic SQL (including foreign keys, unique constraints, and AVG/COUNT aggregates), and one frontend approach (vanilla JS or React/Next) is enough. The conceptual core is a classic many-to-many relationship — users review products — with the twist that each user may rate a given product only once, which is enforced cleanly with a composite unique key rather than ad-hoc checks.
Task Summary
Build a web application where users can leave a star rating, a written review, or both for products shown on a page. Each product displays its summary rating (average and count) plus the tagged reviews left for it, and the system must prevent a user from rating the same product more than once. The backend exposes REST APIs (Node/Express/Nest), data lives in a relational database (MySQL/PostgreSQL), and the frontend can be plain HTML/CSS/JS or React/Next.
The Task
Build a web application that lets users provide ratings and reviews for products listed on a page. On the frontend, you may create a dummy page that displays a fixed set of products. A user can give a rating, a review, or both for a product. Each product should display its summary rating and the tagged reviews associated with it.
Functional Requirements
- A user may submit either a rating, a review, or both for a product.
- Basic validations must be handled well on all input fields (e.g., rating within an allowed range, required fields present, sensible text limits).
- A user must not be able to rate the same product multiple times.
- Bonus features (optional):
- Identify the pattern from the reviews and generate the most-used tags.
- Allow users to attach photos to a review.
Technical Requirements
- Backend: Use REST APIs for all backend logic. Node.js with Express.js or Nest.js is preferred.
- Frontend: Build the UI with HTML, CSS, and JavaScript, or a frontend framework such as React or Next.js.
- Database: Use a relational database such as MySQL or PostgreSQL.
Deliverables
- Codebase — backend logic with REST APIs, the frontend UI, and the code pushed to Git (or similar version control).
- Database schema — a SQL schema and/or ER diagram.
- Documentation — brief docs covering how to set up, run, and test the application.
- Hosting (optional) — bonus credit if the solution is deployed/hosted.
Alternate Tasks (Mini-Project Variations)
- (Beginner) Single-page review board, no real backend. Build a static products page with HTML, CSS, and vanilla JavaScript that lists 4–6 hardcoded products. Let the user pick a star rating (1–5) and type a short review for any product, then store all submissions in the browser's
localStorage. Each product card should recompute and show its average rating and total review count live as new reviews are added, and reviews should render in a list below each product. Enforce the core rule client-side: once a "user" (a name typed once at the top of the page) has rated a product, disable that product's rating form. This version teaches DOM manipulation, form validation, array/object data modeling, and aggregation math without any server or database, making it the natural first rung. - (Beginner–Intermediate) REST API + relational schema, backend only. Implement just the backend from the original assignment using Node.js with Express and PostgreSQL (or MySQL). Design a clean schema —
users, products, and a reviews table with rating (CHECK between 1 and 5), nullable review_text, and a composite UNIQUE constraint on (user_id, product_id) so the database itself blocks duplicate ratings. Expose endpoints such as GET /products, GET /products/:id/reviews, and POST /products/:id/reviews, returning a 409 Conflict when a user tries to rate twice and a 400 on validation failures. Include the SQL schema file and an ER diagram, plus a README documenting how to seed data and exercise each endpoint with curl or Postman. This isolates the data-modeling and API-contract skills that the assignment is really testing. - (Intermediate) Full MERN-style app with summary tags. Build the complete original system end to end with React (or Next.js) on the frontend and Express on the backend, then implement the first bonus: the "most-used tags" feature. After submission, run a lightweight keyword/phrase extraction over each product's review text on the server (stop-word removal plus frequency counting, or a small npm library) and persist the top tags so the product card can render them as clickable chips that filter the review list. Add proper loading, empty, and error states in the UI, real client-side and server-side validation, and a star-distribution histogram (how many 5-star, 4-star, etc.). Deploy the result to a free host and document the live URL. This rung pushes a student through a realistic full-stack build plus a small data-processing feature.
- (Intermediate–Advanced, MERN twist) Reviews with image uploads, auth, and moderation. Extend the system into a production-shaped MERN application. Add real user authentication (JWT or session-based sign-up/login) so reviews are genuinely attributed to accounts, then implement the second bonus — photo uploads — using
multer to accept images, storing files on disk or an object store (S3 / Cloudinary) and saving only URLs in the database. Layer in an admin moderation view where flagged or reported reviews can be hidden, add pagination and sorting (most recent, most helpful) to the reviews endpoint, and write integration tests for the "one review per user per product" rule and the upload path. This variation introduces auth, file handling, access control, and testing — the concerns that separate a toy app from a deployable one. - (Advanced, Agentic AI twist) AI-assisted review intelligence layer. Keep the ratings-and-reviews core, but add an agentic AI service that enriches every incoming review. When a review is posted, an agent (built on the Claude or OpenAI API, optionally orchestrated with LangChain/LangGraph) performs sentiment classification, auto-generates 3–5 normalized tags, flags abusive or spammy content for moderation, and writes a one-line "what customers say" summary per product that updates as new reviews arrive. Expose a
GET /products/:id/insights endpoint that returns the aggregated sentiment breakdown and the generated summary, and have the frontend surface it above the raw reviews. To stay robust, design the agent calls to be asynchronous (queue the enrichment so the user's POST returns immediately) and handle model failures with graceful fallbacks. This rung blends the full-stack base with practical LLM tool-use, prompt design, structured output parsing, and async pipeline thinking — squarely in the Agentic AI track.
Reference Links