Don't let your vouchers expire. Trade. Earn. Repeat.
VoucherX is a modern web application that enables users to trade, buy, and sell vouchers before they expire. Built with React, TypeScript, and Supabase, it features an AI-powered assistant that helps users optimize their voucher portfolio and make smart trading decisions.
- ποΈ Marketplace: Browse and purchase verified vouchers from trusted sellers
- π Smart Exchange: AI-powered voucher matching for optimal trades
- πΌ Digital Wallet: Manage your active and redeemed vouchers in one place
- π Gamification: Complete challenges to earn VoucherCoins
- β€οΈ Wishlist: Track favorite brands and get notified of new deals
- π€ User Profiles: Manage your account, view stats, and track your trading history
- π€ AI Assistant: Get intelligent recommendations and insights
- π Portfolio Analysis: Analyze your voucher collection
- β° Expiry Tracking: Smart alerts for vouchers nearing expiration
- π° Discount Calculator: Calculate savings from multiple vouchers
- π― Smart Recommendations: Personalized trading suggestions
- β Voucher Verification: All vouchers are verified before listing
- β User Ratings: Transparent rating system for buyers and sellers
- π Secure Authentication: Powered by Supabase Auth
- π‘οΈ RLS Policies: Row-level security for data protection
- Node.js 18+ and npm
- Supabase account
- Git
- Clone the repository
git clone https://github.com/yourusername/voucherx.git
cd voucherx- Install dependencies
npm install- Set up environment variables
Create a .env file in the root directory:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key- Set up the database
- Go to your Supabase project dashboard
- Navigate to the SQL Editor
- Copy the contents of
DATABASE_QUERIES.mdand execute the SQL
- Run the development server
npm run dev- Open your browser
http://localhost:5173
voucherx/
βββ src/
β βββ components/ # React components
β β βββ AIAssistant.tsx # AI chat interface
β β βββ Auth.tsx # Authentication forms
β β βββ Layout.tsx # Main layout wrapper
β βββ contexts/ # React contexts
β β βββ AuthContext.tsx # Authentication context
β βββ pages/ # Page components
β β βββ Home.tsx
β β βββ Marketplace.tsx
β β βββ Exchange.tsx
β β βββ Wallet.tsx
β β βββ Challenges.tsx
β β βββ Wishlist.tsx
β β βββ Profile.tsx
β βββ utils/ # Utility functions
β β βββ aiAssistant.ts # AI logic and algorithms
β βββ lib/ # Third-party integrations
β β βββ supabase.ts # Supabase client
β βββ types/ # TypeScript type definitions
β β βββ index.ts
β βββ App.tsx # Main app component
β βββ main.tsx # App entry point
β βββ index.css # Global styles
βββ supabase/
β βββ migrations/ # Database migrations
βββ public/ # Static assets
βββ DATABASE_QUERIES.md # Complete database schema
βββ package.json
βββ vite.config.ts
βββ tailwind.config.js
βββ tsconfig.json
- profiles: User accounts and statistics
- vouchers: Marketplace voucher listings
- trades: Voucher exchange transactions
- transactions: Purchase history
- user_vouchers: User's voucher wallet
- ratings: User reviews and ratings
- challenges: Gamification challenges
- user_challenges: Challenge progress tracking
- wishlists: User wishlist items
- notifications: User notifications
See DATABASE_QUERIES.md for the complete schema with all tables, policies, and indexes.
- React 18.3.1: UI library
- TypeScript 5.5.3: Type safety
- Vite 5.4.2: Build tool and dev server
- Tailwind CSS 3.4.1: Utility-first CSS framework
- Lucide React: Icon library
- Supabase: Backend-as-a-Service
- PostgreSQL database
- Authentication
- Row Level Security
- Real-time subscriptions
- ESLint: Code linting
- TypeScript ESLint: TypeScript-specific linting
- PostCSS: CSS processing
- Autoprefixer: CSS vendor prefixing
The AI Assistant provides:
- Real-time portfolio analysis
- Expiry status monitoring
- Multi-voucher discount calculations
- Smart trade recommendations
- Portfolio optimization suggestions
Matches vouchers based on:
- Value similarity
- Brand popularity
- Expiry dates
- User preferences
- Trading history
Earn coins by:
- Completing daily/weekly challenges
- Trading vouchers
- Maintaining high ratings
- Verifying vouchers
Use coins for:
- Fee-free trades (500+ coins)
- Premium features
- Real voucher redemption
- Row Level Security (RLS): Database-level access control
- Authentication: Secure email/password authentication via Supabase
- Data Validation: Client and server-side validation
- Secure Code Storage: Voucher codes protected and encrypted
- User Verification: Voucher verification system
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Run linting
npm run lint
# Type checking
npm run typecheck- Push your code to GitHub
- Import your repository in Vercel
- Add environment variables
- Deploy
The app can be deployed to any static hosting service (Netlify, AWS S3, etc.)
# Build the app
npm run build
# Deploy the 'dist' folderContributions are welcome! Please follow these steps:
- Fork the repository
- Create a 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
Required environment variables:
| Variable | Description | Example |
|---|---|---|
VITE_SUPABASE_URL |
Your Supabase project URL | https://xxxxx.supabase.co |
VITE_SUPABASE_ANON_KEY |
Your Supabase anonymous key | eyJhbGc... |
Issue: Database connection fails
- Solution: Verify your Supabase credentials in
.env
Issue: Tables not found
- Solution: Run the SQL from
DATABASE_QUERIES.mdin Supabase SQL Editor
Issue: Authentication not working
- Solution: Check Supabase Auth settings and ensure email confirmation is configured
Issue: Build fails
- Solution: Clear node_modules and reinstall:
rm -rf node_modules && npm install
For detailed documentation on specific features:
- Push notifications for expiring vouchers
- Mobile app (React Native)
- Social sharing features
- Advanced analytics dashboard
- Multi-language support
- Payment gateway integration
- Auction system for rare vouchers
- Referral program
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - GitHub
- Supabase for the amazing backend platform
- Tailwind CSS for the utility-first CSS framework
- Lucide for the beautiful icons
- Vite for the lightning-fast build tool
For support, email support@voucherx.com or open an issue in the GitHub repository.
Built with β€οΈ by the VoucherX Team
Don't let your vouchers expire. Trade. Earn. Repeat.