backend gap analysis
Guide for backend gap analysis
Game Backend Gap Analysis
Date: 2026-01-21 (Revised after deep code research) Scope: Product Manager evaluation ofloh-backendfor gaps and missing functionality
Executive Summary
The backend has made significant progress with 78+ core modules, 22 API handlers, 55 DB migrations, and substantial security/anti-cheat infrastructure. However, several critical gaps remain that block launch readiness.
✅ What's Implemented (Strengths)
Core Game Systems
Infrastructure
Security & Integrity
Observability
🔴 Critical Gaps (P0 - Launch Blockers)
1. Payments Integration ✅ ~50% Complete (BLOCKED on incorporation)
Status: Core logic implemented, some HTTP routes missing, blocked on incorporation for real payment provider
Location:
logic-core/src/store/, api-game/src/api/shop_handlers.rs
Impact: Cannot monetize until incorporation complete✅ Implemented:
- Migration
20260117020000_create_payment_tables.up.sql(orders, order_items, transactions tables) -
CartManagerwithvalidate()method (price calculation, coupon validation, bulk discounts) -
PaymentManagerwithcomplete_purchase()method - Shop endpoints:
GET /shop/products,POST /shop/purchase - Stripe webhook:
POST /webhooks/stripe - Documentation:
docs/PAYMENT_API.md
❌ Remaining Gaps:
-
POST /cart/validateHTTP route (logic exists inCartManager, route not exposed) -
POST /checkout/intentHTTP route (PaymentIntent creation) -
POST /checkout/finalizeHTTP route (order finalization) -
GET /ordersHTTP route (order history) - Chargeback webhook and debt system integration
- Razorpay provider (Stripe only currently)
- Receipt email dispatch
Reference: backend_contracts.md
2. Account System Incomplete
Status: Partial implementation
Location:
logic-core/src/auth/
Impact: Multi-profile support brokenMissing Components:
- Full Master Account → N Game Profiles flow
- Profile switching during session
- Profile-level debt tracking (post-chargeback)
- Account freezing/unfreezing logic
- Password reset flow
- Email verification
Designed but not implemented: backend_contracts.md#L169-L201
3. Growth Engine (Referrals/Affiliates) ✅ ~70% Complete
Status: Core logic implemented, HTTP routes missing
Location:
logic-core/src/growth.rs, tests/growth_integration.rs
Impact: Logic exists but not exposed via API✅ Implemented:
-
GrowthManagerwith referral code generation (generate_referral_code()) - Signup attribution (
apply_referral_code()) - Qualification check (
check_qualification()for 150 Total Level) - Affiliate tables:
affiliate_earnings,affiliate_applications,affiliate_clicks - Reservation system (
create_reservation()) - Integration tests proving full flow works
❌ Remaining Gaps:
- HTTP API routes not exposed (logic exists, needs handlers)
- Admin approval UI in ops-tools
- Gift code generation endpoint
- Milestone reward auto-distribution
Reference: backend_contracts.md#L139-L163
4. Quest Backend Logic ✅ ~80% Complete
Status: Core system implemented, persistence layer wiring needed
Location:
logic-core/src/quests/ (manager.rs, events.rs, objectives.rs, definitions.rs, loader.rs)
Impact: State machine works, needs DB persistence integration✅ Implemented:
-
QuestManagerwith full state machine -
QuestEventenum (NpcKilled, ItemCollected, NpcTalked, LocationReached, SkillLeveled) -
ObjectiveProgresstracking per step -
PlayerQuestDatastruct with current_step, objectives_progress, timestamps -
handle_event()for automatic objective progression - Migration
040_quest_progress.sqlwithquest_progresstable - Quest requirement checks (skill levels, items, previous quests)
- Quest point tracking
❌ Remaining Gaps:
- Persistence layer: Save/load
PlayerQuestDatafromquest_progresstable - HTTP API handlers for quest operations (start, check, complete)
- Reward distribution integration (XP orbs, items via inventory system)
5. Item Instance IDs (Dupe-Proofing)
Status: Deferred in backlog
Location: pending_tasks.md#L215-L221
Impact: Cannot trace individual items for RWT detection
Missing Components:
- UUID generation for non-stackable items
- Schema overhaul for inventory/bank tables
- Instance ID in trade logs
🟡 Significant Gaps (P1 - Post-Launch Issues)
6. World Content Systems
Missing: Server-side coordinate validation for all travel networks.
7. Social Systems
Missing:
- Clan bank
- Clan broadcasts
- Clan ranks with permissions
8. Player Housing
Status: Stub only
Location:
logic-core/src/house_construction.rs (3KB)
Impact: Major content gapMissing Components:
- Room placement logic
- Furniture system
- Portal network
- Visitor permissions
- House parties
9. Minigames
Status: Not implemented
Impact: No group content variety
Missing:
- Clan Wars (Gandharva War)
- Warrior's Guild (Kshatriya Mandala)
- Underworld Arena (Patala Loka)
Reference: pending_tasks.md#L175-L184
10. Economy NPCs (QoL)
Status: Not implemented
Location: pending_tasks.md#L199-L208
Missing:
- Yamaraja's Office (grave retrieval, gold sink)
- Kingdom Management (passive income)
- Price Checker (GE price lookup)
- Parashurama (bank cleanup)
- Kshetrapala (tool storage)
🟢 Backlog (P2 - Nice to Have)
Schema Gaps
Based on migrations review, the following tables may be missing or incomplete:
Recommendations
Immediate (Pre-Launch)
- Complete Payments Integration - Unblock revenue
- Implement Quest Backend - Core gameplay loop
- Account Multi-Profile - Already designed, needs implementation
- Item Instance IDs - Anti-RWT requirement
Short-Term (30 Days Post-Launch)
- Growth Engine (Bandhu/Rajdoot)
- Achievement Diary persistence
- Housing Phase 1 (rooms + basic furniture)
Medium-Term (90 Days)
- Minigames (Clan Wars first)
- Full clan system
- Private message persistence
API Coverage Check
Coverage: ~30% of e-commerce API from
backend_contracts.md (up from 0%)Summary
┌─────────────────────────────────────────────────────────────┐
│ BACKEND READINESS ASSESSMENT (Revised 2026-01-21) │
├──────────────────┬──────────────────────────────────────────┤
│ Core Game Logic │ █████████████████████████████ 95% │
│ Security │ ██████████████████████████── 85% │
│ Infrastructure │ ██████████████████████████ 90% │
│ Payments │ █████████████░░░░░░░░░░░░░ 50% │
│ E-Commerce API │ ████████░░░░░░░░░░░░░░░░░░ 30% │
│ Growth Engine │ ██████████████████░░░░░░░░ 70% │
│ Quest Backend │ ████████████████████░░░░░░ 80% │
│ Housing │ ░░░░░░░░░░░░░░░░░░░░░░░░░░ 5% │
│ Minigames │ ░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% │
└──────────────────┴──────────────────────────────────────────┘Overall Backend Readiness: ~72% (up from 60%)
Critical Path to Launch: HTTP Route Wiring → Security Hardening → Incorporation