How segretoo/ingredientfit works
IngredientFit is an AI-assisted serum curation service: a user describes a skin concern, selects a key ingredient and budget, and receives a transparent, formula-scored TOP 3. The chat route classifies concerns and applies safety and skin-profile adjustments; the recommendation route computes scores and uses AI only to explain them. Separate product discovery, skin diagnosis, accounts, favorites, history, and mobile experiences support the main flow. Evidence is limited to the excerpts, SOURCE INDEX references, and README; unsampled subsystem links are included only where documented.
Main entry points: ChatWindow.tsx Chat interface · chat/route.ts Concern classification · recommend/route.ts TOP 3 endpoint · Header.tsx Shared navigation
Components 24
User experiences
- Web pages
app/page.tsx - Mobile pages
app/mobile/page.tsx - Chat interface
components/chat/ChatWindow.tsx - Shared navigation
components/Header.tsx
Recommendation engine
- Concern classification
app/api/chat/route.ts - Concern analyzer
lib/gemini/analyzer.ts - Ingredient categories
lib/ingredients.ts - Safety adjustment
lib/safety.ts - TOP 3 endpoint
app/api/recommend/route.ts - Budget parsing
lib/budgets.ts - Score calculator
lib/scoring/calculator.ts - Result explanations
lib/gemini/reasoning.ts
Accounts and profile
- Skin preference rules
lib/skinProfile.ts - Skin diagnosis
components/SkinProfileContent.tsx - Local state
lib/useLocalStorage.ts - Favorites
lib/favorites.ts - Account actions
app/actions/favorites.ts - Recommendation history
app/actions/recommendationHistory.ts - Session lookup
lib/auth/getUser.ts - Supabase services
lib/supabase/server.ts - Skin profile actions
app/actions/skinProfile.ts
Product discovery
- Product catalog
lib/products.ts - Product browsing
components/ProductsContent.tsx
Other components
- Visitor
Connections 28
- Visitor → Web pages: browses
app/page.tsx - Visitor → Mobile pages: browses
app/mobile/page.tsx - Web pages → Chat interface: opens chat
- Mobile pages → Chat interface: opens chat
- Chat interface → Concern classification: POSTs concern
- Concern classification → Concern analyzer: classifies
app/api/chat/route.ts - Concern classification → Ingredient categories: gets category
app/api/chat/route.ts - Concern classification → Safety adjustment: adjusts safely
app/api/chat/route.ts - Concern classification → Skin preference rules: applies profile
app/api/chat/route.ts - Chat interface → TOP 3 endpoint: POSTs choices
- TOP 3 endpoint → Ingredient categories: gets ingredient
app/api/recommend/route.ts - TOP 3 endpoint → Budget parsing: validates budget
app/api/recommend/route.ts - TOP 3 endpoint → Score calculator: calculates TOP 3
app/api/recommend/route.ts - Score calculator → Product catalog: scores catalog
- TOP 3 endpoint → Result explanations: adds explanations
app/api/recommend/route.ts - Chat interface → Recommendation history: saves results
components/chat/ChatWindow.tsx - Visitor → Product browsing: searches products
- Visitor → Skin diagnosis: takes diagnosis
- Chat interface → Local state: stores chat state
components/chat/ChatWindow.tsx - Shared navigation → Session lookup: receives user
components/Header.tsx - Session lookup → Supabase services: reads session
lib/auth/getUser.ts - Shared navigation → Account actions: syncs favorites
components/Header.tsx - Shared navigation → Skin profile actions: syncs profile
- Shared navigation → Local state: syncs local data
- Visitor → Favorites: manages favorites
- Visitor → Recommendation history: views history
- Visitor → Account actions: manages account
- Skin profile actions → Supabase services: persists profile