Advanced AI-powered beauty intelligence platform featuring adaptive category-aware analysis, parallel processing capabilities, and real-time multi-platform data aggregation. Includes influencer insights from YouTube and Instagram with cutting-edge machine learning technology.
- 10 Iconic Beauty Products: Curated selection of industry-leading products across categories (skincare, makeup, fragrance, tools)
- Multi-Platform Data Aggregation: Real-time pricing and availability from Amazon, Sephora, Ulta, Walmart, Nordstrom, and brand websites
- AI-Powered Review Intelligence: Automated sentiment analysis and summarization from Reddit discussions and YouTube content
- Premium User Experience: Luxury beauty aesthetic with smooth animations and responsive design
- Manual Data Refresh: Admin-controlled ingestion system (no automated scraping)
- Chanel NΒ°5 Eau de Parfum - The world's most iconic fragrance
- NARS Blush "Orgasm" - Cult-favorite peachy-pink blush with golden shimmer
- MAC Retro Matte Lipstick "Ruby Woo" - Classic blue-red matte lipstick
- EstΓ©e Lauder Advanced Night Repair Serum - Revolutionary anti-aging serum
- SK-II Facial Treatment Essence - Luxury essence with Piteraβ’ technology
- La Mer CrΓ¨me de la Mer - Ultra-luxurious moisturizer with Miracle Brothβ’
- Bioderma Sensibio H2O Micellar Water - Gentle cleansing for sensitive skin
- Maybelline Great Lash Mascara - Iconic drugstore mascara with pink and green tube
- Beautyblender Original Sponge - Revolutionary makeup application tool
- Shu Uemura Eyelash Curler - Professional-grade eyelash curler
- Next.js 14 with App Router and TypeScript
- TailwindCSS with custom beauty-focused color palette
- shadcn/ui component library for consistent design system
- Framer Motion for premium animations and micro-interactions
- Lucide React for iconography
- SWR for intelligent data fetching and caching
- Python 3.11+ with modern async/await patterns
- FastAPI for high-performance API endpoints
- LlamaIndex for AI orchestration and data processing
- OpenRouter API (GPT-4o-mini-search-preview model)
- PostgreSQL with advanced JSON support (JSONB)
- Pydantic v2 for data validation and serialization
- psycopg2 for database connectivity
- PostgreSQL 17 with UUID primary keys and JSONB storage
- Docker Compose for containerized development
- Structured JSON logging with request/response tracking
- Health check endpoints for monitoring
- CORS configuration for local development
beauty-aggregator/
βββ app/
β βββ web/ # Next.js Frontend
β β βββ components/ # React components
β β β βββ ui/ # shadcn/ui components
β β β βββ NavBar.tsx # Navigation with glassmorphism
β β β βββ ProductCard.tsx # Animated product cards
β β β βββ SourcesDrawer.tsx # Platform data drawer
β β βββ lib/ # Utilities and configuration
β β β βββ api.ts # API client functions
β β β βββ config.ts # Environment configuration
β β β βββ utils.ts # Utility functions
β β βββ app/ # App Router pages
β β β βββ page.tsx # Home page with product grid
β β β βββ products/[slug]/ # Dynamic product pages
β β β βββ admin/ # Admin dashboard
β β βββ public/
β β βββ images/ # Local product images
β βββ ingestion/ # FastAPI Backend
β βββ main.py # FastAPI application
β βββ models.py # Pydantic data models
β βββ db.py # Database operations
β βββ llama.py # LlamaIndex integration
β βββ app_logging.py # Structured logging
β βββ json_repair.py # JSON validation/repair
β βββ requirements.txt # Python dependencies
βββ db/
β βββ schema.sql # PostgreSQL database schema
βββ scripts/
β βββ seed_products.json # Initial product data
β βββ seed_products.ts # Database seeding script
β βββ package.json # Node.js dependencies
βββ docker-compose.yml # Container orchestration
βββ README.md # This file
- Docker Desktop - Install from docker.com
- OpenRouter API Key - Get from openrouter.ai
Windows Users:
start-app.batmacOS/Linux Users:
chmod +x *.sh
./start-app.shThe startup script will:
- β Check Docker installation
- β Set up environment configuration
- β Build and start all services
- β Initialize database with schema and seed data
- β Show application status when ready
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
# View logs
./logs.sh # (Linux/macOS)
logs.bat # (Windows)
# Stop application
./stop-app.sh # (Linux/macOS)
stop-app.bat # (Windows)
# Restart application
./restart-app.sh # (Linux/macOS)
restart-app.bat # (Windows)
# Test database connection
./test-db-connection.sh # (Linux/macOS)
test-db-connection.bat # (Windows)-
Clone and Setup
git clone <repository> cd beauty-aggregator cp env.example .env # Edit .env and add your OPENROUTER_API_KEY
-
Start Services
docker-compose up --build
-
Initialize Database
# In a new terminal ./scripts/docker-init.sh -
Access Applications
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
# Ensure PostgreSQL is running
sudo service postgresql start # Linux
brew services start postgresql # macOS
# Create database and user
psql -U postgres -c "CREATE DATABASE beauty_agg;"
psql -U postgres -c "CREATE USER beauty_user WITH PASSWORD 'beauty123';"
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE beauty_agg TO beauty_user;"
# Apply schema
psql -U postgres -d beauty_agg -f db/schema.sql
# Grant table permissions
psql -U postgres -d beauty_agg -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO beauty_user;"cd app/ingestion
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export DATABASE_URL="postgresql://beauty_user:beauty123@localhost:5432/beauty_agg"
export OPENROUTER_API_KEY="your-api-key-here"
# Start FastAPI server
python -m uvicorn main:app --reload --port 8000cd app/web
# Install dependencies
npm install
# Start Next.js development server
npm run devcd scripts
npm install
# Run seeding script
node seed_products.ts/* Primary Colors */
--ivory: #FFFEF7 /* Main background */
--charcoal: #2D2D2A /* Text and borders */
/* Accent Colors */
--lilac: #E9D7FE /* Highlights and interactive elements */
--blush: #FDE1E1 /* Subtle accents and hover states */
/* Semantic Colors */
--success: #10B981 /* Positive actions */
--warning: #F59E0B /* Caution states */
--error: #EF4444 /* Error states */- Headings: System font stack with optimized weights
- Body: Inter font family for readability
- Hierarchy: Consistent scale from text-sm to text-4xl
- Cards: Elevated with subtle shadows and hover animations
- Buttons: Gradient backgrounds with spring animations
- Tabs: Smooth underline transitions
- Modals: Backdrop blur with focus management
- Forms: Consistent spacing and validation states
Lists all beauty products with basic information.
Response:
[
{
"id": "uuid",
"slug": "chanel-no5-eau-de-parfum",
"name": "Chanel NΒ°5 Eau de Parfum",
"brand": "Chanel",
"category": "Fragrance",
"hero_image_url": "/images/chanel-no5.jpg",
"description": "The world's most famous fragrance...",
"average_rating": 4.5,
"price_range": {
"min": 108.00,
"max": 150.00
},
"last_updated": "2024-01-15T10:30:00Z"
}
]Retrieves detailed product information including platform data and AI analysis.
Response:
{
"id": "uuid",
"slug": "chanel-no5-eau-de-parfum",
"name": "Chanel NΒ°5 Eau de Parfum",
"brand": "Chanel",
"category": "Fragrance",
"description": "The world's most famous fragrance...",
"platforms": [
{
"name": "Sephora",
"price": 132.00,
"rating": 4.6,
"review_count": 1247,
"availability": "in_stock",
"url": "https://sephora.com/..."
}
],
"summary": {
"verdict": "A timeless classic that continues to captivate...",
"aspect_scores": {
"longevity": 0.85,
"sillage": 0.78,
"value": 0.65
}
},
"last_updated": "2024-01-15T10:30:00Z"
}Triggers AI-powered data ingestion for a specific product.
Response:
{
"success": true,
"message": "Product data ingested successfully",
"product_id": "uuid",
"platforms_updated": 5,
"processing_time": 12.3
}Initiates data refresh for all products (sequential processing).
Health check endpoint for monitoring.
- Model: OpenRouter GPT-4o-mini-search-preview
- Temperature: 0.1 for consistent outputs
- Max Tokens: 4000 for comprehensive responses
- Timeout: 120 seconds per request
- Platform Data Collection: Simulated scraping of retailer websites
- Review Aggregation: Reddit discussions and YouTube content analysis
- AI Analysis: Sentiment analysis and aspect scoring
- JSON Validation: Automatic repair of malformed LLM outputs
- Database Storage: Idempotent upserts with conflict resolution
- System Prompt: Detailed instructions for beauty product analysis
- User Prompt: Dynamic template with product-specific context
- JSON Schema: Strict validation for structured outputs
- Error Handling: Graceful degradation for API failures
CREATE TABLE products (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
slug VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
brand VARCHAR(255) NOT NULL,
category product_category NOT NULL,
hero_image_url TEXT,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE snapshots (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
product_id UUID NOT NULL REFERENCES products(id),
raw_data JSONB NOT NULL,
platform_data JSONB NOT NULL,
summary JSONB NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);- UUID Primary Keys: Improved security and distribution
- JSONB Storage: Efficient JSON querying and indexing
- Triggers: Automatic timestamp updates
- Indexes: Optimized queries for common access patterns
- Constraints: Data integrity enforcement
- Product Grid: Responsive grid with hover animations
- Search & Filter: Real-time product filtering
- Loading States: Skeleton components during data fetching
- Error Handling: Graceful fallbacks for API failures
- Tabbed Interface: Prices, Reviews, Details, Sources
- Platform Comparison: Side-by-side retailer data
- AI Insights: Aspect scores with color coding
- Sources Drawer: Expandable platform details
- Product Management: View and refresh individual products
- Batch Operations: Ingest all products with progress tracking
- System Status: Health checks and performance metrics
- Real-time Updates: Toast notifications for operations
- WCAG AA Compliance: High contrast ratios and focus management
- Keyboard Navigation: Full keyboard accessibility
- Screen Reader Support: Proper ARIA labels and descriptions
- Focus Trapping: Modal and drawer focus management
- TypeScript: Strict typing throughout the application
- ESLint: Automated code quality checks
- Prettier: Consistent code formatting
- Type Safety: End-to-end type safety from database to UI
- SWR Caching: Intelligent data fetching and revalidation
- Code Splitting: Optimized bundle sizes
- Image Optimization: Next.js Image component with lazy loading
- Memoization: React optimization patterns
- Hot Reload: Instant development feedback
- Error Boundaries: Graceful error handling in production
- Logging: Structured JSON logs with request tracking
- API Documentation: Automatic OpenAPI/Swagger generation
The application includes complete Docker configuration for easy deployment:
# Production build
docker-compose -f docker-compose.prod.yml up --build
# Environment variables
cp env.example .env
# Edit .env with production values- Database URL: PostgreSQL connection string
- API Keys: OpenRouter API authentication
- CORS Origins: Frontend domain configuration
- Log Levels: Production logging configuration
- Health Endpoints:
/healthfor load balancer checks - Structured Logging: JSON logs for centralized monitoring
- Error Tracking: Comprehensive error handling and reporting
- Performance Metrics: Request timing and database query tracking
- Response Times: < 100ms for cached data, < 2s for AI generation
- Concurrency: FastAPI async/await for high throughput
- Database: Optimized queries with proper indexing
- Caching: Intelligent data freshness management
- First Contentful Paint: < 1.5s on 3G
- Time to Interactive: < 3s on average devices
- Bundle Size: Optimized with code splitting
- Lighthouse Score: 90+ across all metrics
- API Rate Limiting: Prevent abuse of AI endpoints
- Input Validation: Pydantic models for all data
- SQL Injection Prevention: Parameterized queries
- CORS Configuration: Restricted cross-origin access
- Admin Authentication: Role-based access control
- API Key Management: Secure credential storage
- Session Management: Secure user sessions
- Audit Logging: Administrative action tracking
cd app/ingestion
python -m pytest tests/ -vcd app/web
npm run test
npm run test:e2e- API Contract Testing: Ensure frontend/backend compatibility
- Database Testing: Schema validation and data integrity
- End-to-End Testing: Full user journey validation
- Next.js Documentation
- FastAPI Documentation
- LlamaIndex Documentation
- TailwindCSS Documentation
- PostgreSQL Documentation
- Understanding beauty product categories and consumer behavior
- Multi-platform retail landscape and pricing strategies
- Review sentiment analysis for beauty products
- Premium UI/UX patterns in luxury e-commerce
- Fork the repository
- Create a feature branch
- Make changes with proper testing
- Submit a pull request with detailed description
- Follow TypeScript/Python best practices
- Maintain comprehensive test coverage
- Use semantic commit messages
- Update documentation for new features
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or issues:
- Check the API Documentation
- Review the GitHub Issues
- Contact the development team
Built with β€οΈ for the beauty community - Combining AI intelligence with premium user experience to revolutionize beauty product discovery and comparison.