Skip to content

jaiashwinisatish/VoucherX

Repository files navigation

VoucherX | Save with AI

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.

VoucherX License React TypeScript Supabase

🌟 Features

Core Features

  • πŸ›οΈ 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-Powered Features

  • πŸ€– 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

Security & Trust

  • βœ… 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

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Supabase account
  • Git

Installation

  1. Clone the repository
git clone https://github.com/yourusername/voucherx.git
cd voucherx
  1. Install dependencies
npm install
  1. 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
  1. Set up the database
  • Go to your Supabase project dashboard
  • Navigate to the SQL Editor
  • Copy the contents of DATABASE_QUERIES.md and execute the SQL
  1. Run the development server
npm run dev
  1. Open your browser
http://localhost:5173

πŸ“ Project Structure

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

πŸ—„οΈ Database Schema

Core Tables

  • 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.

🎨 Tech Stack

Frontend

  • 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

Backend

  • Supabase: Backend-as-a-Service
    • PostgreSQL database
    • Authentication
    • Row Level Security
    • Real-time subscriptions

Development Tools

  • ESLint: Code linting
  • TypeScript ESLint: TypeScript-specific linting
  • PostCSS: CSS processing
  • Autoprefixer: CSS vendor prefixing

πŸ“š Key Features Explained

AI Assistant

The AI Assistant provides:

  • Real-time portfolio analysis
  • Expiry status monitoring
  • Multi-voucher discount calculations
  • Smart trade recommendations
  • Portfolio optimization suggestions

Smart Exchange

Matches vouchers based on:

  • Value similarity
  • Brand popularity
  • Expiry dates
  • User preferences
  • Trading history

VoucherCoins System

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

πŸ” Security Features

  • 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

🚦 Available Scripts

# 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

🌐 Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import your repository in Vercel
  3. Add environment variables
  4. Deploy

Other Platforms

The app can be deployed to any static hosting service (Netlify, AWS S3, etc.)

# Build the app
npm run build

# Deploy the 'dist' folder

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ Environment Variables

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...

πŸ› Troubleshooting

Common Issues

Issue: Database connection fails

  • Solution: Verify your Supabase credentials in .env

Issue: Tables not found

  • Solution: Run the SQL from DATABASE_QUERIES.md in 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

πŸ“– Documentation

For detailed documentation on specific features:

🎯 Roadmap

  • 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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Authors

πŸ™ Acknowledgments

  • 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

πŸ“ž Support

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.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages