A full-stack e-commerce website for Yashoda Engineers, a shop selling water motors, electric spray guns, chain saws, compressors, repair parts, hammers, and grinders. Built with React, Spring Boot, and Supabase — featuring an AI-powered product assistant chatbot.
- 🛍️ Product Catalog — Browse, search, and filter products by category
- 🛒 Shopping Cart & Checkout — Add to cart and place orders
- 👤 Auth System — Login/Signup with Supabase Authentication and JWT
- 📦 Order Management — View and track your orders
- 🔧 Repair Booking — Submit repair requests online
- 🛠️ Admin Dashboard — Manage products, categories, orders, and repair requests
- 🤖 AI Chatbot — RAG-powered product assistant using Google Gemini AI
The chatbot was built in 3 phases.
Phase 1 — Keyword Search Basic word matching. Customer types "water pump under 6000" and it finds pumps below that price.
Phase 2 — Gemini AI Understands natural language. Customer can type anything like "something for a 2-storey house" and the chatbot understands they need a booster pump. It also remembers the conversation history.
Phase 3 — RAG Vector Search Before asking Gemini, the chatbot converts the customer's question into a vector (3072 numbers representing the meaning) and searches the database for the 5 most similar products. Only those 5 are sent to Gemini — making it faster and smarter.
Example queries the chatbot understands
- "Water pump for my 2-storey house"
- "Something for cutting wood under Rs. 10000"
- "Compare your compressors"
- "I need to paint my wall"
Frontend
- React
- Axios
- React Router
Backend
- Spring Boot 3.2.5 with Java 21
- Spring Security and JWT
- Hibernate / JPA
- HikariCP connection pooling
Database
- Supabase (PostgreSQL)
- pgvector for AI vector similarity search
AI
- Google Gemini AI (gemini-2.5-flash) for natural language responses
- Gemini Embeddings (gemini-embedding-001) for 3072-dimension text vectors
Y_engineer/
├── y_eng_frontend/
│ ├── src/
│ │ ├── components/ # Reusable components (ChatWidget, Navbar, etc.)
│ │ ├── pages/ # Page components (Products, Cart, Dashboard, etc.)
│ │ ├── services/ # api.js
│ │ └── supabaseClient.js
│ └── package.json
│
└── y_eng_backend/
├── src/main/java/com/example/y_eng_backend/
│ ├── controller/ # REST controllers
│ ├── entity/ # JPA entities
│ ├── repository/ # Spring Data repositories
│ ├── service/ # Business logic and AI services
│ └── security/ # JWT and Spring Security
├── src/main/resources/
│ └── application.properties
└── pom.xml
- Java 21
- Node.js 18+
- Maven
- Supabase account
- Google AI Studio account for Gemini API key
git clone https://github.com/your-username/Y_engineer.git
cd Y_engineerGo into the backend folder.
cd y_eng_backendCreate a .env file inside y_eng_backend/ with the following:
DB_URL=jdbc:postgresql://YOUR_SUPABASE_POOLER_URL:6543/postgres?sslmode=require
DB_USERNAME=postgres.YOUR_PROJECT_REF
DB_PASSWORD=your_supabase_password
JWT_SECRET=YourSecretKeyHere
GEMINI_API_KEY=your_gemini_api_key
⚠️ Never commit the.envfile to GitHub. It is already listed in.gitignore.
Run the backend:
./mvnw spring-boot:runBackend starts at http://localhost:8080
cd y_eng_frontend
npm install
npm startFrontend starts at http://localhost:3000
Run these two commands in your Supabase SQL Editor:
CREATE EXTENSION IF NOT EXISTS vector;
ALTER TABLE public.products ADD COLUMN IF NOT EXISTS embedding vector(3072);This is a one-time setup step. After the backend is running, call this endpoint once using Postman or curl:
curl -X POST http://localhost:8080/api/chat/generate-embeddingsThis generates and saves AI embeddings for all products in the database. You only need to run this again if you add new products.
DB_URL — Supabase PostgreSQL connection URL. Use port 6543 for pgBouncer pooler.
DB_USERNAME — Supabase database username.
DB_PASSWORD — Supabase database password.
JWT_SECRET — Secret key used for signing JWT tokens.
GEMINI_API_KEY — Google Gemini API key from Google AI Studio.
Auth
POST /api/auth/login— Login and receive JWT tokenPOST /api/auth/register— Register a new user
Products
GET /api/products— Get all productsGET /api/products/{id}— Get a single productPOST /api/products— Create product (admin only)PUT /api/products/{id}— Update product (admin only)DELETE /api/products/{id}— Delete product (admin only)
Categories
GET /api/categories— Get all categories
Orders
POST /api/orders— Place a new orderGET /api/orders/my— Get current user's ordersGET /api/orders— Get all orders (admin only)
Repair Requests
POST /api/repair-requests— Submit a repair requestGET /api/repair-requests— Get all repair requests (admin only)
Chatbot
POST /api/chat/query— Send a message to the AI chatbotGET /api/chat/suggestions— Get suggested questionsPOST /api/chat/generate-embeddings— Generate embeddings for all products
profiles— User profiles with role (customer or admin)categories— Product categoriesproducts— Products with name, price, stock, description, and embedding vectororders— Customer ordersorder_items— Individual items in each ordercart_items— Shopping cart itemsrepair_requests— Repair service requests
- Backend → Railway or Render
- Frontend → Vercel
- Database → Already hosted on Supabase
Anjana E.H. Student ID: IT23754652 BSc (Hons) Information Technology — Year 3