A modern, full-stack auction application built with React TypeScript, Supabase, and Tailwind CSS. Features real-time bidding, automatic auction ending, payment integration, and comprehensive admin controls.
- Real-time Bidding System - Live bid updates using Supabase real-time subscriptions
- Automatic Auction Ending - Scheduled functions to end auctions and determine winners
- User Authentication - Secure signup/login with profile management
- Admin Dashboard - Complete auction management with analytics
- Payment Integration - Swish payment system with QR codes and verification
- Dark/Light Theme Toggle - Smooth transitions with system preference detection
- Responsive Design - Mobile-first approach with Tailwind CSS
- Image Upload & Compression - Local file upload with automatic optimization
- Real-time Notifications - Live updates for bid status and auction endings
- Row Level Security (RLS) - Database-level access controls
- Image Compression - Automatic image optimization before storage
- TypeScript - Full type safety throughout the application
- Performance Optimized - Efficient queries and caching strategies
- React 18 - Modern React with hooks and functional components
- TypeScript - Full type safety and enhanced developer experience
- Tailwind CSS - Utility-first CSS framework with custom theme
- Vite - Fast build tool and development server
- Lucide React - Beautiful, customizable icons
- Supabase - Backend-as-a-Service with PostgreSQL
- PostgreSQL - Robust relational database with advanced features
- Real-time Subscriptions - Live data updates
- Storage - File upload and management
- Edge Functions - Server-side logic
- Canvas API - Client-side image compression
- ESLint - Code linting and formatting
- PostCSS - CSS processing and optimization
Before you begin, ensure you have the following installed:
- Node.js (v16.0.0 or higher)
- npm or yarn package manager
- Git for version control
- Supabase Account (free tier available)
git clone https://github.com/itscharanteja/FYNDAK.git
cd FYNDAKnpm install- Go to supabase.com
- Sign up/Login to your account
- Click "New Project"
- Fill in your project details:
- Name: FYNDAK (or your preferred name)
- Database Password: Choose a strong password
- Region: Select the closest region to your users
- Wait for the project to be created (2-3 minutes)
- In your Supabase dashboard, go to Settings β API
- Copy the following values:
- Project URL (e.g.,
https://your-project-id.supabase.co) - Anon/Public Key (starts with
eyJhbGciOi...)
- Project URL (e.g.,
- Create a
.env.localfile in the root directory:
touch .env.local- Add your Supabase credentials:
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here
β οΈ Important: Replaceyour-project-idandyour-anon-key-herewith your actual values from Step 3.2
- In your Supabase dashboard, go to SQL Editor
- Click New Query
- Copy the entire contents of
supabase/migrations/00000000000000_initial_schema.sql - Paste it into the SQL editor
- Click Run to execute the migration
This will create:
- All necessary tables (profiles, products, bids)
- Database functions for auction management
- Row Level Security policies
- Storage bucket for images
- Indexes for optimal performance
- Go to Table Editor in your Supabase dashboard
- You should see the following tables:
profiles- User profile informationproducts- Auction itemsbids- User bids on products
- Go to Storage and verify the
product-imagesbucket exists
- Start the development server (see Step 6)
- Navigate to the signup page
- Create your admin account
- In Supabase dashboard, go to Table Editor β profiles
- Find your user profile
- Edit the row and set
is_admintotrue - Save the changes
npm run devThe application will be available at: http://localhost:5173
- Navigate to
/signup - Fill in your details (name, email, password)
- Verify your email if required
- Complete your profile information
- View all active auctions on the products page
- See current prices, time remaining, and product details
- Filter and search for specific items
- Click on any active auction
- Enter your bid amount (must be higher than current price)
- Confirm your bid
- Track your bids in the dashboard
- Go to your dashboard
- Find auctions you've won
- Click "Pay Here" to start payment process
- Enter your phone number for Swish verification
- Scan the QR code with your Swish app
- Wait for admin verification
- Access the Admin Panel
- Click "Add New Product"
- Fill in product details:
- Name: Product title
- Description: Detailed description
- Image: Upload from local storage or provide URL
- Starting Price: Minimum bid amount
- End Time: When the auction should end
- Submit to create the auction
- View all auctions in the admin panel
- Edit existing auctions
- End auctions manually if needed
- Delete inappropriate listings
- View all bidders for each auction
- See payment status for won bids
- Verify Swish payments using provided phone numbers
- Update payment status once verified
The app supports both light and dark themes with automatic system preference detection.
To customize themes, edit src/contexts/ThemeContext.tsx:
// Custom theme colors can be added to tailwind.config.js
export const themes = {
light: {
background: "bg-white",
text: "text-gray-900",
// ... other properties
},
dark: {
background: "bg-gray-900",
text: "text-white",
// ... other properties
},
};Currently configured for Swish payments. To modify:
- Update QR code generation in
src/components/Dashboard/Dashboard.tsx - Modify payment verification logic
- Update admin verification interface
- Extends Supabase auth.users with additional profile information
- Fields: full_name, avatar_url, phone, address, is_admin
- Stores auction items
- Fields: name, description, image_url, starting_price, current_price, end_time, status
- Stores user bids on products
- Fields: product_id, bidder_id, amount, status, payment_status, payment_phone
- Automatically called to end expired auctions
- Determines winners and updates bid statuses
- Can be triggered by cron jobs
- Manual auction ending for admins
- Returns winner information
- Used by the admin interface
- Supabase Production Project (upgrade from free tier if needed)
- Domain name (optional but recommended)
- SSL Certificate (automatic with most hosting providers)
-
Connect Repository
# Push your code to GitHub/GitLab git remote add origin <your-repo-url> git push -u origin main
-
Deploy to Vercel
- Go to vercel.com
- Import your repository
- Add environment variables:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Deploy
-
Configure Domain (optional)
- Add your custom domain in Vercel settings
- Update DNS records as instructed
-
Build the Project
npm run build
-
Deploy to Netlify
- Drag and drop the
distfolder to Netlify - Or connect your repository for automatic deployments
- Configure environment variables in site settings
- Drag and drop the
-
Build for Production
npm run build
-
Upload Files
- Upload contents of
distfolder to your web server - Configure web server to serve
index.htmlfor all routes
- Upload contents of
- Verify environment variables are set correctly
- Test user registration and login
- Create a test auction as admin
- Test bidding functionality
- Verify payment flow works
- Check responsive design on mobile devices
- Test theme switching
- Verify real-time updates work
- User can sign up with email
- User can log in with credentials
- User profile is created automatically
- Password reset works (if implemented)
- Users can view all active auctions
- Auction details display correctly
- Time remaining updates in real-time
- Ended auctions show as ended
- Users can place bids on active auctions
- Bid amount validation works
- Real-time bid updates work
- Users can see their bid history
- Admin can create new auctions
- Image upload and compression works
- Admin can edit existing auctions
- Admin can end auctions manually
- Admin can see all bidders
- Payment verification interface works
- Won auction shows payment option
- QR code generates correctly
- Phone number submission works
- Admin can verify payments
Currently, the project doesn't include automated tests. To add testing:
# Install testing dependencies
npm install --save-dev @testing-library/react @testing-library/jest-dom vitest
# Add test scripts to package.json
"scripts": {
"test": "vitest",
"test:ui": "vitest --ui"
}Problem: App shows connection errors Solution:
- Ensure
.env.localfile is in the root directory - Verify variable names start with
VITE_ - Restart development server after changes
Problem: "Failed to fetch" errors Solution:
- Check Supabase project URL and API key
- Verify your Supabase project is active
- Check browser network tab for specific error details
Problem: SQL errors when running migration Solution:
- Ensure you have a fresh Supabase project
- Copy the entire migration file content
- Run in SQL Editor, not CLI
- Check for any existing tables with same names
Problem: Image upload fails with 400 error Solution:
- Verify storage bucket exists
- Check RLS policies are applied
- Ensure file size is reasonable (< 10MB)
- Check browser console for specific errors
Problem: Bids don't update in real-time Solution:
- Check browser network tab for WebSocket connections
- Verify Supabase real-time is enabled
- Check RLS policies allow reading bid data
- Try refreshing the page
- Optimize images (already implemented)
- Enable caching on your hosting provider
- Consider implementing lazy loading for auction lists
- Review and optimize queries
- Implement pagination for large auction lists
- Add database indexes for frequently queried fields
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Test thoroughly
- Manual testing of affected features
- Check responsive design
- Verify theme switching works
- Commit with descriptive messages
git commit -m "Add: detailed feature description" - Push and create Pull Request
- TypeScript: Use proper typing, avoid
any - React: Functional components with hooks
- CSS: Use Tailwind classes, avoid custom CSS when possible
- Functions: Keep functions small and focused
- Comments: Document complex logic and business rules
- Create component in
src/components/YourFeature/ - Add routing in
src/App.tsx - Update navigation if needed
- Add proper TypeScript interfaces
- Create migration file with timestamp
- Test migration on development database
- Update TypeScript interfaces in
src/lib/supabase.ts - Add RLS policies for security
This project is licensed under the MIT License - see the LICENSE file for details.
- Supabase Team - For the amazing Backend-as-a-Service platform
- Vercel Team - For the excellent hosting and build tools
- Tailwind CSS Team - For the utility-first CSS framework
- React Team - For the powerful frontend library
For support and questions:
- Check the troubleshooting section in this README
- Search existing GitHub issues
- Create a new issue with detailed information:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Browser and OS information
- Screenshots if relevant
Built with β€οΈ using React, TypeScript, Supabase, and Tailwind CSS
π Ready to start your auction platform? Follow the setup guide above and you'll be running FYNDAK in less than 30 minutes!