Mobile App for Coupons and Discounts
A coupons and discounts app looks simple until you need to integrate geolocation ("discounts near me"), push notifications ("you're at a mall — here's a discount"), partner APIs of retail chains, and fraud-proof coupon redemption. Each of these blocks has non-trivial technical details.
Location-Based Offers
"Discounts nearby" — either simple API query with current coordinates, or proximity marketing via geofencing.
Simple variant: user opens app → current coordinates → GET /offers?lat=55.75&lng=37.61&radius=1000. Works only with open app.
Geofencing: app registers geofences around partner locations. On entry — push with current discounts for this store. iOS — CLCircularRegion, limit 20 regions simultaneously. For 500 partners — need dynamic registration of nearest 20 on location change.
Algorithm: on significant location change (startMonitoringSignificantLocationChanges()) — request 20 nearest stores, re-register geofences. Android — similar, via GeofencingClient with 100 geofence limit.
BLE-beacon proximity (Eddystone, iBeacon): app detects beacons in store — push with personalized offer. CoreBluetooth / Android BluetoothLeScanner. Requires partner to install beacons, complicating B2B. But accuracy — meters, not hundreds of meters.
Coupon Display and Filtering
Coupon list — RecyclerView (Android) / LazyVStack (SwiftUI). Card: image, store name, discount size, expiration, distance. Skeleton loading while loading.
Filters: category, distance, discount %, online/offline. Sorting: by distance, by discount size, by expiration. All on server — client only passes filter params.
Card flip-animation for showing coupon terms — CATransform3DMakeRotation (UIKit) / .rotation3DEffect (SwiftUI). Optional but looks lively.
Coupon Activation and Redemption Without Fraud
Key technical task. Coupon can't be static QR — can be photographed and reused many times.
One-time token: on "use" click — server request, server generates JWT with exp: now + 300sec and used: false. QR with token shows 5 minutes. Cashier scans → server marks used: true. Rescan — error "coupon already used".
Dynamic QR: QR changes every 30 seconds (TOTP approach). Server knows current value, cashier sees current code. More complex implementation, screenshot protection.
Store barcode: user shows loyalty card number, discount applies at register automatically. Requires integration with partner's POS software.
For most cases — one-time token with 5-minute lifetime sufficient.
Personalization and Categories
User coupon history → ML recommendations (optional). Simple variant without ML: interest categories in profile, push only for interested categories. User selected "cafe" and "sports" — doesn't get clothing coupons.
Favorite stores: subscription to discounts from specific partner. New coupon appears — push with deep link to coupon card.
Partner Integration
Partner cabinet (web) — separate topic. Mobile only consumes API. But API must support different coupon models: percentage discount, fixed amount, "buy N get M", bonus points.
Cashback — user showed coupon, cashier confirmed via partner terminal → app credits points. Point balance in app, accrual history, withdrawal or coupon exchange.
Stack: Flutter or React Native, Google Maps SDK for store map, Firebase Cloud Messaging for push, Mapbox for geofencing (or native APIs), CoreBluetooth / BLE for beacon.
Timeline: 8 to 14 weeks. Cost calculated individually.







