Skip to content

ari9516/reviewsaver-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

80 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ REVIEWSAVER β€” Backend API

Authentication + Reviews + AI Recommendations
A secure, full-stack review platform built with Spring Boot, PostgreSQL, and a three-tier AI recommendation engine.

Java Spring Boot PostgreSQL React Deployed on Render Frontend on Netlify


πŸ”— Live Demo

Layer URL
Frontend authreview-reviewsaver-ari-cc660f.netlify.app
Backend API Hosted on Render

πŸ“– Project Report

The full academic project report is available here:
πŸ“„ Project Report (GROUP-129).pdf

Submitted to VIT Bhopal University, School of Computing Science and Engineering, April 2026.


πŸ“ System Diagrams

Use Case Diagram

Illustrates all interactions between Guest users, Authenticated users, and the System.

3_Use_Case_Diagram

Data Flow Diagram

Shows the authentication flow (JWT + OTP) and the review + AI recommendation pipeline.

4_Data_Flow_Diagram ---

πŸ“‹ Table of Contents


🧠 About

REVIEWSAVER is a full-stack web application that solves a real problem: existing review platforms suffer from fake reviews, poor authentication, and generic recommendations. REVIEWSAVER addresses all three by combining:

  • Multi-factor authentication (JWT + OTP via Gmail SMTP) to ensure only verified users submit reviews
  • Full review management (CRUD, search, filtering, voting) across 5 categories
  • A three-tier AI recommendation engine that personalizes suggestions based on user engagement level

πŸ›  Tech Stack

Layer Technology
Backend Spring Boot 3.5.11, Spring Security, Spring Data JPA, Hibernate
Frontend React 18.3, React Router 6.30
Database PostgreSQL 17
Authentication JWT (JSON Web Tokens), BCrypt, Gmail SMTP (OTP)
Deployment Netlify (frontend), Render (backend), GitHub (version control)
Language Java 17+ (backend), JavaScript ES6+ (frontend)

✨ Features

πŸ” Authentication & User Management

  • OTP-based email verification on registration (6-digit, 10-min expiry)
  • Stateless JWT token issuance on login
  • BCrypt password hashing
  • Password reset via OTP email flow
  • Profile management (username, bio, location, DOB)

πŸ“ Review Management

  • Full CRUD operations on reviews
  • 5 review categories: Electronics, Movies, Restaurants, Cafes, Food
  • Upvote / Downvote system
  • Keyword search, category filter, and multi-field sorting (date, rating, upvotes)
  • Pagination support for large datasets
  • Dashboard stats (total reviews, upvotes/downvotes received)

πŸ€– AI Recommendations

  • Three-tier progressive recommendation engine (see below)
  • "Find Your Perfect Match" mood-based wizard (multi-step preference quiz)
  • Real-time ranked recommendations on the user dashboard
  • Trending algorithm based on upvote counts and recency scoring

πŸ”’ Security

  • JWT authentication enforced on all protected routes
  • CORS policy configuration
  • 401 Unauthorized returned on all invalid/expired token attempts

πŸ— System Architecture

REVIEWSAVER follows a three-tier MVC architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Presentation Layer                  β”‚
β”‚    React 18.3 Frontend  β†’  Netlify           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚ REST API (JSON)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Application Logic Layer             β”‚
β”‚    Spring Boot 3.5.11 Backend  β†’  Render     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚Auth Moduleβ”‚ β”‚Review    β”‚ β”‚ AI Engine   β”‚  β”‚
β”‚  β”‚JWT + OTP  β”‚ β”‚CRUD Svc  β”‚ β”‚ 3-Tier Reco β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚ Spring Data JPA / Hibernate
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Data Layer                      β”‚
β”‚         PostgreSQL 17 (Cloud-hosted)         β”‚
β”‚   [Users Table] [Reviews Table] [Interactions Table] β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€– AI Recommendation Engine

The recommendation engine adapts based on how much a user has interacted with the platform:

Tier Trigger Strategy
Tier 1 < 5 interactions Category & keyword-based filtering
Tier 2 5–15 interactions NLP-powered full-text analysis
Tier 3 15+ interactions Collaborative filtering (interaction pattern matching)
Trending All users Upvote count + recency scoring

Users with more than 5 recorded interactions receive measurably more relevant recommendations β€” validated during performance testing.


🌐 API Endpoints

Authentication

Method Endpoint Description Auth Required
POST /api/auth/register Register new user ❌
POST /api/auth/verify-otp Verify OTP to activate account ❌
POST /api/auth/login Login, returns JWT ❌
POST /api/auth/forgot-password Send OTP for password reset ❌
POST /api/auth/reset-password Reset password with OTP ❌

Reviews

Method Endpoint Description Auth Required
GET /api/reviews List all reviews (paginated, filterable) ❌
POST /api/reviews Create a new review βœ…
PUT /api/reviews/{id} Update your review βœ…
DELETE /api/reviews/{id} Delete your review βœ…
POST /api/reviews/{id}/upvote Upvote a review βœ…
POST /api/reviews/{id}/downvote Downvote a review βœ…

Recommendations

Method Endpoint Description Auth Required
GET /api/recommendations Get personalized recommendations βœ…
POST /api/recommendations/match "Find Your Perfect Match" query βœ…

User

Method Endpoint Description Auth Required
GET /api/user/profile Get current user profile βœ…
PUT /api/user/profile Update profile βœ…
GET /api/user/dashboard Dashboard stats βœ…

πŸ—„ Database Schema

Three core tables power the platform:

-- Users Table
users (id, email, password_hash, is_verified, otp, otp_expiry,
       username, phone, location, dob, bio, created_at)

-- Reviews Table  
reviews (id, product_name, category, content, rating,
         upvotes, downvotes, author_id [FK→users], created_at, updated_at)

-- Interactions Table
interactions (id, user_id [FK→users], review_id [FK→reviews],
              interaction_type [VIEW|VOTE|SUBMIT], created_at)

πŸš€ Getting Started

Prerequisites

  • Java 17+
  • Maven 3.8+
  • PostgreSQL 17
  • Node.js 18+ (for frontend)

Backend Setup

# 1. Clone the repository
git clone https://github.com/RishiRaj1495/reviewsaver-backend.git
cd reviewsaver-backend

# 2. Configure environment variables (see below)
cp src/main/resources/application.properties.example src/main/resources/application.properties

# 3. Build and run
mvn clean install
mvn spring-boot:run

The backend will start at http://localhost:8080.

Frontend Setup

# Clone the frontend repo and install dependencies
git clone https://github.com/ari9516/reviewsaver-frontend.git
cd reviewsaver-frontend
npm install
npm start

The frontend will start at http://localhost:3000.


βš™οΈ Environment Variables

Create src/main/resources/application.properties with the following:

# Database
spring.datasource.url=jdbc:postgresql://localhost:5432/reviewsaver
spring.datasource.username=YOUR_DB_USERNAME
spring.datasource.password=YOUR_DB_PASSWORD
spring.jpa.hibernate.ddl-auto=update

# JWT
jwt.secret=YOUR_JWT_SECRET_KEY
jwt.expiration=86400000

# Gmail SMTP (for OTP emails)
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=YOUR_GMAIL_ADDRESS
spring.mail.password=YOUR_GMAIL_APP_PASSWORD
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true

# CORS
cors.allowed-origins=http://localhost:3000

⚠️ Never commit real credentials. Use environment variables or a secrets manager in production.


πŸ“ Project Structure

reviewsaver-backend/
β”œβ”€β”€ src/
β”‚   └── main/
β”‚       β”œβ”€β”€ java/com/reviewsaver/
β”‚       β”‚   β”œβ”€β”€ auth/               # JWT, OTP, BCrypt logic
β”‚       β”‚   β”œβ”€β”€ user/               # User entity, service, controller
β”‚       β”‚   β”œβ”€β”€ review/             # Review CRUD, voting, search
β”‚       β”‚   β”œβ”€β”€ recommendation/     # 3-tier AI engine
β”‚       β”‚   β”œβ”€β”€ interaction/        # Interaction tracking
β”‚       β”‚   └── config/             # Security, CORS configuration
β”‚       └── resources/
β”‚           └── application.properties
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ Project_Report_GROUP-129.pdf    ← Upload report here
β”‚   └── diagrams/
β”‚       β”œβ”€β”€ Use_Case_Diagram.png        ← Upload UCD image here
β”‚       └── Data_Flow_Diagram.png       ← Upload DFD image here
β”œβ”€β”€ pom.xml
└── README.md

πŸ“Š Performance

Operation Avg Response Time
Login / Register < 150ms
Review CRUD < 200ms
Search & Pagination < 180ms
AI Recommendations < 500ms
OTP Email Dispatch 2–3 seconds (Gmail SMTP)

Security validation confirmed: all unauthorized requests to protected endpoints return 401 Unauthorized.


πŸ‘₯ Team

GROUP-129 β€” VIT Bhopal University, B.Tech CSE, 2028

Name Roll Number Roles
Rishi Raj 24BCE10149 Frontend Lead
Abhilash Singh 24BCE10706 UI/UX and System Design
Arnab Kumar 24BCE11017 Backend Lead + Database + API
Brotodeep Pal 24BCE10477 Security + Deployment

Project Guide: Dr. Sasmita Padhy, School of Computer Science and Engineering, VIT Bhopal University
Program Chair: Dr. Vikas Panthi


πŸ“„ License

This project was developed as an academic submission for VIT Bhopal University. All rights reserved by the authors.

About

ReviewSaver is a full-stack web application that helps users discover, save, and get AI-powered recommendations for product reviews across categories like Movies, Electronics, Restaurants, Cafes, and Food. a little bit detailed.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors