Architecture
Overview
Sky Style is organized as a monorepo with multiple deployable applications.
Monorepo Structure
.
├── apps/
│ ├── web/ # Next.js 16 production app
│ │ ├── src/ # Application source
│ │ │ ├── app/ # App router pages and API routes
│ │ │ ├── lib/ # Shared library code
│ │ │ └── components/ # React components
│ │ ├── next.config.ts
│ │ └── package.json
│ │
│ └── docs/ # VitePress documentation
│ ├── .vitepress/
│ └── api/ # API documentation
│
├── supabase/ # Database schema and migrations
│ ├── schema.sql
│ └── migrations/
│
└── package.json # Root package with npm workspacesWeb App (apps/web)
Framework
- Next.js 16 with App Router
- React 19
- TypeScript
- Tailwind CSS v4
Key Dependencies
@google/generative-ai- Gemini API client@mistralai/mistralai- Mistral API clientopenai- OpenAI API client@supabase/supabase-js- Database clientnext-auth- Authentication@simplewebauthn/browser- WebAuthn support
Directory Structure
apps/web/
├── src/
│ ├── app/
│ │ ├── api/ # API routes
│ │ │ ├── style/ # Outfit recommendations
│ │ │ ├── followup/ # Follow-up recommendations
│ │ │ ├── weather/ # Weather data
│ │ │ └── ...
│ │ ├── (auth)/ # Authentication pages
│ │ ├── dashboard/ # Main dashboard
│ │ └── layout.tsx
│ │
│ ├── components/ # React components
│ │ ├── Dashboard.tsx # Main dashboard component
│ │ ├── WeatherPlanningPanel.tsx
│ │ └── ...
│ │
│ ├── lib/ # Library code
│ │ ├── ai.ts # AI integration and model management
│ │ ├── weather.ts # Weather data fetching and caching
│ │ ├── daily-usage.ts # Rate limiting and usage tracking
│ │ ├── credits.ts # Credits system
│ │ ├── api-keys.ts # API key generation and verification
│ │ └── ...
│ │
│ └── __tests__/ # Test files
│ ├── setup.ts
│ └── mocks.ts
│
├── next.config.ts
├── package.json
└── tsconfig.jsonData Flow
User Request
↓
API Route (style/followup)
↓
Authentication Check
↓
Rate Limit Check (daily-usage.ts)
↓
Weather Data (weather.ts)
↓
AI Recommendation (ai.ts)
↓
Response with outfit suggestionAI Integration
Supported Providers
- OpenAI (GPT-4o, GPT-4o Mini)
- Google Gemini (2.5 Flash, 2.5 Flash Lite)
- Mistral AI (Large Latest, Small Latest, Ministral)
Model Tiering
Pro Users:
- OpenAI models
- Gemini models
- Mistral Large
- Gemma
- Mistral Small
- Ministral
Free Users:
- Gemini models
- Mistral Small
- Gemma
- Ministral
BYOK Support
Bring Your Own Key (BYOK) is supported for all providers. Users can configure their own API keys for:
- OpenAI
- Gemini
- Mistral
Database (Supabase)
Key Tables
users- User accountsdaily_usage- Usage tracking with rate limitscredits- Pro user creditssettings- User preferencescloset- User wardrobe items
Rate Limits
| Feature | Free | Pro | Dev |
|---|---|---|---|
| AI uses | 20/day | ∞ | ∞ |
| Follow-ups | 40/day | 400/day | ∞ |
| Closet uses | 4/day | ∞ | ∞ |
| Source picks | 4/day | ∞ | ∞ |
| Model switches | 2/week | ∞ | ∞ |
