How preethi-karuna06/thoori-cosmetics works
Thoori is a skincare e-commerce platform whose customer journey runs from browsing products and completing a skin quiz to personalized recommendations, cart/checkout, payment, order tracking, and reviews. A parallel AI-chat workflow retrieves product candidates and generates explanations; admins manage products, orders, users, reviews, and analytics. The graph includes the API, domain controllers, and persistence/integration layer. Several UI and backend subsystems are documented but unsampled, so their links are shown only where the README or source index supports them.
Main entry points: server.js Express API · api.js API client · App.jsx Web app routes · Product.js Product model
Components 34
Customer web app
- Web app routes
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Cart state
frontend/src/context/CartContext.jsx - Product browsing
frontend/src/pages/HomePage.jsx - Product card
frontend/src/components/product/ProductCard.jsx - Shop and detail
frontend/src/pages/shop/ProductDetailPage.jsx - Skin quiz
frontend/src/pages/QuizPage.jsx - Recommendations
frontend/src/pages/RecommendationsPage.jsx - Checkout and orders
frontend/src/pages/shop/CheckoutPage.jsx - Chat experience
frontend/src/components/chat/ChatBot.jsx - Admin console
frontend/src/pages/admin
API and identity
- API client
frontend/src/services/api.js - Express API
backend/server.js - Authentication
backend/controllers/auth.controller.js - JWT access control
backend/middleware/auth.middleware.js
Commerce domains
- Product catalog
backend/controllers/product.controller.js - Cart and wishlist
backend/controllers/cart.controller.js - Order and payment
backend/controllers/order.controller.js - Reviews
backend/controllers/review.controller.js - Admin operations
backend/controllers/admin.controller.js
Skincare AI
- Quiz scoring
backend/controllers/quiz.controller.js - RAG chatbot
backend/controllers/chat.controller.js - Vector retrieval
backend/services/vector.service.js
Persistence and integrations
- MongoDB models
backend/models/index.js - Product model
backend/models/Product.js - Order model
backend/models/Order.js - User model
backend/models/User.js - Qdrant
- Gemini embeddings
- Chat LLM
- Razorpay
- Cloudinary
Other components
- Customer
- Administrator
Connections 48
- Customer → Web app routes: uses
- Administrator → Web app routes: uses
- Web app routes → Product browsing: routes to
frontend/src/App.jsx - Web app routes → Shop and detail: routes to
frontend/src/App.jsx - Web app routes → Skin quiz: routes to
frontend/src/App.jsx - Web app routes → Checkout and orders: routes to
frontend/src/App.jsx - Web app routes → Admin console: routes to
frontend/src/App.jsx - Web app routes → Auth state: checks access
frontend/src/App.jsx - Product browsing → Product card: renders
frontend/src/pages/HomePage.jsx - Product browsing → API client: requests catalog
frontend/src/pages/HomePage.jsx - Shop and detail → API client: requests product
frontend/src/pages/shop/ProductDetailPage.jsx - Shop and detail → Cart state: updates cart
frontend/src/pages/shop/ProductDetailPage.jsx - Auth state → API client: authenticates via
frontend/src/context/AuthContext.jsx - Cart state → API client: requests cart
frontend/src/context/CartContext.jsx - Skin quiz → API client: submits quiz
- Recommendations → API client: fetches results
- Checkout and orders → API client: submits order
- Chat experience → API client: sends messages
- Admin console → API client: requests admin data
frontend/src/pages/admin/AdminReviews.jsx - API client → Express API: calls API
- Express API → Authentication: routes auth
backend/server.js - Express API → Product catalog: routes products
backend/server.js - Express API → Cart and wishlist: routes cart
backend/server.js - Express API → Order and payment: routes orders
backend/server.js - Express API → Quiz scoring: routes quiz
backend/server.js - Express API → Reviews: routes reviews
backend/server.js - Express API → RAG chatbot: routes chat
backend/server.js - Express API → Admin operations: routes admin
backend/server.js - Product catalog → Product model: reads and updates
backend/controllers/product.controller.js - Product catalog → Vector retrieval: indexes products
backend/controllers/product.controller.js - Cart and wishlist → MongoDB models: reads and writes
backend/controllers/cart.controller.js - Cart and wishlist → Product model: reads product
backend/controllers/cart.controller.js - Order and payment → Order model: creates and updates
backend/controllers/order.controller.js - Order and payment → MongoDB models: reads and clears cart
backend/controllers/order.controller.js - Order and payment → Product model: adjusts stock
backend/controllers/order.controller.js - Order and payment → Razorpay: creates payment
backend/controllers/order.controller.js - Reviews → Order model: checks delivery
backend/controllers/review.controller.js - Reviews → Product model: updates rating
backend/controllers/review.controller.js - Reviews → MongoDB models: stores reviews
backend/controllers/review.controller.js - Admin operations → User model: manages users
backend/controllers/admin.controller.js - Admin operations → Product model: manages catalog
backend/controllers/admin.controller.js - Admin operations → Order model: reads orders
backend/controllers/admin.controller.js - Quiz scoring → Product model: scores products
backend/controllers/quiz.controller.js - Quiz scoring → User model: reads profile
backend/controllers/quiz.controller.js - Quiz scoring → MongoDB models: stores results
backend/models/index.js - RAG chatbot → Vector retrieval: searches products
backend/controllers/chat.controller.js - RAG chatbot → Product model: loads candidates
backend/controllers/chat.controller.js - RAG chatbot → MongoDB models: loads profile and history
backend/controllers/chat.controller.js