A modern web application for buying and selling electronic waste (e-waste) responsibly. EcoSort connects users who want to sell their old electronics with buyers looking for affordable devices, promoting sustainability and reducing electronic waste.
- Secure sign-up and login system
- Email-based authentication via Supabase
- Protected routes and user sessions
- Role-based access control (Admin/Community Member)
- Browse available e-waste listings
- Advanced filtering by category, condition, and price
- Search functionality for finding specific items
- Detailed product listings with multiple images
- Real-time availability status
- User profile management
- Create and manage listings
- Upload multiple images per listing (up to 5)
- Track buying activity
- View listing analytics
- Edit and delete listings
- Create detailed listings with:
- Title and description
- Category selection (Laptop, Smartphone, Tablet, etc.)
- Condition grading (Excellent, Good, Fair, Poor)
- Price and currency
- Location information
- Contact details
- Multiple image uploads from device
- Image validation (max 5MB per image, up to 5 images)
- Status management (Available, Sold, Reserved)
- Live camera capture for detecting waste items
- FastAPI service powered by YOLOv8 custom weights
- Confidence scoring with disposal guidance
- Direct file upload from device
- Secure storage via Supabase Storage
- Image preview and management
- Supported formats: JPG, PNG, GIF, WebP
- File size validation
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Router - Client-side routing
- Tailwind CSS - Styling framework
- Shadcn UI - Component library
- Supabase - Backend as a Service
- PostgreSQL database
- Authentication
- File storage
- Real-time subscriptions
- TanStack Query - Server state management
- React Hook Form - Form handling
- Zod - Schema validation
- Radix UI - Accessible components
- Lucide React - Icon library
- Tailwind CSS - Utility-first CSS
- Custom components with Shadcn UI
- Node.js 18.x or higher
- npm or bun package manager
- Python 3.9 or higher
- Supabase account
- Git
- Clone the repository:
git clone https://github.com/vaijaaaaa/Bio-Bin.git
cd Bio-Bin/ecosort-ai-market- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_PUBLISHABLE_KEY=your_supabase_anon_key
VITE_CLASSIFIER_API_URL=http://127.0.0.1:8000- Set up the database: Run the SQL scripts in your Supabase SQL Editor:
supabase/schema.sql- Database tables and policiessupabase/storage-bucket.sql- Storage bucket configuration
- Start the development server:
npm run devThe application will be available at http://localhost:8080
- Start the waste classifier API (instructions below) to enable the AI classifier page.
The YOLOv8-based waste classifier runs as a separate FastAPI service located in the server/ directory.
- Create and activate a virtual environment (example using
python -m venv):
python -m venv .venv
.\.venv\Scripts\activate
# On macOS/Linux: source .venv/bin/activate- Install backend dependencies:
pip install -r server/requirements.txt- (Optional) Configure environment variables:
MODEL_PATH(default:yolov8/runs/detect/train3/weights/best.pt)ALLOWED_ORIGINS(comma-separated list, default:*)MIN_CONFIDENCE(float between 0 and 1, default:0.25)
- Start the API:
uvicorn server.main:app --reload --host 0.0.0.0 --port 8000The service exposes POST /detect for image classification and GET /health for readiness checks.
- Keep the API running while developing so the frontend classifier page can submit images for analysis.
profiles- User profile informationlistings- Product listingslisting_images- Image URLs for listingsbuy_requests- Purchase requestssaved_listings- User saved items
listing-images- Public bucket for listing images- Max file size: 5MB
- Allowed types: image/jpeg, image/png, image/gif, image/webp
- Public read access
- Authenticated write access
All tables have RLS policies enabled for data security:
- Users can read public listings
- Users can create/update/delete their own listings
- Users can manage their own profile
- Admins have elevated permissions
ecosort-ai-market/
├── public/ # Static assets
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn UI components
│ │ ├── Navbar.tsx # Navigation bar
│ │ └── NavLink.tsx # Navigation links
│ ├── hooks/ # Custom React hooks
│ ├── integrations/ # External service integrations
│ │ └── supabase/ # Supabase client and types
│ ├── lib/ # Utility functions
│ ├── pages/ # Page components
│ │ ├── dashboard/ # Dashboard pages
│ │ ├── Auth.tsx # Authentication page
│ │ ├── Home.tsx # Landing page
│ │ └── Marketplace.tsx # Marketplace listing
│ ├── services/ # API service functions
│ └── main.tsx # Application entry point
├── supabase/ # Database migrations and config
├── server/ # FastAPI waste classifier service
├── .env.example # Environment variables template
├── vercel.json # Vercel deployment config
└── package.json # Project dependencies
npm run dev- Start development servernpm run build- Build for productionnpm run build:dev- Build in development modenpm run preview- Preview production buildnpm run lint- Run ESLint
- Push your code to GitHub
- Import your repository on Vercel
- Configure environment variables:
VITE_SUPABASE_URLVITE_SUPABASE_PUBLISHABLE_KEY
- Deploy
See DEPLOYMENT.md for detailed deployment instructions.
Required environment variables for deployment:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_PUBLISHABLE_KEY=your-anon-keyAfter deployment, update Supabase configuration:
- Add your deployment URL to Supabase Site URL
- Add your deployment URL to Redirect URLs
- Configure CORS if needed
- Overview of user activity
- My Listings - Manage your product listings
- Create Listing - Add new items for sale
- Buying - Track purchase requests
- Profile - Update user information
- Fill in product details
- Upload images from your device
- Set price and location
- Provide contact information
- Submit for review
- Upload up to 5 images per listing
- Drag and drop support
- Image preview before upload
- Remove unwanted images
- Automatic optimization
- Search by title or description
- Filter by category
- Filter by condition
- Filter by price range
- Sort by date, price, or relevance
- Row Level Security (RLS) enabled on all tables
- Authentication required for sensitive operations
- Secure file upload with validation
- Environment variables for sensitive data
- CORS configuration
- XSS protection
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For support, email vaijuwalker111@gmail.com or open an issue in the repository.
- Supabase for backend infrastructure
- Shadcn UI for component library
- Tailwind CSS for styling system
- Lucide for icons
- React team for the amazing framework
- AI-powered item classification
- Real-time chat between buyers and sellers
- Payment integration
- Rating and review system
- Mobile application
- Email notifications
- Advanced analytics dashboard
- Multi-language support
- Vaijnath Patil -vaijaaaaa
- Yuvraj Singh -YuvrajRajbanshi
Active development - Version 1.0.0