DEUCENG Graduation/Senior Project · 2026

AI-Driven
Loyalty Platform
for SMEs

Replacing paper stamp cards with intelligent digital loyalty. Built with .NET 10, Python ML, and React Native — production-ready from day one.

0
Unit & Integration Tests
0
Campaign Types
0
AI/ML Capabilities
3
Client Applications
My Wallet
2,840 pts
Across 3 cafes
GBYF CAFE
1,200 pts · Champion
DEU SKS Daire Başk.
960 pts · Loyal
Joy Cafe
680 pts · New

Paper stamps are killing your business

Small cafes lose customers every day to poor retention tooling. LoyaltyWallet closes every gap — from data blindness to manual reward tracking.

❌ Problem
✅ LoyaltyWallet Solution
🃏Paper stamp cards are lost or forgotten
Cloud-synced digital wallet — always in the customer's pocket, across all enrolled cafes
📊Zero customer data or behavioral insights
Full analytics pipeline: RFM segmentation, churn prediction, LTV modeling, anomaly detection
📣One-size-fits-all promotions that underperform
9 distinct campaign types + AI-generated targeting down to a single user ID
😔No way to detect or recover churning customers
ML churn prediction with per-user risk scores and AI-recommended win-back campaigns
⏱️Manual, error-prone reward tracking
Real-time event-driven point engine — SignalR delivers balance updates in under 1 second
↑ CLTV
Customer Lifetime Value
↓ Churn
Predicted & Prevented
↑ Repeat
Visit Rate
1-to-1
Personalized Marketing

Every user gets a tailored experience

One backend, three specialized frontends — each built for the exact workflow of its user.

📈
Real-Time KPI Dashboard
Daily revenue, transaction count, active users, and active campaigns — updated live via SignalR.
🔥
Peak-Hours Heatmap
7×24 grid showing busiest hours across the last 90 days. Identify rush periods at a glance.
💰
Points Economy Panel
Total points issued, redeemed, outstanding, and redemption rate — full health check on your loyalty economy.
📉
Campaign Drop-off Heatmap
Shows at which progress step customers abandon each campaign. Reveals if stamp goals are too ambitious.
🏆
Cashier Leaderboard
Staff ranked by total transactions, revenue, avg basket, and transactions-per-shift-hour. Peer coaching insights included.
☠️
Dead-SKU Report
Flags menu items with zero sales in a configurable window. Remove, reprice, or bundle slow movers.
👥
User Management
Paginated list with drill-down per user: transaction history, streak, rewards, RFM segment, churn score, LTV.
📋
Audit Log Viewer
Full change trail — old/new JSON diff, actor identity, IP address, and timestamp for every entity mutation.
📤
CSV Export
One-click export for Transactions, Users, and Campaign Performance reports.
👛
Multi-Cafe Wallet
See point balances across all enrolled cafes in one screen, sorted by nearest first using geolocation.
🗺️
Cafe Discovery
Browse cafes sorted by geolocation distance. View active campaigns with progress indicators before visiting.
📷
Path 1 — Scan Cashier QR
Cashier generates a purchase QR; user scans in-app. Points earned instantly; bonuses evaluated async via RabbitMQ.
Standard Flow
🛒
Path 2 — User-Initiated Cart QR
Build a cart in-app with products, quantities, and apply a reward discount. Generate a signed QR the cashier scans at the counter.
Advanced Flow
🎰
Lucky Wheel Spin
Qualifying purchases earn spin tokens. Animated prize wheel with configurable outcomes, cooldown, and per-user spin caps.
🔗
Referral System
Generate a personal referral code, share via native share sheet. Track total referrals; both referrer and referee rewarded.
🔔
Push Notifications
Campaign offers, streak reminders, reward expiry warnings, and transaction confirmations — with notification inbox.
🛡️
GDPR Controls
Data export and account deletion request endpoints — user controls their data.
🧾
Generate Purchase QR
Enter the purchase amount and generate a QR code instantly. Show to the customer for scanning — no hardware required.
📸
Scan End-User Cart QR
Scan the customer's cart QR code to preview full order details, quantities, and any applied reward discounts. Confirm or reject.
🎁
Reward Redemption Scanner
Scan reward redemption QR codes — validated server-side in real time. Marks rewards as redeemed atomically.
Real-Time SignalR Feedback
Green flash and success animation on confirmed transactions. Instant error feedback if a QR is invalid or expired.
Standard Cashier Flow
💵
Enter
Amount
📟
Generate
QR Code
📷
Customer
Scans
🐇
RabbitMQ
Event
⚙️
Campaign
Engine
Points +
Notification

9 campaign types, zero duplicated code

Each campaign type is a separate Strategy pattern evaluator. Adding a new type requires zero changes to existing code — open/closed by design.

01
✖️
Points Multiplier
2× or 3× points on every purchase, or only above a configurable minimum spend threshold.
02
🍱
Combo Reward
Buy a specific product combination and receive a free item or discount automatically applied.
03
Time-Based
Extra rewards only during a defined time window — Happy Hour with optional random probability.
04
🔥
Visit Streak
Consecutive-day visit streaks with configurable grace periods. Streak resets after reward is claimed.
05
Spend Threshold
Earn stars per ₺ spent. Redeem your reward once you hit the configurable star threshold.
06
👑
Tiered Membership
Silver / Gold / Platinum tiers with per-tier benefits: free items every N visits, birthday rewards, and more.
07
🔗
Referral
Share a personal code — both referrer and referee rewarded. Anti-circular and fraud guards built in.
08
🎰
Lucky Wheel
Qualifying purchases earn spin tokens. Configurable prizes with probability weights, cooldown, and per-user caps.
09
🎉
First Purchase Bonus
One-time welcome bonus for new customers, optionally restricted to an onboarding time window.
🎯 Targeted Campaigns: Any campaign can include a TargetUserIdsJson list — enabling one-to-one personalized marketing to a single VIP or an entire RFM segment. This is a commercial feature usually found only in enterprise platforms.

Nine ML capabilities, two strategies

Deterministic scikit-learn pipelines give explainable results. LLM integration adds creative, natural-language workflows. Both coexist behind a tabbed UI — nightly scheduled by Celery.

📊
RFM Segmentation
K-Means · scikit-learn
Classifies every customer as Champion, Loyal, At-Risk, New, or Dormant based on Recency / Frequency / Monetary scores.
📉
Churn Prediction
Logistic Regression · scikit-learn
Per-user churn risk score with top contributing factors ("last visit 21 days ago", "avg basket declining"). Color-coded green / amber / red badges.
📈
Revenue Forecast
Exponential Smoothing · statsmodels
7–30 day time-series forecast with upper and lower confidence bands displayed on an interactive chart.
💎
Customer LTV
BG/NBD + Gamma-Gamma
Predicted 90-day revenue per customer using BG/NBD probability model. Sortable leaderboard with segment labels.
🚨
Anomaly Detection
Isolation Forest · scikit-learn
Flags statistical outliers in transaction data — suspicious bulk point events, cashier spikes, unusual purchase patterns.
💡
Campaign ROI Predictor
Regression · Python
Before launching a campaign, estimates expected uplift, redemption rate, and revenue delta from historical patterns.
🤖
AI Campaign Recommendation
4-Stage Deterministic Pipeline
Segmentation → Product Affinity → Cafe Metrics → Campaign Decision. Scores every campaign type and picks the winner with reason codes.
✍️
LLM Campaign Suggestion
LangChain · Groq / Anthropic
Type a natural-language prompt ("suggest a weekend deal for at-risk customers") — the system returns a fully-drafted campaign with name, description, and settings.
💬
"Ask Your Cafe" Chatbot
NL-to-SQL · LangChain
Admin types "what was my busiest hour last month?" — the LLM generates and executes a read-only SQL query on the tenant DB and returns natural-language results.
🔄 Feedback Loop: AI campaign outcomes are tracked in ai_campaign_feedback (Hangfire, 3-retry, batch 200) and fed back to the Python service — the AI learns which campaign types perform better per tenant over time.

Production-ready from day one

Not a toy project — multi-tenant isolation, circuit breakers, idempotency via inbox pattern, audit logging, and Azure Container Apps deployment.

Layer Technology
Backend API .NET 10ASP.NET CoreClean ArchitectureCQRS · MediatR
Background Worker .NET 10 Worker ServiceMassTransitHangfire
ML / AI Service Python 3.12FastAPIscikit-learnLangChainCelery
Database PostgreSQL 17EF CorePer-Tenant DB
Cache / Messaging RedisRabbitMQ
Mobile Apps React Native (Expo)TypeScriptEAS Build
Admin Dashboard React 19 · ViteTypeScriptTanStack Query
Real-Time ASP.NET Core SignalR
Cloud Azure Container AppsKey VaultBlob StorageStatic Web Apps
Observability SerilogPrometheusPostHogAzure Log Analytics
End User App React Native · Expo Cashier App React Native · Expo Admin Dashboard React · Vite · RTK Query API .NET 10 · ASP.NET Core Clean Arch · CQRS · MediatR JWT Auth · Rate Limiting SignalR Hub · Audit Log RabbitMQ MassTransit · Events Bitnami · Internal Only Worker .NET 10 · Hangfire Campaign Engine (9 types) Push Notifications (Firebase) SignalR Feedback · AI Jobs PostgreSQL 17 Master DB + Per-Tenant DBs EF Core · Global Query Filters Redis Cache Sessions · Rate Limits · Locks AI Service (Python) FastAPI · Celery · scikit-learn LangChain · 9 ML Capabilities Polly Resilience · Key Pooling Azure Blob Storage Product & Category Images Azure Key Vault JWT · DB · LLM Keys · Secrets HTTP / WebSocket Async / Internal API gateway Worker / Engine

Event-Driven Pipeline

API
RabbitMQ
Worker Consumer
Campaign Engine
Push Notification
+
SignalR Hub
+
AI Feedback Job

Multi-Tenant Isolation

Each cafe chain gets a dedicated PostgreSQL database. EF Core global query filters enforce row-level isolation as a second layer of defense.

Master DB
Tenant directory
Connection strings
Subscription tiers
SuperAdmin accounts
resolves
Tenant DB (×N)
Cafes & Products
Users & Transactions
Campaigns & Rewards
Audit log & Analytics

Built for a jury. Ready for production.

Seven engineering decisions that separate this from typical student projects.

01
🏗️
Production-Ready Architecture
Multi-tenant isolation, circuit breakers (Polly), idempotency via inbox pattern, audit logging on every entity — not a toy project.
02
🧠
Dual ML Strategies
Deterministic scikit-learn pipelines (fully explainable) + LLM creativity — both coexist behind a tabbed UI, neither cannibalizing the other.
03
🔌
Open/Closed Campaign Engine
9 implemented campaign types via Strategy pattern evaluator registry — adding a new type requires zero changes to existing code.
04
🔄
AI Feedback Loop
Campaign outcomes are tracked and posted back to the Python service via Hangfire jobs — the AI continuously improves per tenant.
05
🛒
Two Transaction Paths
Cashier-initiated (standard) and end-user-initiated cart-QR with discount application — doubles UX flexibility and covers more real-world workflows.
06
🎯
One-to-One Targeted Marketing
Any campaign can be scoped to a single user ID or a precise RFM segment list — enterprise-grade personalization at cafe scale.
07
Sub-Second Real-Time UX
SignalR delivers point balance updates and reward notifications in under 1 second — users feel the system working in their hands.
219
Unit + Integration Tests
3
Client Applications (iOS & Android)
Tenant Isolation (Dedicated DBs)