How rishabh55122/outfit works
Project type and purpose
• OutfitAI Studio is a full-stack, serverless web application built on Next.js (App Router), React and Tailwind CSS.
• Its purpose is to let users upload wardrobe items, select style/occasion preferences, and receive AI-powered outfit suggestions.
File structure
• src/app – Next.js pages and layouts (layout.tsx, page.tsx)
• src/components – reusable UI building blocks:
• ui/… (buttons, dialogs, inputs, etc.)
• outfit/… (ItemPreview, OutfitCard, OutfitDisplay)
• layout/… (Header, Footer)
• src/hooks – custom React hooks (use-mobile, use-toast)
• src/lib – utility functions (utils.ts)
• src/ai – server-side AI logic executed as Next.js serverless functions (genkit.ts, flows/generate-item-image-flow.ts, flows/suggest-outfit.ts)
• next.config.ts, tailwind.config.ts – configuration and build settings
README for insights
• Confirms Next.js + React + Tailwind stack
• Describes AI integration (Google AI) for image generation and outfit suggestions
• No persistent database; session data and uploaded items live in memory or client state
Main components & interactions
a. Frontend (Client)
• React/Next.js pages (src/app)
• Presentation layer (UI components)
• State management (client-side for uploaded items, preferences)
• File-upload widget → sends images to serverless API
b. Backend / Serverless Layer
• Next.js serverless API endpoints (src/ai flows)
• genkit.ts abstracts API calls to Google AI
• generate-item-image-flow.ts (optional image enhancement)
• suggest-outfit.ts (core outfit suggestion logic)
c. External Services
• Google AI API for text/image generation
• Vercel (or equivalent) for hosting and edge CDN
d. (Optional) Asset Hosting
• Static assets served by Next.js (public folder or CDN)
Architectural patterns & design principles
• Separation of concerns: UI vs. AI business logic
• Serverless micro-functions for AI orchestration
• Component-based React design for UI reuse
• Responsive, mobile-first design guided by hooks and Tailwind
• Tokenization of AI calls in genkit for easy swapping of providers