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