AI-Powered Clothing Donation Platform
A web application that analyzes clothing condition using AI to predict reward points and enables easy clothing donations.
Reward Closet is an innovative platform that bridges the gap between clothing waste and charitable giving through artificial intelligence. Our mission is to make clothing donations more accessible, transparent, and rewarding for everyone involved.
- Clothing Waste Crisis: Millions of tons of clothing end up in landfills each year, contributing to environmental pollution
- Donation Barriers: Traditional donation processes are often complicated, time-consuming, and lack transparency
- Value Uncertainty: Donors have no clear understanding of their clothing's worth or impact
- Limited Incentives: Current donation systems provide minimal motivation for regular participation
We believe that technology can transform how we approach sustainable consumption and charitable giving. By combining AI-powered assessment with a transparent reward system, we aim to:
- Reduce Textile Waste: Make it easier for people to donate instead of discarding
- Increase Donation Participation: Provide clear value and rewards to encourage regular donations
- Enhance Transparency: Use technology to show donors the real impact of their contributions
- Build Community: Create a platform where giving back becomes engaging and social
Reward Closet leverages cutting-edge AI technology to:
- Instantly Assess: AI analyzes clothing condition and provides immediate value estimates
- Reward Generosity: Points-based system that recognizes and rewards donors
- Simplify Process: One-click donation system with flexible pickup options
- Track Impact: Real-time tracking of donation status and community impact
By making donations rewarding, transparent, and effortless, we're creating a sustainable ecosystem where everyone wins β donors feel valued, recipients get quality clothing, and the environment benefits from reduced waste.
- π Web Application: https://reward-closet.vercel.app
- β‘ AI API Server Repository: https://github.com/abjin/reward-closet-ai-api-server
- π AI API Documentation: http://reward-closet-ai-api.eba-by6v3rd4.ap-northeast-2.elasticbeanstalk.com/docs
- πΊ Youtube Video: https://youtu.be/X4Cu6lpv5bM
The diagram above illustrates the core components and data flow of the Reward Closet platform:
- User: Interacts with the web application
- Web App: Next.js application hosted on Vercel
- AI Server: FastAPI-based clothing analysis service on AWS
- Database: MySQL database for user data and donation records
- Supabase: Handles authentication and image storage
- AI analyzes uploaded clothing photos to evaluate condition
- Provides estimated reward points based on clothing condition
- Automatic analysis of item type, and condition
- One-click donation application
- Delivery pickup and home collection options
- Real-time donation progress tracking
- Points awarded upon donation completion
- Personal accumulated points tracking
- Donation history management
- Supabase Auth based secure registration/login
- Email verification and social login support
- Personal donation history and points management
- Complete activity overview in My Page
- Image upload using Supabase Storage
- Automatic file size and format validation (max 10MB, JPG/PNG/WebP)
- Fast image serving through CDN
- Python - Base framework
- YOLO - Special library & models for computer vision
- Next.js 15 - React-based full-stack framework
- React 19 - Latest React version
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible UI components
- Lucide React - Icon library
- Next.js API Routes - Serverless API
- Prisma - Type-safe ORM
- MySQL - Relational database
- Supabase Auth - Authentication system
- Supabase Storage - Image file storage
- Vercel - Next.js optimized hosting platform
- Supabase - Auth, Storage, real-time features
- AWS Elastic Beanstalk - AI API service hosting
- ESLint - Code quality management
- Turbopack - Fast development server
data/
βββ preprocessing.ipynb # Data preprocessing
βββ clothes.yaml # YOLO formatted data file
prisma/
βββ schema.prisma # Database schema
βββ migrations/ # Database migrations
src/
βββ app/ # Next.js App Router pages
β βββ page.tsx # Home page
β βββ login/ # Login page
β βββ signup/ # Sign up page
β βββ predict/ # AI prediction page
β βββ donate/ # Donation application page
β βββ mypage/ # My page
β βββ guide/ # Donation guide
β βββ api/ # API routes
β βββ users/ # User-related API
β βββ donations/ # Donation-related API
β βββ predict/ # AI prediction API
β βββ user/ # Individual user API
βββ components/ # Reusable components
β βββ ui/ # Basic UI components
β βββ header.tsx # Common header
βββ lib/ # Utilities and configurations
β βββ supabase.ts # Supabase client
β βββ prisma.ts # Prisma client
β βββ storage.ts # File storage related
β βββ utils.ts # Common utilities
βββ middleware.ts # Next.js middleware
model User {
id String # Unique ID
email String # Email (unique)
nickname String # Nickname
supabaseId String # Supabase user ID
points Int # Points balance
donations Donation[] # Donation history
createdAt DateTime # Created at
updatedAt DateTime # Updated at
}
model Donation {
id String # Unique ID
userId String # User ID
imageUrl String # Clothing image URL
brand String? # Brand name
itemType String # Item type
condition Condition # Clothing condition (Good/Fair/Poor)
estimatedPoints Int # Estimated points
actualPoints Int? # Actual awarded points
pickupMethod PickupMethod # Pickup method (Delivery/Home pickup)
address String? # Pickup address
status DonationStatus # Donation status
createdAt DateTime # Created at
updatedAt DateTime # Updated at
}
- Node.js 18 or higher
- MySQL database
- Supabase account (Auth and Storage setup required)
- Vercel account (for deployment, free plan available)
- AI API service (currently using external service)
-
Download Dataset (refer to dataset description)
-
Preprocessing
- Please refer to preprocessing.ipynb
-
Training
yolo detect train data=clothes.yaml model=yolo11n.pt epochs=100 imgsz=640 seed=42 optimizer='Adam' \
lr0=1e-4 batch=16 cos_lr=True dropout=0.05
- Inference
yolo predict model='//PATH/TO/YOUR/TRAINED/MODEL.pt' imgsz=640 conf=0.25
- Clone the repository
git clone https://github.com/abjin/reward-closet.git
cd reward-closet
- Install dependencies
npm install
- Environment variables setup
Create a
.env.local
file and add the following:
# Database
DATABASE_URL="mysql://user:password@localhost:3306/reward_closet"
# Supabase
NEXT_PUBLIC_SUPABASE_URL="your-supabase-url"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-supabase-anon-key"
SUPABASE_SERVICE_ROLE_KEY="your-service-role-key"
# AI API (currently using external service)
# AI_API_URL is hardcoded in the code
- Database setup
# Generate Prisma client
npx prisma generate
# Database migration (development)
npx prisma db push
# Or apply migration files (production)
npx prisma migrate deploy
- Supabase Storage setup Create the following Storage bucket in your Supabase dashboard:
- Bucket name:
clothing-images
- Public policy: Enabled
- Run development server
npm run dev
The application will run at http://localhost:3000.
This project is optimized for deployment on Vercel.
- Deploy to Vercel
# Install Vercel CLI
npm i -g vercel
# Deploy project
vercel --prod
- Environment variables setup Set the following environment variables in your Vercel dashboard:
DATABASE_URL=your_mysql_database_url
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
- Hosting: Vercel (Next.js optimized)
- Authentication: Supabase Auth (social login, email verification)
- Storage: Supabase Storage (image file management)
- Database: MySQL (Prisma ORM, RDS)
- AI Analysis: FastAPI Server on AWS Elastic Beanstalk
npm run dev # Run development server (with Turbopack)
npm run build # Production build
npm run start # Start production server
npm run lint # Run ESLint
- Original Dataset Source: Waste Clothing Recycling Classification and Screening Data (AI-Hub)
- Data Preprocessing: Change to YOLO format and integrate data classes (15 classes -> 13 classes) (Details in preprocessing.ipynb)
- Model: YOLO11n (super light model)
- Train/Validation Split: Split train/validation to 8 : 2 (class stratified split)
- AI Server Repository: reward-closet-ai-api-server
- Framework: FastAPI with PyTorch TorchScript models
- Platform: AWS Elastic Beanstalk
- API Endpoint:
/models/clothes/predict
Clothing Types (11 categories):
- jacket, short pants, tailored pants, jumper, shirts
- coat, dress, casual pants, blouse, tshirts, skirt
Defect Detection (5 categories -> 2 categories):
- Original: ripped, pollution, tearing, frayed
- Ours: tearing, pollution
- Good Condition (500P): No defects detected
- Fair Condition (200P): Minor defects (wear, slight damage)
- Poor Condition (0P): Major defects (tears, stains, severe damage)
- Home (
/
) - Service introduction and statistics - AI Prediction (
/predict
) - Upload clothing photos and AI analysis - Donation Application (
/donate
) - Apply for donation and pickup information - My Page (
/mypage
) - Personal donation history and points management - Login/Sign Up (
/login
,/signup
) - User authentication
- Sign Up - Simple registration with email and nickname
- Upload Photo - Take and upload photos of clothes to donate
- AI Analysis - AI analyzes clothing condition and provides estimated points
- Apply for Donation - Select pickup method and apply for donation
- Earn Points - Receive points after donation completion
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is distributed under the MIT License.
If you have any questions about the project, please create an issue.
Let's create a meaningful donation culture together with Reward Closet! π±