This project is a small coupon finder web app with:
frontend/ folder for a clean search interfacebackend/ Flask API for live public-page searchUsers type a company or store name, and the app:
The app does not attempt checkout and does not brute-force codes.
This version is now using live public-page search instead of mock-only data.
Important caveats:
The backend is built to handle these cases and return warnings when live sources are weak or blocked.
backend/
app.py
search_sources.py
extract_codes.py
rank_codes.py
frontend/
index.html
style.css
script.js
Install dependencies:
python -m pip install -r requirements.txt
python backend/app.py
Open frontend/index.html in your browser.
The frontend expects the backend API at:
http://127.0.0.1:5000
GET /api/healthSimple health check.
Example:
http://127.0.0.1:5000/api/health
GET /api/search?store=<name>Searches live public coupon-related pages for the given store.
Example:
http://127.0.0.1:5000/api/search?store=The%20IT%20Bay
Example response shape:
{
"store": "The IT Bay",
"warning_count": 1,
"warnings": [
"Direct coupon source fallback did not find any usable pages."
],
"result_count": 2,
"results": [
{
"code": "TRS3",
"score": 16,
"source_count": 2,
"summary": "3% off",
"sources": [
{
"title": "The IT Bay Coupon Codes",
"url": "https://example.com/page",
"context": "The IT Bay coupons. Get code TRS3 for 3% off any order..."
}
]
}
]
}
3% offView details button for source titles, URLs, and contextThe backend currently:
It also handles common user mistakes such as:
TheITBay instead of The IT BayDuring testing, live public pages for The IT Bay surfaced listings that mentioned codes such as:
TRS3E100VE60Those came from public coupon pages such as:
icopyexpert.compdfzilla.comdontpayfull.comThat does not guarantee a code still works at checkout, only that it appears on public source pages.
This structure is suitable for:
frontend/ on GitHub Pages or any static hostbackend/ on Render or another Flask-compatible hostFor deployment, you will usually want to:
window.COUPON_API_BASE_URL in the frontend to your deployed API URLGood next steps would be: