π Full-Stack Product Recommendation Platform - Six recommendation methods written from scratch, wired into a working e-commerce store
SmartRecommender is a full-stack e-commerce platform that delivers personalized product recommendations by combining collaborative filtering, content analysis, association mining, fuzzy logic, sentiment analysis and probabilistic modelling. Every recommendation method is implemented from the ground up on top of NumPy, pandas and scikit-learn rather than pulled in from a ready-made recommender library, which makes the repository as much a study of the algorithms as it is a shop.
The system pairs a Django REST Framework API with a React 18 storefront and a PostgreSQL 16 database, all reproducible through Docker. It was developed as an engineering thesis project, so alongside the application you will find the full academic apparatus: per-method algorithm write-ups, UML diagrams and entity-relationship documentation.
- π€ Collaborative Filtering β user-based and item-based similarity matrices that recommend products based on what comparable customers bought.
- π·οΈ Content-Based Filtering β matches products by their own attributes, categories and tags against what a user has already liked.
- π Association Rules β an Apriori implementation that surfaces "frequently bought together" sets from real order history.
- π Fuzzy Search β typo-tolerant, partial-match product search backed by a dedicated fuzzy logic engine.
- π¬ Sentiment Analysis β analyses customer reviews with TextBlob/NLTK so positively received products can be discovered and ranked.
- π² Probabilistic Methods β Markov chains for next-purchase prediction and Bayesian insights over user behaviour.
- π Admin Analytics Dashboard β sales forecasting, product demand prediction, churn risk assessment, RFM purchase-pattern analysis and seasonal trends.
- π§ͺ Algorithm Debug Endpoints β every recommendation family exposes a debug view so its intermediate output can be inspected instead of guessed at.
- ποΈ Complete Storefront β catalog browsing, product detail pages, favourites, cart, orders, complaints and a client panel.
- π JWT Authentication β token-based auth with role separation between clients and administrators.
| Storefront landing page | Product catalog |
|---|---|
![]() |
![]() |
The repository carries a full set of modelling artifacts produced alongside the implementation.
.diagrams/β UML diagrams grouped per recommendation method:association_rules,collaborative_filtering,content_based_filtering,fuzzy_search,probabilistic_methodsandsentiment_analysis. Each folder holds Use Case, Class, Activity, Sequence, Component or State diagrams (depending on the method) as both editable.umlsources and rendered.pngexports..database/entity-relationship-diagram/β entity-relationship diagrams for the schema (erd.png,appErd.png,methodsErd.png) together with theerd.pgerdproject file anderd.sql..database/βbackup.sql,RELATIONSHIPS_IN_BASE.mdandtree_database.pngdocumenting the relational model..methods/β a written specification per algorithm explaining how each method is computed..docs/β the thesis text, LaTeX sources and presentation material.
| Method | What it does | Implementation |
|---|---|---|
| Collaborative Filtering | Recommends what similar users purchased (user-based and item-based) | backend/home/recommendation_views.py, custom_recommendation_engine.py |
| Content-Based Filtering | Recommends products with attributes similar to previously liked items | backend/home/recommendation_views.py |
| Association Rules | Apriori mining of frequently bought together product sets | backend/home/association_views.py |
| Fuzzy Search | Typo-tolerant search and fuzzy-logic ranking | backend/home/fuzzy_logic_engine.py, fuzzy_debug_view.py |
| Sentiment Analysis | Review sentiment scoring and sentiment-driven discovery | backend/home/sentiment_views.py |
| Probabilistic Methods | Markov next-purchase prediction and Bayesian insights | backend/home/probabilistic_views.py, probabilistic_debug_view.py |
Predictive analytics built on top of these methods β sales forecasting, demand prediction, churn risk and purchase patterns β live in backend/home/analytics.py, analytics_views.py and seasonal_views.py.
- React 18 with React Router 6 for routing
- CRACO build tooling on top of
react-scripts5 - SCSS / Sass and Tailwind CSS for styling
- Chart.js, react-chartjs-2 and Recharts for analytics visualisations
- Axios for API calls, jwt-decode for token handling
- Formik + Yup for forms and validation
- Framer Motion, React Spring, react-slick, react-toastify for interaction and UI polish
- Lucide, React Icons, React Feather icon sets
- Django 5.1 with Django REST Framework 3.15
- django-cors-headers, django-environ for configuration
- psycopg2-binary as the PostgreSQL driver
- NumPy, pandas, scikit-learn for the recommendation computations
- TextBlob and NLTK for sentiment processing
- Pillow for product image handling
- tqdm for seeder progress output
- PostgreSQL 16 with a healthchecked container and persistent volume
- Docker Compose orchestrating
db,backendandfrontendservices - GitHub Pages for the static preview deployment (
gh-pages)
- Docker Desktop installed, with hardware virtualization enabled (Intel VT-x or AMD-V) β for the Docker path
- Python 3.x, Node.js and a local PostgreSQL 16 instance β for the manual path
- Git
git clone https://github.com/dawidolko/SmartRecommender-Project-Django-React
cd SmartRecommender-Project-Django-ReactCreate a .env file (see backend/.env.example for the template):
# Security Key
SECRET_KEY=django-insecure-default-key
# Debug Mode
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database Settings
DB_NAME=product_recommendation
DB_USER=postgres
DB_PASSWORD=admin
DB_HOST=db # use "localhost" for the manual setup
DB_PORT=5432docker compose -f .tools/docker/docker-compose.yml up --buildOn first start the backend container waits for PostgreSQL, then runs migrations, creates the recommendation_cache_table cache table, seeds the database and verifies media files before launching the development server.
Once it is up:
- Frontend (React) β http://localhost:3000
- Backend (Django) β http://localhost:8000
- Database (PostgreSQL) β port
5432
Docker management commands
# Run in background
docker compose -f .tools/docker/docker-compose.yml up -d --build
# Stop containers
docker compose -f .tools/docker/docker-compose.yml down
# View logs
docker compose -f .tools/docker/docker-compose.yml logs -f
# Enter the backend container
docker exec -it SmartRecommender-Django-BACKEND bash
# Enter the database
docker exec -it SmartRecommender-PostgreSQL-DB psql -U postgres -d product_recommendationReady-to-use startup scripts ship for both platforms.
# Windows β backend
cd backend
start.bat
# Windows β frontend (new terminal)
cd frontend
start.bat# Linux/macOS β backend
cd backend
chmod +x start.sh
./start.sh
# Linux/macOS β frontend (new terminal)
cd frontend
chmod +x start.sh
./start.shBackend (Django)
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure your PostgreSQL connection in .env (see .env.example)
python manage.py migrate
python manage.py seed
python manage.py runserverThe backend will be available at http://127.0.0.1:8000/.
Frontend (React)
cd frontend
npm install
npm startThe frontend will be available at http://localhost:3000/.
SmartRecommender-Project-Django-React/
βββ .database/ # Database resources
β βββ entity-relationship-diagram/ # ERD diagrams (erd, appErd, methodsErd)
β βββ backup.sql # Database backup
β βββ RELATIONSHIPS_IN_BASE.md # Relationship documentation
β βββ tree_database.png # Visual DB structure
β
βββ .diagrams/ # UML diagrams per recommendation method
β βββ association_rules/ # UseCase / Class / Activity / Sequence / Component
β βββ collaborative_filtering/
β βββ content_based_filtering/
β βββ fuzzy_search/
β βββ probabilistic_methods/
β βββ sentiment_analysis/
β
βββ .docs/ # Thesis text, LaTeX sources, presentation
βββ .methods/ # Written specification per algorithm
βββ .github/ # GitHub configuration
β
βββ .tools/docker/ # Docker configuration
β βββ docker-compose.yml
β βββ Dockerfile.backend
β βββ Dockerfile.frontend
β
βββ backend/ # Django backend
β βββ core/ # Project settings, URLs, ASGI/WSGI
β βββ home/ # Main application
β β βββ models.py # Domain model
β β βββ urls.py # Full REST API map
β β βββ views.py # Catalog, cart, orders, users, admin stats
β β βββ recommendation_views.py # Collaborative & content-based endpoints
β β βββ association_views.py # Apriori association rules
β β βββ sentiment_views.py # Sentiment & fuzzy search endpoints
β β βββ probabilistic_views.py # Markov / Bayesian endpoints
β β βββ analytics_views.py # Forecasting, churn, purchase patterns
β β βββ seasonal_views.py # Seasonal trend analysis
β β βββ custom_recommendation_engine.py
β β βββ fuzzy_logic_engine.py
β β βββ management/ # Custom commands (seed)
β βββ media/ # Uploaded product images
β βββ static/ # Static files
β βββ manage.py
β βββ requirements.txt
β βββ start.sh / start.bat
β
βββ frontend/ # React frontend
β βββ public/
β βββ src/
β β βββ components/ # Reusable components (admin, client, shop)
β β βββ pages/ # Home, Shop, Cart, Favorites, panels, ...
β β βββ context/ # React context providers
β β βββ config/ # API configuration
β β βββ utils/ # Helpers
β β βββ App.js
β βββ craco.config.js
β βββ package.json
β βββ start.sh / start.bat
β
βββ docs/ # README assets
β βββ diagrams/ # app-layer.svg, architecture.svg
β βββ screenshots/ # home.webp, catalog.webp
β
βββ images/ # Team photos
βββ CONTRIBUTING.md
βββ SECURITY.md
βββ LICENSE
βββ README.md
The REST API is documented in detail at the top of backend/home/urls.py. It is organised into ten groups:
| Group | Examples |
|---|---|
| Authentication & users | /api/login/, /api/register/, /api/token/refresh/, /api/me/, /api/users/ |
| Product catalog | /api/products/, /api/products/search/, /api/categories/, /api/tags/ |
| Cart & orders | /cart/preview/, /cart/update/<id>/, /api/orders/ |
| Customer service | /api/complaints/ |
| Recommendations | /api/recommended-products/, /api/process-recommendations/, /api/interaction/ |
| Association rules | /api/frequently-bought-together/, /api/association-rules/ |
| Probabilistic analytics | /api/markov-recommendations/, /api/bayesian-insights/ |
| Predictive analytics | /api/sales-forecast/, /api/product-demand/, /api/risk-dashboard/ |
| Sentiment & fuzzy | /api/sentiment-search/, /api/fuzzy-search/ |
| Admin dashboards | /api/admin-stats/, /api/admin-dashboard-stats/, /api/client-stats/ |
Access control follows three levels: AllowAny for public browsing, IsAuthenticated for cart, orders and reviews, and IsAdminUser for user management, product CRUD and analytics.
The system uses PostgreSQL with a schema of interconnected tables covering:
- Core entities β Users, Products, Categories, Tags
- E-commerce β Orders, Cart, Complaints, Reviews
- Recommendation data β similarity matrices, user interactions, association rules
- Analytics β sentiment summaries, purchase patterns, risk assessment
Full documentation, the ERD set and a database backup live in the .database/ directory.
π Preview version: project.dawidolko.pl
β οΈ Note: This is a static preview hosted on GitHub Pages. Only the homepage and basic navigation work. Features requiring database connectivity β shopping cart, user accounts, recommendations, admin dashboards β are not functional in this demo.π‘ For the full experience: follow the installation guide above to run the complete application with all features enabled.
![]() Dawid Olko Creator |
![]() Dr. Piotr Grochowalski Supervisor |
![]() Piotr SmoΕa Creator |
This project was developed as part of an engineering thesis.
Contributions are welcome β see CONTRIBUTING.md for guidelines and SECURITY.md for the vulnerability disclosure policy.
This project is licensed under the Apache License 2.0.
Created by Dawid Olko
- Website β dawidolko.pl
- LinkedIn β @dawidolko




