narayan_system_core
The brain of the Narayan Farms business system. A pure orchestration layer that coordinates all domain packages without UI, database, or Firebase.
π What is this package?
narayan_system_core is a system-level orchestration package that connects all core business domains:
Ordering
Supply & Inventory
Delivery & Workforce
Loyalty / Streak / Levels
It does not contain business rules and does not contain UI or infrastructure.
Think of it as:
βTraffic controller for your business logic.β
π« What this package is NOT
This package contains NO:
β UI (Flutter widgets, screens)
β Firebase / database code
β HTTP / REST clients
β Business logic duplication
β Direct domain coupling
All logic lives inside domain packages. This package only coordinates them.
π§± Architecture Philosophy
This package follows:
DDD (Domain-Driven Design)
Clean Architecture
Ports & Adapters
Time Injection (No DateTime.now())
Event-Driven System Design
Each domain is independent and testable.
Dependencies (Domain Packages)
This package depends on the following published domain packages:
ordering
supply_inventory
delivery_workforce
loyalty_levels
lib/ βββ orchestrators/ β βββ order_flow_orchestrator.dart β βββ delivery_flow_orchestrator.dart β βββ loyalty_flow_orchestrator.dart β βββ supply_flow_orchestrator.dart β βββ ports/ β βββ clock_port.dart β βββ event_bus_port.dart β βββ notification_port.dart β βββ system_events/ β βββ order_completed.dart β βββ loyalty_reward_earned.dart β βββ stock_reorder_required.dart β βββ narayan_system_core.dart
Libraries
- domain/events/domain_event
- domain/events/system_events
- infrastructure/in_memory_domain_event_bus
- narayan_system_core
- orchestrators/delivery_flow_orchestrator
- orchestrators/loyalty_flow_orchestrator
- orchestrators/order_flow_orchestrator
- orchestrators/supply_flow_orchestrator
- ports/agent_provider_port
- ports/clock_port
- ports/event_bus_port
- ports/loyalty_account_provider_port
- ports/notification_port
- ports/route_provider_port
- replay/replay_state
- replay/system_replay_service
- system_events/delivery_failed
- system_events/loyalty_reward_earned
- system_events/order_completed
- system_events/stock_reorder_required
- use_cases/order_placement_use_case
- use_cases/place_order_from_app_use_case