Your AI-Powered Local Business Discovery Platform
A comprehensive full-stack application that helps users discover local offers, deals, and business information through an intelligent AI assistant. Built with FastAPI, React, and advanced AI capabilities including voice recognition, OCR, and multilingual support.](https://python.org)
- ๐ Live Demo
- ๐ฏ Features
- ๐ Project Structure
- ๐ Technology Stack
- ๐ Quick Start](#-quick-start)
- ๐ฑ Usage Examples
- ๐ช Business Data
- ๐ง API Documentation
- ๐จ UI/UX Features
- ๐ Security & Privacy
- ๐ Deployment
- ๐ค Contributing
- ๐ Performance Metrics
- ๐ฎ Future Roadmap
- ๐ Support
- ๐ License
- ๐ Acknowledgments
- ๐ Web Application: https://know-your-local-offers.vercel.app
- ๐ฑ WhatsApp Bot: +155523 API Documentation**: https://know-your-local-offers.railway.app/docs
- ๐ฅ Demo Video: Watch Demo
- Intelligent Chat Interface - Natural language processing for offer queries
- Multilingual Support - English and Hindi language support
- Voice Recognition - Speech-to-text capabilities with browser and server-side processing
- Text-to-Speech - Audio responses for accessibility using ElevenLabs
- OCR Integration - Extract text from images and documents using EasyOCR
- Context Awareness - Remembers conversation history and user preferences
- Web Application - Modern React frontend with real-time chat
- WhatsApp Integration - Twilio-powered WhatsApp bot for mobile users
- RESTful API - Complete API for third-party integrations
- WebSocket Support - Real-time communication for live updates
- Local Business Database - Comprehensive jewelry shop data for Kolhapur
- Offer Management - Add, search, and filter local offers
- City-wise Categorization - Organized by cities and business categories
- Real-time Updates - Dynamic offer discovery and notifications
- Analytics Dashboard - Track user interactions and business performance
- Full-Stack Architecture - FastAPI backend + React frontend
- Database Integration - Supabase for data persistence and real-time features
- Real-time Communication - WebSocket-ready architecture
- Responsive Design - Mobile-first approach with Tailwind CSS
- Type Safety - TypeScript throughout the stack
- Docker Support - Containerized deployment ready
know-your-local-offers/
โโโ ๐ฏ backend/ # FastAPI Backend
โ โโโ app.py # Main FastAPI application
โ โโโ chat_handler.py # AI chat processing
โ โโโ voice_handler.py # Speech recognition & synthesis
โ โโโ ocr_handler.py # Image/document text extraction
โ โโโ database_service.py # Database operations
โ โโโ supabase_client.py # Supabase integration
โ โโโ tests/ # Backend tests
โ โโโ requirements.txt # Python dependencies
โโโ ๐จ frontend/ # React Frontend
โ โโโ src/
โ โ โโโ App.tsx # Main React component
โ โ โโโ api.ts # API integration
โ โ โโโ tests/ # Frontend tests
โ โ โโโ index.css # Styling
โ โโโ package.json # Node.js dependencies
โ โโโ vite.config.ts # Build configuration
โโโ ๐ data/ # Business Data
โ โโโ kolhapur_jewelry_shops_comprehensive.csv
โ โโโ sample_jewelry_shops_structure.csv
โโโ ๐๏ธ database/ # Database Schema
โ โโโ schema.sql # PostgreSQL schema
โโโ ๐ง scripts/ # Data Collection Scripts
โ โโโ jewelry_scraper_comprehensive.py
โ โโโ csv_viewer.py
โโโ ๐ณ docker-compose.yml # Docker orchestration
โโโ ๐ docs/ # Documentation
โ โโโ API_DOCUMENTATION.md
โ โโโ DEPLOYMENT.md
โ โโโ CONTRIBUTING.md
โโโ ๐ setup.sh # Development setup script
- FastAPI - Modern, fast web framework with automatic API documentation
- **OpenAI GPT-4vanced AI language model for natural conversations
- ElevenLabs - High-quality text-to-speech with multiple voices
- EasyOCR - Optical character recognition for document processing
- Supabase - Database, authentication, and real-time features
- Twilio - WhatsApp integration and SMS capabilities
- Uvicorn - ASGI server for production deployment
- React 18 - Modern UI framework with hooks and concurrent features
- TypeScript - Type-safe development with better IDE support
- Tailwind CSS - Utility-first styling for rapid development
- Vite - Fast build tool with hot module replacement
- Axios - HTTP client for API communication
- React Testing Library - Component testing framework
- OpenAI API - Natural language processing and generation
- Speech Recognition - Browser-based and server-side speech processing
- Text-to-Speech - Web Speech API + ElevenLabs for high-quality audio
- OCR Processing - Image and document text extraction
- Sentiment Analysis - User feedback and review analysis
- Docker - Containerization for consistent deployment
- GitHub Actions - CI/CD pipeline with automated testing
- Railway - Backend hosting and deployment
- Vercel - Frontend hosting with edge functions
- Supabase - Database hosting and management
- **Python 30.12- Download Python
- *Node.js18 -Download Node.js](https://nodejs.org/)
- Git - Download Git
- OpenAI API Key - Get API Key
- ElevenLabs API Key - Get API Key (optional)
- Supabase Account - Sign Up
- Twilio Account - Sign Up (for WhatsApp)
git clone https://github.com/Shriiii1now-your-local-offers.git
cd know-your-local-offers
# Make setup script executable
chmod +x setup.sh
# Run automated setup
./setup.sh
###3Setup (Alternative)
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
cd backend
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your API keys
cd frontend
npm install
# Set up environment variables
cp .env.example .env
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
# ElevenLabs (Optional - for voice synthesis)
ELEVENLABS_API_KEY=your_elevenlabs_key_here
# Supabase Database
SUPABASE_URL=your_supabase_url_here
SUPABASE_KEY=your_supabase_anon_key_here
# Twilio (for WhatsApp integration)
TWILIO_ACCOUNT_SID=your_twilio_sid_here
TWILIO_AUTH_TOKEN=your_twilio_token_here
# Application Settings
ENVIRONMENT=development
DEBUG=true
CORS_ORIGINS=http://localhost:5173,http://localhost:300```
#### Frontend (.env)
```env
# API Configuration
VITE_API_URL=http://localhost:80
VITE_WS_URL=ws://localhost:8000/ws
# Application Settings
VITE_APP_NAME=Know Your Local Offers
VITE_APP_VERSION=1TE_APP_DESCRIPTION=AI-powered local business discovery platform
# Feature Flags
VITE_ENABLE_VOICE=true
VITE_ENABLE_OCR=true
VITE_ENABLE_WHATSAPP=true
# Start development servers
chmod +x start-dev.sh
./start-dev.sh
Visit `http://localhost:5173ss the application!
- Voice Input: Click microphone for speech recognition
- Document Upload: Upload images/documents for OCR processing 4timodal**: Combine text, voice, and documents
Send messages like:
- "gold offers in Kolhapur" -jewelry discount in Sangli"
- "latest deals in Pune"
- "find diamond shops near me"
# Get offers by city
GET /api/offers?city=kolhapur&category=jewelry
# Add new offer
POST /api/offers[object Object]
store_name": Tanishq,city: apur,
category": "jewelry,
offer_text": "20% off on gold jewelry"
}
# Chat with AI
POST /api/chat
{
message": "Find jewelry offers in Kolhapur,
language":en
}
# Extract text from image
POST /ocr
Content-Type: multipart/form-data
file: [image file]
The application includes comprehensive jewelry shop data for Kolhapur:
- National Chains: Tanishq, Kalyan Jewellers, Malabar Gold
- Premium Brands: TBZ, Waman Hari Pethe, Orra
- Local Establishments: Shree Jewellers, Nakshatra Jewels
- Business names and addresses
- Contact information (phone, email, website)
- Operating hours and location
- Ratings and reviews
- Business categories and specialties
- Offer history and current promotions
- Total Shops: 20+ verified businesses
- Data Completeness: 95%+ field completion
- Accuracy: Manually verified information
- Updates: Regular data refresh cycles
Endpoint | Method | Description | Authentication |
---|---|---|---|
/api/chat |
POST | AI chat interface | Optional |
/api/offers |
GET | Get local offers | Public |
/api/offers |
POST | Add new offer | Required |
/api/cities |
GET | Available cities | Public |
/api/categories |
GET | Business categories | Public |
/ocr |
POST | Extract text from images | Optional |
/voice/transcribe |
POST | Speech-to-text | Optional |
/voice/synthesize |
POST | Text-to-speech | Optional |
/webhook/twilio |
POST | WhatsApp integration | Webhook |
Real-time communication for live chat updates and notifications.
- Standard endpoints: 100 requests per minute
- AI endpoints: 10 requests per minute
- File upload endpoints: 20 requests per minute
- Responsive Layout - Works perfectly on all devices
- Dark/Light Mode - User preference support with system detection
- Smooth Animations - Enhanced user experience with micro-interactions
- Accessibility - WCAG 2.1pliant with screen reader support
- Real-time Chat - Instant message updates with typing indicators
- Voice Controls - Speech input/output with visual feedback
- File Upload - Drag & drop support with progress indicators
- Search & Filter - Advanced offer discovery with autocomplete
- Favorites System - Save and manage favorite offers
- Touch-friendly - Optimized for mobile interactions
- Offline Support - Basic functionality without internet
- Push Notifications - Real-time offer alerts
- Progressive Web App - Install as native app
- API Key Management - Secure environment variables
- Input Validation - Pydantic models for data validation
- CORS Configuration - Controlled cross-origin requests
- Rate Limiting - API abuse prevention
- Data Encryption - Secure data transmission (HTTPS/WSS)
- User Consent - Clear privacy policy and consent management
- Data Minimization - Only collect necessary information
- Anonymization - Optional anonymous usage
- Data Retention - Configurable data retention policies
- Input Sanitization - Prevent XSS and injection attacks
- Authentication - JWT-based secure authentication
- Authorization - Role-based access control
- Audit Logging - Comprehensive security event logging
# Install Railway CLI
npm install -g @railway/cli
# Login and deploy
railway login
railway init
railway up
# Install Heroku CLI
heroku create your-app-name
heroku config:set OPENAI_API_KEY=your_key
git push heroku main
# Build and run with Docker
docker build -t know-your-local-offers-backend .
docker run -p 800now-your-local-offers-backend
# Install Vercel CLI
npm install -g vercel
# Deploy
vercel --prod
# Build and deploy
npm run build
# Drag dist folder to Netlify
Ensure all environment variables are configured in your deployment platform.
We welcome contributions from the community! Please follow these steps:
- Fork the repository2*Clone** your fork:
git clone https://github.com/YOUR_USERNAME/know-your-local-offers.git
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and add tests
5mit** your changes:
git commit -m 'Add amazing feature'
6sh** to the branch:git push origin feature/amazing-feature
7n** a Pull Request
- Code Style: Follow TypeScript and Python best practices
- Testing: Add tests for new features and maintain >80% coverage
- Documentation: Update README and API docs for new features
- Commits: Use conventional commit messages
- Reviews: All PRs require at least one review
We provide templates for:
- ๐ Bug reports
- ๐ก Feature requests
- ๐ Documentation improvements
- ๐ง Setup questions
- AI Chat: <2s average response time
- API Endpoints: < 500tandard operations
- File Upload: < 5nds for 10MB files
- Database Queries: <100indexed operations
- Concurrent Users: 1000simultaneous users
- Database: Horizontal scaling ready
- Caching: Redis-based caching layer
- CDN: Global content delivery network
- Uptime: 99.9vailability target
- Error Rate: <01error rate
- Recovery: < 5utes recovery time
- Backup: Automated daily backups
- Advanced NLP capabilities with custom training
- Sentiment analysis for reviews and feedback
- Personalized recommendations engine
- d offer management system
- Customer feedback and review system
- Loyalty program integration
- Push notifications for offers
- Offline support with sync
- ion-based services
- Blockchain integration for offers
- AI-powered business insights
- Social commerce features
- Advanced analytics and reporting
- White-label solutions
- erprise API access
- ๐ง Email: [email protected]
- ๐ Issues: GitHub Issues
- ๐ Documentation: Wiki
- ๐ฌ Discussions: GitHub Discussions
- ๐ API Docs: Interactive API Documentation
- Discord: Join our community
- Twitter: Follow us
- LinkedIn: Connect with us
- System Status: status.knowyourlocaloffers.com
- Uptime Monitor: Real-time system monitoring
- Incident History: Transparent incident reporting
This project is licensed under the MIT License - see the LICENSE file for details.
- โ Commercial Use: Allowed
- โ Modification: Allowed
- โ Distribution: Allowed
- โ Private Use: Allowed
- โ Liability: Limited
- โ Warranty: None
- OpenAI for GPT-4ntegration and API
- ElevenLabs for high-quality voice synthesis
- Supabase for database and authentication services
- Twilio for WhatsApp integration and communication
- FastAPI community for excellent documentation and support
- React Team for the amazing frontend framework
- Tailwind CSS for the utility-first styling approach
- Vite for the fast build tool
- TypeScript for type safety and developer experience
- Local Business Owners for providing data and feedback
- Beta Testers for valuable insights and bug reports
- Open Source Community for inspiration and collaboration