ShopSmart
Health Gecti
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 12 GitHub stars
Code Gecti
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
AI-powered shopping assistant to search, compare, and track product prices across Vietnamese e-commerce sites — built with Google Gemini, Flask, and a multi-user backend.
🛒 ShopSmart AI Agent
AI-powered shopping assistant that helps you find the best deals, compare prices, and track product prices across the web.
Features
- Multi-user accounts — Register/login with JWT auth; every user's tracked products, chats and notifications are private to them
- AI Chat Interface — Chat naturally to search products and compare prices
- Web Search Tool — Search across the internet for products and deals
- Price Scraper — Extract prices from product pages automatically (site-specific selectors + sane price-range validation)
- Price Tracking — Track products and monitor price changes over time
- Auto price monitor — Background job re-scrapes tracked products on a schedule and records history
- Price Analysis — AI-powered trend analysis and buying recommendations
- Real notifications — In-app alerts plus optional Telegram / email push when a price drops or hits your target
Tech Stack
| Component | Technology |
|---|---|
| AI Brain | Google Gemini 2.5 Flash (google-genai SDK) |
| Backend | Python + Flask |
| Auth | JWT (PyJWT) + bcrypt |
| Database | SQLite |
| Frontend | HTML + CSS + JavaScript |
| Charts | Chart.js |
| Search | DuckDuckGo Search |
| Push channels | Telegram Bot API, SMTP email |
| Tests | pytest |
Quick Start
1. Clone & Install
git clone https://github.com/YOUR_USERNAME/ShopSmart.git
cd ShopSmart
pip install -r requirements.txt
2. Set API Key
Get a free Gemini API key from Google AI Studio.
# Windows PowerShell
$env:GEMINI_API_KEY='your_api_key_here'
# Windows CMD
set GEMINI_API_KEY=your_api_key_here
# Linux/Mac
export GEMINI_API_KEY='your_api_key_here'
3. Run
python app.py
Open http://127.0.0.1:5000 in your browser, then register an account to get started.
app.py is the development server (Werkzeug). For production, see Deployment.
Configuration
Copy .env.example to .env and fill in what you need. Only GEMINI_API_KEY is required.
| Variable | Purpose |
|---|---|
GEMINI_API_KEY |
Gemini API key (required for AI chat) |
JWT_SECRET |
Secret for signing auth tokens. Set this in production. A local one is auto-generated for dev. |
FLASK_DEBUG |
true to enable debug mode (default off) |
PRICE_MONITOR_ENABLED |
false to disable the background price monitor |
PRICE_MONITOR_INTERVAL |
Seconds between scan cycles (default 6h) |
PRICE_MONITOR_IN_PROCESS |
false to stop the web process from starting the monitor (use with a separate monitor.py when running multiple workers) |
TELEGRAM_BOT_TOKEN |
Enable Telegram price alerts |
SMTP_HOST / SMTP_USER / SMTP_PASSWORD |
Enable email price alerts |
SERVE_THREADS |
Waitress worker threads (default 8) |
Deployment
app.py is the Flask dev server — don't use it in production. Use a real WSGI server instead.
Single process (waitress, cross-platform incl. Windows)
python serve.py
# or: waitress-serve --host=0.0.0.0 --port=5000 wsgi:app
The background price monitor starts in-process — fine for a single process.
Multiple workers (e.g. gunicorn on Linux)
Running N workers would spawn N monitors and scrape every product N times. To avoid
that, disable the in-process monitor and run one dedicated monitor process:
# .env: PRICE_MONITOR_IN_PROCESS=false
gunicorn -w 4 -b 0.0.0.0:5000 wsgi:app # web workers
python monitor.py # single monitor process
Always set JWT_SECRET to a fixed value in production so tokens survive restarts.
Testing
pytest
Tests run against an isolated temporary SQLite database — they never touch shopsmart.db.
Architecture
ShopSmart/
├── app.py # Flask server & API endpoints
├── config.py # Configuration
├── requirements.txt # Python dependencies
├── agent/
│ ├── core.py # AI Agent with ReAct loop
│ ├── prompts.py # System prompts
│ └── tools/
│ ├── web_search.py # DuckDuckGo product search
│ ├── price_scraper.py# Price extraction from URLs
│ ├── price_tracker.py# Database price tracking
│ ├── price_analyzer.py# Price trend analysis
│ └── notifier.py # Notification system
├── database/
│ ├── db.py # SQLite connection & schema
│ └── models.py # Data models (CRUD)
└── frontend/
├── index.html # Single-page application
├── css/ # Dark theme UI styles
└── js/ # Chat, dashboard, notifications
Agent Tools
| Tool | Description |
|---|---|
search_product |
Search products across the web |
scrape_price |
Extract price from a product URL |
track_price |
Add product to price watchlist |
analyze_price |
Analyze price trends & recommendations |
get_tracked_products |
View all tracked products |
send_notification |
Create price drop alerts |
License
MIT License
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi