Skip to content

vedntzz/aiFittingLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Fashion Wall - Thread.AI

An AI-driven fashion discovery and creation platform where browsing feels like exploration, not shopping.

🎯 Vision

Thread.AI is a visual, Pinterest-like wall for fashion inspiration with a dedicated AI fitting lab where users upload images, generate outfits, edit, and share their creations.

✨ Core Features

1. Authentication

  • Google OAuth only (no passwords)
  • Seamless login/signup experience
  • Secure JWT-based sessions

2. Profile Page

  • Personal creative space
  • All AI-generated outfits
  • User-uploaded images
  • Private drafts
  • Public posted items
  • Quick access to AI Lab

3. Main Wall (Discovery Feed)

  • Infinite scroll visual discovery
  • Pinterest-style masonry grid
  • Minimal, clean header
  • Optimized for curiosity and browsing
  • Filter by style categories

4. AI Fitting Lab ⭐

  • Upload your photo
  • Select garments from product URLs
  • AI generates outfit visualization
  • Edit and refine results
  • Save as private draft
  • Share to public wall

5. Shared UI Components

  • Consistent header across all pages
  • Logo and navigation
  • Search functionality
  • Profile avatar dropdown

πŸ—οΈ Architecture

Monorepo Structure

ai-fashion-wall/
β”œβ”€β”€ Backend/          # Python FastAPI + PostgreSQL
β”œβ”€β”€ Frontend/         # Next.js + TypeScript + Tailwind
β”œβ”€β”€ README.md         # This file
β”œβ”€β”€ SETUP.md          # Setup instructions
└── start-*.sh/bat    # Quick start scripts

Tech Stack

Frontend:

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • NextAuth.js (Google OAuth)
  • Zustand (State Management)
  • Framer Motion (Animations)

Backend:

  • Python 3.11+
  • FastAPI
  • PostgreSQL
  • SQLAlchemy ORM
  • Pydantic Schemas

🧼 Code Philosophy

This project follows strict clean code principles:

Golden Rules

  1. 200 Line Limit - No file exceeds 200 lines
  2. Single Responsibility - One purpose per file
  3. Feature-Based Structure - Features own their code
  4. Routes Handle HTTP Only - No business logic in routes
  5. AI Logic in Backend - Never in frontend
  6. Types Live with Features - Co-located types

Backend MVC Pattern

Backend/
β”œβ”€β”€ routes/          # HTTP layer only (Controller)
β”œβ”€β”€ services/        # Business logic (Service)
β”œβ”€β”€ models/          # Database ORM (Model)
└── schemas/         # Request/Response validation (DTO)

Frontend Feature Pattern

Frontend/app/
β”œβ”€β”€ [feature]/
β”‚   β”œβ”€β”€ page.tsx              # Route entry
β”‚   β”œβ”€β”€ components/           # Feature-specific
β”‚   └── hooks/ (optional)     # Feature-specific

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • PostgreSQL 14+

Option 1: Quick Start Scripts

Mac/Linux:

# Terminal 1 - Frontend
./start-frontend.sh

# Terminal 2 - Backend
./start-backend.sh

Windows:

# Terminal 1 - Frontend
start-frontend.bat

# Terminal 2 - Backend
start-backend.bat

Option 2: Manual Start

Frontend:

cd Frontend
npm install
cp .env.example .env.local
# Edit .env.local with your credentials
npm run dev

Backend:

cd Backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your database credentials
python init_db.py
python main.py

πŸ“š Documentation

πŸ”‘ Environment Setup

Frontend .env.local

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
NEXT_PUBLIC_API_URL=http://localhost:8000

Backend .env

DATABASE_URL=postgresql://postgres:password@localhost:5432/aifashionwall
SECRET_KEY=your-secret-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
FRONTEND_URL=http://localhost:3000

πŸ“ Project Structure

Backend

Backend/
β”œβ”€β”€ core/               # Configuration & utilities
β”‚   β”œβ”€β”€ config.py      # Environment settings
β”‚   β”œβ”€β”€ database.py    # Database connection
β”‚   └── security.py    # JWT & password hashing
β”œβ”€β”€ models/            # SQLAlchemy ORM models
β”‚   β”œβ”€β”€ user.py
β”‚   β”œβ”€β”€ post.py
β”‚   └── draft.py
β”œβ”€β”€ schemas/           # Pydantic validation schemas
β”‚   β”œβ”€β”€ user.py
β”‚   β”œβ”€β”€ post.py
β”‚   β”œβ”€β”€ draft.py
β”‚   β”œβ”€β”€ auth.py
β”‚   └── ai.py
β”œβ”€β”€ routes/            # API endpoints (HTTP only)
β”‚   β”œβ”€β”€ auth.py
β”‚   β”œβ”€β”€ users.py
β”‚   β”œβ”€β”€ posts.py
β”‚   β”œβ”€β”€ drafts.py
β”‚   └── ai.py
β”œβ”€β”€ services/          # Business logic
β”‚   β”œβ”€β”€ user_service.py
β”‚   β”œβ”€β”€ post_service.py
β”‚   β”œβ”€β”€ draft_service.py
β”‚   └── ai_service.py
β”œβ”€β”€ main.py            # FastAPI app entry point
β”œβ”€β”€ init_db.py         # Database initialization
└── requirements.txt   # Python dependencies

Frontend

Frontend/
β”œβ”€β”€ app/               # Next.js pages
β”‚   β”œβ”€β”€ login/        # Login page
β”‚   β”œβ”€β”€ signup/       # Signup page
β”‚   β”œβ”€β”€ wall/         # Main feed
β”‚   β”œβ”€β”€ profile/      # User profile
β”‚   β”œβ”€β”€ lab/          # AI fitting lab
β”‚   └── layout.tsx    # Root layout
β”œβ”€β”€ components/        # Shared components
β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”œβ”€β”€ SearchBar.tsx
β”‚   β”œβ”€β”€ ProfileAvatar.tsx
β”‚   └── FashionCard.tsx
β”œβ”€β”€ stores/            # Zustand state
β”‚   β”œβ”€β”€ useAuthStore.ts
β”‚   └── useLabStore.ts
β”œβ”€β”€ types/             # TypeScript types
β”‚   └── index.ts
└── package.json

🌐 Access Points

Service URL Description
Frontend http://localhost:3000 Main application
Backend API http://localhost:8000 API server
API Docs http://localhost:8000/docs Interactive Swagger UI
ReDoc http://localhost:8000/redoc Alternative API docs

🎨 Features Breakdown

Already Implemented βœ…

  • Google OAuth authentication flow
  • User management (CRUD)
  • Posts with pagination, like, save
  • Drafts system (private creations)
  • AI Lab interface (UI complete)
  • Infinite scroll feed
  • Profile with gallery
  • State management (Zustand)
  • Clean MVC architecture

Ready for Integration πŸ”Œ

  • AI generation service (stub ready)
  • File upload system
  • Image storage (S3/Cloudinary)
  • Real authentication middleware
  • Production deployment

πŸ› οΈ Development

Running Tests

# Frontend (when added)
cd Frontend
npm test

# Backend (when added)
cd Backend
pytest

Code Quality

  • TypeScript strict mode
  • ESLint for frontend
  • Type hints for Python
  • 200-line file limit enforced

πŸ“„ License

MIT License - See LICENSE file for details

πŸ‘₯ Contributing

  1. Follow the clean code principles
  2. Keep files under 200 lines
  3. Add proper documentation
  4. Test your changes
  5. Create feature branches

πŸš€ Deployment

Frontend (Vercel)

cd Frontend
vercel

Backend (Railway/Heroku)

  • Configure environment variables
  • Setup PostgreSQL database
  • Update CORS settings
  • Enable HTTPS

πŸ“ž Support

For issues and questions:

  • Create an issue in the repository
  • Check documentation files
  • Review code comments

Built with ❀️ by the Thread.AI team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors