ocean-e

byMahesh Savkar

Build a complete, modern, responsive AI-powered e-commerce website named **SmartCart AI** with a working frontend, backend, database, and AI recommendation engine. Do not build only a static UI. All major features must work end to end. ## 1. Technology Stack **Frontend:** React, Vite, JavaScript, React Router, Axios, Context API, Lucide React, responsive CSS. **Backend:** Java 21, Spring Boot 3.x, Maven, Spring Web, Spring Data JPA, Spring Security, JWT, MySQL, Flyway, Bean Validation, Swagger/OpenAPI, JUnit, Mockito. **AI service:** Python, FastAPI, LLM API, LangChain where useful, embeddings, semantic search, RAG, ChromaDB. **Deployment:** Docker, Docker Compose, environment variables, Git, README. Use compatible dependency versions. Never expose API keys or credentials in frontend code. ## 2. UI/UX Design Create a premium shopping experience with clean layouts, professional typography, attractive product cards, consistent colors, subtle shadows, smooth animations, responsive navigation, and mobile-friendly pages. Use Lucide icons, reusable components, loading skeletons, empty states, validation messages, and toast notifications. Avoid generic templates and excessive gradients. ## 3. Customer Features **Home page** - Navbar with logo, search, categories, login, and cart. - Hero section, featured categories, trending products, top-rated products, personalized recommendations, recently viewed products, and AI assistant. **Product listing** - Product grid, search, category and brand filters, price range, rating, stock availability, sorting, and server-side pagination. **Product details** - Images, description, specifications, price, stock, ratings, reviews, quantity selector, add to cart, buy now, similar products, and AI recommendation explanations. **AI shopping assistant** Allow users to ask: - Recommend a Java development laptop under ₹60,000. - Find running shoes under ₹3,000. - Compare two smartphones. - Find similar products. - Recommend products based on my preferences. Retrieve actual products from the catalog, enforce budget and availability constraints, explain recommendations, and display clickable product cards. Support follow-up questions and clearly handle empty results. Never invent products, prices, ratings, specifications, or stock. **Cart and checkout** - Add, update, and remove items. - Calculate subtotals, shipping, and totals. - Validate stock and prices on the backend. - Support guest carts and persistent customer carts. - Collect shipping addresses and create orders transactionally. - Provide order confirmation, order history, details, status, and eligible cancellations. - Use simulated payment or a payment sandbox. Never store card details. **Authentication and profile** - Registration, login, logout, profile management, BCrypt password hashing, JWT, protected routes, and CUSTOMER/ADMIN roles. - Customer preferences for budget, favorite categories, and brands. - Customers can access only their own profiles, carts, preferences, and orders. **Reviews** Allow authenticated users to submit, edit, and delete reviews. Enforce ownership and only label a review as a verified purchase when supported by an actual order. ## 4. AI Recommendation Engine Implement a real hybrid recommendation pipeline using: 1. Content-based filtering. 2. Embedding-based semantic retrieval. 3. User preferences and browsing history. 4. Popularity and rating signals. 5. Product diversity. 6. Evidence-based recommendation explanations. Use RAG to index product descriptions and specifications, generate embeddings, retrieve relevant products through ChromaDB, rank candidates, and generate grounded explanations. Apply deterministic filters for mandatory requirements such as budget and stock. Validate every recommended product against the real catalog. Do not claim collaborative filtering works without sufficient interaction data. ## 5. Spring Boot Backend Use layered architecture: controller, service, repository, entity, dto, mapper, security, config, exception. Create entities for User, Product, Category, Cart, CartItem, Order, OrderItem, Review, UserPreference, and ProductInteraction. Use appropriate JPA relationships, foreign keys, indexes, DTOs, validation, transactions, centralized exception handling, and database migrations. Preserve product name and price snapshots in order items. Implement these APIs: - Authentication: `/api/auth/register`, `/api/auth/login`, `/api/auth/logout`, `/api/auth/me` - Products: `/api/products`, `/api/products/{id}`, `/api/products/search`, `/api/products/{id}/similar` - Categories: `/api/categories` - Cart: `/api/cart`, `/api/cart/items`, `/api/cart/items/{itemId}` - Orders: `/api/orders`, `/api/orders/{id}`, `/api/orders/{id}/cancel` - Reviews: `/api/products/{id}/reviews`, `/api/reviews/{id}` - Preferences: `/api/users/me/preferences` - Recommendations: `/api/recommendations/personalized`, `/api/recommendations/query`, `/api/recommendations/similar` - Admin: `/api/admin/products`, `/api/admin/orders`, `/api/admin/analytics` Use correct HTTP methods, status codes, pagination, validation, authorization, and consistent error responses. Document endpoints using Swagger UI. ## 6. Python AI Service Create: ai-service/ app/main.py app/config.py app/api/ app/schemas/ app/services/ app/retrieval/ app/embeddings/ app/ranking/ app/llm/ tests/ requirements.txt .env.example Dockerfile Implement: - `GET /health` - `POST /ai/search` - `POST /ai/recommendations` - `POST /ai/chat` - `POST /ai/compare` Spring Boot remains the source of truth for products, prices, inventory, users, carts, and orders. FastAPI handles embeddings, semantic retrieval, LLM orchestration, and recommendation explanations. Secure internal communication. Keep API keys in environment variables. Add input validation, timeouts, rate limits, structured output validation, error handling, and a graceful fallback when the AI service is unavailable. ## 7. Admin Dashboard Create a protected dashboard with product CRUD, category management, inventory, order management, sales summaries, top-selling products, and recommendation analytics. Use actual database data and enforce ADMIN authorization on the backend. ## 8. Database and Sample Data Use MySQL and Flyway migrations. Seed at least 30 realistic products across laptops, smartphones, accessories, home appliances, and fitness. Include INR prices, specifications, categories, and suitable image URLs. Identify demo reviews and interactions clearly. Provide safe development-only admin initialization and a way to rebuild the vector index. ## 9. Testing and Security Implement unit tests, API integration tests, authentication tests, ownership and role checks, cart calculations, inventory safeguards, recommendation ranking tests, AI output validation, and AI failure tests. Mock paid LLM calls in automated tests. Protect secrets, validate inputs, configure CORS, enforce resource ownership, calculate prices on the backend, and avoid logging sensitive data. ## 10. Project Structure smartcart-ai/ - frontend/ - backend/ - ai-service/ - docker-compose.yml - .env.example - README.md Provide Dockerfiles for each service and Docker Compose for the application and MySQL. Include health checks, persistent storage, startup commands, port configuration, environment setup, Swagger instructions, and deployment guidance. Use service names instead of localhost for internal Docker communication. ## 11. Implementation Instructions Build incrementally: 1. Architecture, folder structure, database relationships, and request flows. 2. Spring Boot configuration, entities, migrations, and product APIs. 3. Authentication and security. 4. React pages and API integration. 5. Cart, checkout, orders, and inventory. 6. FastAPI, embeddings, ChromaDB, RAG, and recommendations. 7. AI chat integration. 8. Admin dashboard and analytics. 9. Testing, bug fixing, Docker, and documentation. After each phase, show changed files, provide complete working code, explain important logic in beginner-friendly language, run available builds and tests, fix errors, and provide exact verification commands. Inspect the existing workspace before changing files. Preserve working code. Do not generate disconnected files, leave core functionality as placeholders, or claim tests passed without running them. Start with Phase 1 and present the architecture, database relationships, folder structure, API contracts, and end-to-end flows. Then implement each phase in order. The final result must be a functional, secure, maintainable portfolio project suitable for Java Full Stack and GenAI interviews.

Home pageProduct listing
Home page

Comments (0)

No comments yet. Be the first!

Project Tasks

42 planning tasks
#1

Generate system requirement document

1m 7s0.05 cr used
Done
#2

Generate personas & user flows

0m 7s0.05 cr used
Done
#7

Create flow for Customer

0m 5sCredits in parent
Done
#8

Create flow for Admin

0m 6sCredits in parent
Done
#9

Home page

5m 1sCredits in subtasks
Done
#28

Fix Home page review findings: Mobile navbar overflows the viewport, clipping the cart… (+1 more)

0m 32s0.02 cr used
Done
#18

Home page / Smart Cart Navigation

0m 0s0.85 cr used
Done
#19

Home page / Home Hero

0m 58s0.85 cr used
Done
#20

Home page / Home Category Tiles

0m 54s0.85 cr used
Done
#21

Home page / Home Product Rails

0m 54s0.85 cr used
Done
#22

Home page / Home AIEntry

0m 53s0.85 cr used
Done
#23

Home page / Smart Cart Footer

0m 0s0.85 cr used
Done
#26

Fix Home page: Mobile navbar overflows the viewport, clipping the cart label and pushing the search and…

1m 45sCredits unavailable
Done
#27

Fix Home page: The personalized rail presents rating/stock-sorted catalog products as personalized…

1m 45sCredits unavailable
Done
#24

Smart Cart Navigation

0m 52sCredits in parent
Done
#25

Smart Cart Footer

0m 15sCredits in parent
Done
#10

Product listing

3m 39sCredits in subtasks
Done
#29

Product listing / Navigation

0m 1s0.85 cr used
Done
#30

Product listing / Header

0m 33s0.85 cr used
Done
#31

Product listing / Filter Rail

1m 11s0.85 cr used
Done
#32

Product listing / Grid

0m 48s0.85 cr used
Done
#33

Product listing / Footer

0m 0s0.85 cr used
Done
#11

Product details

4m 20sCredits in subtasks
Paused
#34

Product details / Smart Cart Navigation

0.85 cr needed
Paused
#35

Product details / Purchase

0.85 cr needed
Paused
#36

Product details / Specs

0.85 cr needed
Paused
#37

Product details / AIExplanation

0.85 cr needed
Paused
#38

Product details / Reviews

0.85 cr needed
Paused
#39

Product details / Similar

0.85 cr needed
Paused
#40

Product details / Smart Cart Footer

0.85 cr needed
Paused
#12

AI Assistant

4m 19sCredits in subtasks
Paused
#41

AI Assistant / AIAssistant Navigation

0.85 cr needed
Paused
#42

AI Assistant / AIAssistant Header

0.85 cr needed
Paused
#43

AI Assistant / AIAssistant Conversation

0.85 cr needed
Paused
#44

AI Assistant / AIAssistant Footer

0.85 cr needed
Paused
#13

Cart and checkout

4m 19sCredits in subtasks
Paused
#14

Orders

4m 19sCredits in subtasks
Paused
#15

Preferences

4m 19sCredits in subtasks
Paused
#16

Admin Dashboard

4m 19sCredits in subtasks
Paused
#17

Login

4m 19sCredits in subtasks
Paused
#5

Architecture

0.05 cr needed
Paused
#6

Workspace task plan

0.05 cr needed
Paused
Home page design preview
Home page: Open storefront
Login: Sign in as admin
Admin Dashboard: Create or edit products
Admin Dashboard: Manage categories and inventory
Admin Dashboard: Manage orders
Admin Dashboard: Review sales and analytics
Admin Dashboard: Retry failed analytics load
Home page design preview
Home page: Open storefront
Login: Sign in as admin
Admin Dashboard: Create or edit products
Admin Dashboard: Manage categories and inventory
Admin Dashboard: Manage orders
Admin Dashboard: Review sales and analytics
Admin Dashboard: Retry failed analytics load