How lonecruisader/ingredient-analyser works
Project type and purpose
• This is a full-stack web application called “Sephora Ingredient Analyzer.”
• Purpose: Let users search Sephora.com products, scrape ingredient lists, classify ingredients (natural vs. synthetic) using an LLM, calculate percentages and environmental impact, and display results in a responsive React UI.
File structure
• Top-level directories:
• frontend/ (React + TypeScript UI)
• backend/ (Express + TypeScript API + scraper + LLM integration)
• api/ (legacy or alternative JS endpoints)
• tasks/ and .cursor/ (documentation and rule files)
• frontend/src/components: UI building blocks (SearchBar, IngredientAnalysis)
• frontend/src/services/api.ts: HTTP client for backend calls
• backend/src/routes/search.ts: API endpoint for product search & analysis
• backend/src/services: cache.ts, llm.ts, scraper.ts — business logic modules
• backend/src/utils: classificationValidator, percentageCalculator, environmentalImpact, ingredientFormatter — helper functions
• Configuration and build files: tsconfig.json, ESLint, Prettier, Vite, Jest configs, Vercel deployment file.
README for additional insights
• Tech stack: React, Vite, Express, Axios, Cheerio, LLM integration, Jest, Supertest
• Key features described (search, breakdown, environmental impact)
• Development workflow (dev servers on ports, environment variables for backend).