EcoFinds is a sustainable second-hand marketplace that connects eco-conscious buyers and sellers. Our mission is to reduce waste and carbon emissions by giving pre-loved items a second life. Every purchase on EcoFinds contributes to a more sustainable future.
- User Authentication: Secure sign-up and login powered by Supabase Auth with email verification
- Product Marketplace: Browse and discover a wide range of second-hand products across multiple categories
- Product Listings: Create and manage your own product listings with image uploads
- Shopping Cart: Add items to cart and manage your shopping experience
- Purchase History: Track your purchases and their environmental impact
- User Profiles: Personalize your profile and view your eco-impact statistics
- Seller Reviews: Rate and review sellers to build a trusted community
- COβ Impact Tracking: See the environmental impact of your second-hand purchases
- Responsive Design: Seamless experience across desktop, tablet, and mobile devices
- Real-time Updates: Live cart count and instant product updates
- Search & Filter: Advanced search functionality with category filtering
- Eco Badges: Earn eco-champion badges based on your seller ratings and sales
- Beautiful UI: Modern, eco-themed design with smooth animations
- React 18.3.1 - UI library with TypeScript support
- TypeScript 5.8.3 - Type-safe JavaScript
- Vite 5.4.19 - Fast build tool and dev server
- Tailwind CSS 3.4.17 - Utility-first CSS framework
- Shadcn UI - Beautiful, accessible component library built on Radix UI
- Radix UI - Unstyled, accessible UI primitives
- React Router DOM 6.30.1 - Client-side routing
- React Hook Form 7.61.1 - Form management with validation
- TanStack Query 5.83.0 - Data fetching and state management
- Lucide React 0.462.0 - Beautiful icon library
- Sonner 1.7.4 - Toast notifications
- Supabase - Backend-as-a-Service providing:
- PostgreSQL database
- Authentication system
- File storage for product images
- Real-time subscriptions
- Row Level Security (RLS)
- ESLint 9.32.0 - Code linting and formatting
- PostCSS 8.5.6 - CSS processing
- Autoprefixer 10.4.21 - CSS vendor prefixing
- TypeScript ESLint 8.38.0 - TypeScript linting
- Node.js 18+
- npm or bun package manager
- A Supabase project (free tier works)
-
Clone the repository:
git clone https://github.com/rishanmenezes/ecofinds.git cd EcoFinds -
Install dependencies:
npm install # or bun install -
Set up Supabase:
- Create a new project at supabase.com
- Run the SQL migration from
supabase/migrations/20250906060706_fdcb8fa7-ee32-4159-a3e3-3c84952e37f7.sql - Create a storage bucket named
product-imageswith public access - Enable Row Level Security (RLS) policies as defined in the migration
-
Configure environment variables:
Create a
.envfile in the root directory:VITE_SUPABASE_URL="YOUR_SUPABASE_URL" VITE_SUPABASE_ANON_KEY="YOUR_SUPABASE_ANON_KEY"
Get these credentials from your Supabase project settings β API.
-
Update Supabase client configuration:
Edit
src/integrations/supabase/client.tswith your credentials:const SUPABASE_URL = "YOUR_SUPABASE_URL"; const SUPABASE_PUBLISHABLE_KEY = "YOUR_SUPABASE_ANON_KEY";
-
Run the development server:
npm run dev # or bun run devThe application will be accessible at
http://localhost:8080
npm run dev- Start development servernpm run build- Build for productionnpm run build:dev- Build for development modenpm run lint- Run ESLintnpm run preview- Preview production build
EcoFinds/
βββ public/ # Static assets
β βββ favicon.ico
β βββ placeholder.svg
β βββ robots.txt
βββ src/
β βββ components/ # Reusable components
β β βββ Layout/
β β β βββ Navbar.tsx # Main navigation bar
β β βββ Product/
β β β βββ ProductCard.tsx # Product display card
β β βββ ui/ # Shadcn UI components (40+ components)
β β βββ button.tsx
β β βββ card.tsx
β β βββ input.tsx
β β βββ ... (many more)
β βββ hooks/ # Custom React hooks
β β βββ useAuth.tsx # Authentication state management
β β βββ use-mobile.tsx # Mobile detection
β β βββ use-toast.ts # Toast notifications
β βββ integrations/ # Third-party integrations
β β βββ supabase/
β β βββ client.ts # Supabase client configuration
β β βββ types.ts # TypeScript type definitions
β βββ lib/ # Utility functions
β β βββ utils.ts # Helper functions
β βββ pages/ # Application pages
β β βββ Index.tsx # Landing page
β β βββ Auth.tsx # Login/Signup page
β β βββ Feed.tsx # Product marketplace
β β βββ AddProduct.tsx # Product listing form
β β βββ MyListings.tsx # User's product management
β β βββ Cart.tsx # Shopping cart
β β βββ Purchases.tsx # Purchase history
β β βββ Profile.tsx # User profile
β β βββ NotFound.tsx # 404 page
β βββ App.tsx # Main app component with routing
β βββ main.tsx # Application entry point
β βββ index.css # Global styles and Tailwind directives
β βββ App.css # Additional app styles
βββ supabase/ # Supabase configuration
β βββ config.toml # Supabase CLI config
β βββ migrations/
β βββ 20250906060706_*.sql # Database schema migration
βββ .env # Environment variables (not in git)
βββ .gitignore # Git ignore rules
βββ components.json # Shadcn UI configuration
βββ eslint.config.js # ESLint configuration
βββ package.json # Dependencies and scripts
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.app.json # App TypeScript config
βββ tsconfig.node.json # Node TypeScript config
βββ vite.config.ts # Vite build configuration
βββ README.md # This file
Extends Supabase auth.users with additional user information
id(UUID, Primary Key) - References auth.usersusername(TEXT, Unique) - Display usernameemail(TEXT) - User emailcreated_at(TIMESTAMP) - Account creation dateupdated_at(TIMESTAMP) - Last update date
Product listings in the marketplace
id(UUID, Primary Key) - Unique product identifiertitle(TEXT) - Product titledescription(TEXT) - Detailed product descriptioncategory(TEXT) - Product categoryprice(DECIMAL) - Product priceimage_url(TEXT) - Product image URLuser_id(UUID, Foreign Key) - Seller's user IDcreated_at(TIMESTAMP) - Listing creation dateupdated_at(TIMESTAMP) - Last update date
User shopping cart items
id(UUID, Primary Key) - Unique cart item identifieruser_id(UUID, Foreign Key) - Cart ownerproduct_id(UUID, Foreign Key) - Product referencecreated_at(TIMESTAMP) - Addition date- Unique constraint on (user_id, product_id)
Purchase history records
id(UUID, Primary Key) - Unique purchase identifieruser_id(UUID, Foreign Key) - Buyer's user IDproduct_id(UUID, Foreign Key) - Purchased productpurchased_at(TIMESTAMP) - Purchase date
Seller reviews and ratings
id(UUID, Primary Key) - Unique review identifierbuyer_id(UUID, Foreign Key) - Reviewer's user IDseller_id(UUID, Foreign Key) - Seller being reviewedproduct_id(UUID, Foreign Key) - Related productrating(INTEGER) - Rating from 1-5review_text(TEXT) - Optional review textcreated_at(TIMESTAMP) - Review date- Unique constraint on (buyer_id, product_id)
Stores product images with the following policies:
- Public read access for all users
- Authenticated users can upload
- Users can manage their own images (organized by user_id)
All tables have Row Level Security (RLS) enabled with policies ensuring:
- Users can only access their own data (cart, purchases, profile)
- Public read access for products and reviews
- Users can only modify their own products and listings
- Automatic profile creation on user signup via database trigger
The application uses an eco-friendly green theme:
- Primary: Forest green (#2d5a3d)
- Secondary: Sage green (#9acd8a)
- Tertiary: Earthy olive (#8b9a6b)
- Earth: Warm brown (#8b7355)
- Forest: Deep green (#1a4d2e)
- Shadows: Eco-themed soft shadows
- Gradients: Eco and earth gradient combinations
- Animations: Custom fade-in, scale-in, and bounce animations
- Dark Mode: Full dark theme support with eco-friendly colors
- User signs up with email, password, and username
- Supabase Auth handles email verification
- Database trigger automatically creates profile record
- Auth state persists via localStorage
- Protected routes redirect unauthenticated users
- User fills product details (title, description, category, price)
- Image is uploaded to Supabase Storage
- Product record is created in database
- Image URL is stored with product
- Product appears in marketplace feed
- Users browse products with search and category filters
- Add products to cart (prevents adding own products)
- Cart shows total and COβ savings estimate
- Checkout moves items to purchases table
- Cart is cleared and purchase history is updated
The application estimates environmental impact using a simple formula:
COβ Savings = (Product Price Γ 0.1) + Random Factor (0-2kg)
This is a simplified calculation for demonstration purposes.
- Rishan Menezes - Project Lead
- Rakesh G - Frontend Development
- Nagaraju HL - Backend Integration
- Prithvi HN - UI/UX Design
Watch a demo of EcoFinds:
https://youtu.be/u-iIejnpoww?si=P4MFfKKwY8Rhqp
We welcome contributions to EcoFinds! Here's how you can help:
- 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
- Follow the existing code style and conventions
- Use TypeScript for type safety
- Write clean, readable code with comments
- Test your changes thoroughly
- Ensure responsive design for all components
- Implement real payment gateway integration
- Add real-time chat between buyers and sellers
- Implement advanced search with filters
- Add product comparison feature
- Create seller dashboard with analytics
- Implement push notifications
- Add more accurate COβ impact calculations
- Create mobile app (React Native)
- Add internationalization (i18n)
- Implement advanced reporting system
This project is open source and available under the MIT License.
EcoFinds is more than just a marketplaceβit's a movement towards sustainable consumption. By choosing second-hand items, our users help:
- Reduce Landfill Waste: Give pre-loved items a new life
- Lower Carbon Emissions: Reduce manufacturing demand
- Save Natural Resources: Conserve water, energy, and raw materials
- Build Community: Connect eco-conscious individuals
Together, we're making a difference, one purchase at a time! π±