Architecture & modules
Follow the client/server boundaries, data flow, order lifecycle, and system modules.
Architecture Overview
┌─────────────────────────────────────────────────────┐
│ CLIENT SIDE │
├─────────────────────────────────────────────────────┤
│ point_manager.lua → ox_lib Points (proximity) │
│ interaction_editor.lua → Placement mode UI │
│ menu_management.lua → Menu browsing / editing │
│ cart_system.lua → Customer cart & ordering │
│ cashier_system.lua → Cashier operations │
│ kitchen_system.lua → Kitchen station UI │
│ management_menu.lua → Manager dashboard │
│ receipt_npc.lua → Receipt redemption NPC │
│ stock_market.lua → Wholesale NPC interaction │
│ admin_menu.lua → Admin restaurant setup │
│ npc_manager.lua → Common NPC spawn utility │
└─────────────┬───────────────────────────────────────┘
│ ox_lib callbacks / net events
┌─────────────▼───────────────────────────────────────┐
│ SERVER SIDE │
├─────────────────────────────────────────────────────┤
│ instance_manager.lua → Core: lazy load, RAM cache │
│ settings_manager.lua → Settings & interaction pts │
│ menu_manager.lua → Menu CRUD + validation │
│ order_manager.lua → Order lifecycle & payments │
│ recipe_manager.lua → Dynamic recipe CRUD │
│ kitchen_manager.lua → Kitchen task engine │
│ station_manager.lua → Cooking & assembly logic │
│ receipt_manager.lua → Receipt create/redeem │
│ discount_manager.lua → Time-limited discounts │
│ z_report_manager.lua → Revenue analytics │
│ stock_market.lua → Wholesale shop register │
│ admin_manager.lua → Admin CRUD operations │
├─────────────────────────────────────────────────────┤
│ REPOSITORY LAYER (SQL) │
│ base_repository.lua → Query/Insert/Update │
│ restaurant_repository.lua → Restaurant CRUD │
│ menu_repository.lua → Menu items CRUD │
│ recipe_repository.lua → Recipes + ingredients │
│ settings_repository.lua → Settings & points I/O │
└─────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────┐
│ SHARED LAYER │
├─────────────────────────────────────────────────────┤
│ config.lua → Main configuration │
│ config_stations.lua → Station definitions │
│ bridge/init.lua → Auto-detect framework │
│ bridge/core/qb.lua → QBX / QB-Core bridge │
│ bridge/core/esx.lua → ESX bridge │
│ bridge/inventory/ox.lua→ ox_inventory bridge │
│ bridge/inventory/qb.lua→ qb-inventory bridge │
│ bridge/target/ox.lua → ox_target bridge │
│ bridge/target/qb.lua → qb-target bridge │
└─────────────────────────────────────────────────────┘Data Flow
- Lazy Loading — Restaurant data loads from MySQL on first
GetRestaurant(jobName)call - RAM Cache — All loaded data lives in
_G.SPC_RestaurantInstancesfor zero-latency access - Instant Sync — Every mutation (menu edit, order create, etc.) writes to SQL first, then updates RAM cache
- Active Orders — Stored only in RAM (never persisted). Completed/cancelled orders log to
lcky_orders_log
Order Lifecycle
created → confirmed → preparing → ready → completed
↓ ↓ ↓ ↓
cancelled cancelled cancelled cancelledSystem Modules
Instance Manager (Server)
Central module managing restaurant lazy-loading, RAM caching, and data access.
Menu Manager (Server)
Full CRUD for menu items with validation, slug generation, and instant SQL+RAM sync.
Order Manager (Server)
Order lifecycle management. Orders live only in RAM — completed/cancelled orders log to SQL.
Recipe Manager (Server)
Dynamic recipe CRUD per restaurant. Recipes link to menu items and define assembly station, ingredients, and output.
Kitchen Manager (Server)
Kitchen task engine generating pending preparation tasks from active orders.
Station Manager (Server)
Handles cooking (fixed input→output) and assembly (recipe-based) station operations with inventory integration.
Settings Manager (Server)
Manages interaction points, restaurant open/close status, and general settings.
Receipt Manager (Server)
Creates receipt items with metadata and handles single/bulk redemption with money payout.
Discount Manager (Server)
Time-limited discount management with overlap prevention and automatic expiry.
Z Report Manager (Server)
Revenue analytics computing totals, tips, payment breakdown, and discount statistics from order logs.
Stock Market (Server)
Registers a wholesale shop in ox_inventory restricted to restaurant job grades.
Admin Manager (Server)
Admin-only restaurant creation, deletion, and location management protected by ACE permissions.
LuckyScripts Business Management · Match configuration examples to your downloaded release.
Need a hand? Read the support guide ↗