Python Projects

Product Recommendation System Using Python Flask

Product Recommendation System Using Python Flask

Product Recommendation System Using Python Flask

The Product Recommendation System, presented as SmartShopper, is a medium-level web application designed to demonstrate how an online shopping platform can use customer activity to provide useful product suggestions. The system is built with Python and Flask and uses SQLite through SQLAlchemy for persistent data storage. Rather than functioning as a simple product listing page, the project connects user accounts, ratings, browsing history, product information, and a recommendation engine into one practical workflow.

Users can register, log in, browse products, search the catalog, submit ratings, and view recommendations. The recommendation logic combines product categories from browsing and rating activity with existing product ratings, keeping the system practical and easy to study.

Complete Advance AI Topics: Click Here
Real Time Projects on YouTube:- DecodeIT

Project Overview

Project NameProduct Recommendation System
Language UsedPython with Flask
DatabaseSQLite with SQLAlchemy
TypeWeb Application

Project Introduction

SmartShopper shows how personalization can be introduced into an e-commerce style application without complex enterprise architecture. Every registered customer can interact with products. Product visits are recorded, while submitted ratings update the product’s average score.

The recommendation service then uses this information to identify categories that appear important to the user. A product receives additional recommendation points when its category matches the user’s activity, while its existing average rating contributes to the overall score. Products already rated by the user are skipped from the recommendation list. The result is a simple, transparent recommendation workflow that can be explained clearly during a college project presentation.

Available Features

  • User Registration and Login: Customers can create accounts and securely sign in.
  • Password Hashing: Passwords are stored using Werkzeug password hashing instead of plain text.
  • Product Catalog: Users can browse products with category, description, price, and rating information.
  • Search and Filtering: Product names can be searched and categories can be filtered.
  • Product Details: Individual pages provide complete product information and community ratings.
  • User Ratings: Logged-in customers can submit a one-to-five rating and optional review.
  • Browsing History: Product visits are recorded for the user’s account.
  • Recommendation Engine: The system generates recommendations from browsing categories, rating activity, and product ratings.
  • Average Rating Calculation: Product ratings are recalculated when customer feedback is saved.
  • Dashboard: Users can see activity counts, recent browsing records, and personalized suggestions.

User Roles

The primary role in the current project is the Customer. A customer can create an account, log in, explore products, rate products, write reviews, and receive personalized recommendations. The application uses Flask-Login to protect customer-specific dashboard and profile pages. The supplied project does not introduce separate staff, manager, or administrator workflows, keeping the role model focused on the actual recommendation use case.

Technical Stack

Python is used as the main programming language, while Flask provides routing, application structure, templates, and request handling. SQLAlchemy manages the database models and relationships, with SQLite acting as the local database. Flask-Login handles authenticated sessions, while Werkzeug Security provides password hashing and verification. HTML and CSS create the responsive interface, with the design organized around a professional shopping dashboard.

Download complete source code

Screenshot

Product Recommendation System Using Python Flask
Product Recommendation System Using Python Flask
Product Recommendation System Using Python Flask
Product Recommendation System Using Python Flask
Product Recommendation System Using Python Flask
Product Recommendation System Using Python Flask

Project Modules

1. Authentication Module

The authentication module provides registration, login, logout, and session protection. During registration, the application validates the required information and checks whether the email address is already registered. Passwords are hashed before being stored. Login verifies the supplied password against the stored hash and starts an authenticated session.

2. Product Catalog Module

The catalog contains product name, category, description, price, visual icon, and rating information. Users can search by product name or select a category filter. Product cards provide quick access to individual detail pages, creating a natural browsing workflow for the recommendation system.

3. Rating and Review Module

Authenticated customers can submit a score from one to five and optionally write a review. If the customer has already rated a product, the existing rating is updated rather than creating another duplicate record. After a rating is saved, the system calculates the product’s average score using the stored rating records.

4. Browsing History Module

When a logged-in customer opens a product for the first time, the visit is stored in the browsing history table. This provides a simple activity signal for personalization. The dashboard displays recent activity so the user can understand which products have contributed to the recommendation context.

5. Recommendation Module

The recommendation service calculates a score for available products. Categories connected to a user’s ratings receive stronger preference, while browsing activity adds additional category signals. The product’s existing rating is also included in the score. Rated products are excluded, and the highest-scoring remaining products are displayed as recommendations. This approach demonstrates the core idea of personalization without hiding the logic behind a complicated model.

Professional Dashboard

The interface uses a shopping-focused visual identity rather than a generic CRUD layout. A dark sidebar provides dashboard, product, profile, and logout navigation, while the top bar includes search and user identity. The dashboard presents activity statistics, recommendations, and recent browsing records. Product pages use clean cards, ratings, and focused actions, with responsive layouts for smaller screens.

How the System Works

The workflow starts with registration or login. The customer explores the catalog and opens product details, with visits recorded in browsing history. When a rating is submitted, the score and review are stored and the product average is updated. The dashboard recommendation service reads these signals, calculates product scores, excludes already-rated products, and displays the strongest remaining matches.

Installation and Setup

Open the project folder in Visual Studio Code or another Python IDE. Create a virtual environment with python -m venv env and activate it using env\Scripts\activate on Windows. Install the dependencies with pip install -r requirements.txt. Start the application using python run.py. Flask creates the SQLite database and sample product records when the application starts for the first time. Finally, open http://127.0.0.1:5000/ in the browser.

Usage

New customers create an account with their name, email, and password. After login, the dashboard shows ratings, product views, and recommendations. The Products section supports search and filtering. Opening a product records activity, while the detail page allows an authenticated customer to submit a rating and review. The dashboard then displays recommendations influenced by that activity.

Frequently Asked Questions

What is the main purpose of this project?

The main purpose is to demonstrate a personalized product recommendation workflow using Flask, SQLite, user ratings, and browsing history.

Does the project use machine learning?

The supplied implementation uses a transparent recommendation scoring approach rather than a trained machine learning model. This keeps the college project understandable while providing a clear foundation for future recommendation techniques.

Which database is used?

SQLite is used through SQLAlchemy. The database is created locally when the application starts.

How are recommendations generated?

Recommendations combine category preferences from ratings and browsing activity with product rating scores. Products already rated by the customer are excluded.

Can users submit reviews?

Yes. An authenticated customer can submit a one-to-five score and an optional written review for a product.

Is the interface responsive?

Yes. The CSS includes responsive layouts so the sidebar, cards, forms, and product pages adapt to smaller screens.

Future Scope

  • Implement collaborative filtering using customer-product interaction data.
  • Add a machine learning recommendation model after collecting a larger interaction dataset.
  • Introduce product images uploaded through a controlled administration workflow.
  • Add product comparison and wishlist functionality.
  • Provide recommendation explanations showing why a product was suggested.
  • Deploy the application with a production database and hosting configuration.

Conclusion

The Product Recommendation System using Python Flask is a practical medium-level college project demonstrating personalization within a shopping workflow. It combines authentication, product browsing, search, ratings, reviews, browsing history, database relationships, and recommendation scoring. Its modular Flask architecture remains understandable for students while providing a foundation for collaborative filtering or machine learning in the future.

Keywords:

Product Recommendation System

Product Recommendation System – Google Search

product recommendation system using machine learning

product recommendation system project

product recommendation system design

product recommendation system dataset

product recommendation system project with source code

product recommendation system github

product recommendation system for e commerce

product recommendation system research paper

product recommendation system project github

Source Code Available

Interested in This Project?

Get the complete source code for this project at a very affordable price — perfect for your portfolio, college submission, or learning. Message us on WhatsApp and we'll get back to you instantly!

Full source code included Step-by-step setup guide Instant delivery on WhatsApp Instant reply on WhatsApp
Chat on WhatsApp

We usually reply within a few minutes

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us