Skip to main content
Vito Business OS is divided into fifteen bounded contexts. Each context owns its entities, events, and business rules. Contexts communicate through domain events and explicit public interfaces — never by importing each other’s internal classes directly.
Cross-context coupling is prohibited. Sales must not instantiate Identity classes directly. Use public interfaces or subscribe to domain events.

Context map

ContextPrimary directoryKey responsibility
Identityapp/Domain/IdentityUsers, roles, and tenant membership
Authapp/Domain/AuthCredentials, OTP, social login, password reset
TenantGovernanceapp/Domain/TenantGovernanceTenant lifecycle, profile, and subscription status
Billingapp/Domain/BillingPayments, subscription plans, and invoicing
Salesapp/Domain/SalesOrders, cart, checkout, and payment status
Catalogapp/Domain/CatalogProducts, menu sections, modifiers, and pricing
Bookingapp/Domain/BookingAppointments, services, providers, and availability
Marketingapp/Domain/MarketingCoupons, campaigns, announcements, and followers
Interactionsapp/Domain/InteractionsWhatsApp, call, and map CTA tracking
Analyticsapp/Domain/AnalyticsVisit tracking and business metrics
Reviewsapp/Domain/ReviewsCustomer reviews and ratings
Directoryapp/Domain/DirectoryPublic directory, cities, categories, and SEO
Searchapp/Domain/SearchSearch contracts and query strategies
AIEnrichmentapp/Domain/AIEnrichmentAI profile optimization with budget control
Publicapp/Domain/PublicPublic-facing microsites and discovery pages

Context details

Owns: UserEntity, UserRole enum, UserRepositoryInterfaceResponsibilities: User registration, profile management, tenant membership assignment, and reactivation. The canonical source of truth for who a user is.Key domain events:
EventWhen it fires
UserRegisteredA new user account is created
UserDeletedA user account is removed
TenantRegisteredA new tenant is created alongside the owner user
UserIdentityLinkedA social provider is linked to an existing account
UserRegisteredViaSocialA user registers via a social provider for the first time
SocialIdentityLinkedA social identity record is attached to a user
Application handlers: RegisterUserHandler, UpdateUserProfileHandler, ReactivateUserHandler
Owns: OneTimePassword entity, OTP lifecycle, social login flow, password reset, and session credentialsResponsibilities: Everything related to proving who you are — password verification, OTP generation and verification, social OAuth flows, and credential rotation.Key domain events:
EventWhen it fires
OtpGeneratedA one-time password is created for a user
OtpVerifiedA user successfully verifies an OTP
UserPasswordChangedA user’s password is reset or updated
Application handlers: Auth\Handlers in app/Application/Auth
Owns: TenantEntity, TenantRepositoryInterface, subscription state, tenant audit trailResponsibilities: Creating and managing tenant workspaces, enforcing subscription-gated features, running stale tenant audits, and reconciling subscription status.Key domain events:
EventWhen it fires
TenantCreatedA new tenant workspace is provisioned
TenantUpdatedTenant profile settings are changed
TenantProfileEnhancedAI enrichment updates the tenant profile
Application handlers: TenantGovernance handlers in app/Application/TenantGovernance
Owns: Payment entities, subscription plans, billing gateways (via Gateways/ interfaces), and invoicing DTOsResponsibilities: Receiving and recording payments, tracking subscription upgrades and expirations, processing payment webhooks, and reconciling pending payment intents.Key domain events:
EventWhen it fires
PaymentReceivedA payment is successfully recorded
PaymentFailedA payment attempt fails
PaymentReportedA manual payment is reported by the tenant
PaymentWebhookReceivedAn external payment webhook arrives
SubscriptionUpgradedA tenant’s plan is upgraded
Application handlers: Payments handlers in app/Application/Payments
Owns: OrderEntity, OrderRepositoryInterface, order status machine, and cart stateResponsibilities: Creating and persisting orders, managing the full order lifecycle (pending → paid → shipped → cancelled), applying coupons and discounts, and tracking payment status.Key domain events:
EventWhen it fires
OrderCreatedA new order is placed
OrderCancelledAn order is cancelled
CartAbandonedA cart session expires without checkout
Application handlers: Sales handlers in app/Application/Sales
Owns: Product contracts, catalog query interfaces, and product-change eventsResponsibilities: Defining the catalog contract for querying products, menu sections, modifiers, and price changes. Infrastructure implementations live in app/Infrastructure/Catalog.Key domain events:
EventWhen it fires
ProductPriceChangedA product’s price is updated
Application handlers: Products handlers in app/Application/Products
Owns: Appointment lifecycle, service definitions, provider availability, and booking confirmationResponsibilities: Creating and managing appointments, enforcing availability slots, sending confirmations and reminders, and allowing public cancellation via signed URLs.Key domain events:
EventWhen it fires
AppointmentCancelledAn appointment is cancelled by owner or customer
Application handlers: Booking handlers in app/Application (booking flows)
Owns: Coupon, Campaign, Announcement, follower lists, and loyalty contractsResponsibilities: Defining coupon rules (discount type, expiry, usage limits), managing email campaigns, publishing announcements, and tracking follower/lead relationships.Key domain events: Marketing events are consumed by downstream contexts (analytics, notifications). The Marketing domain owns the enums and contracts that define valid campaign and coupon states.Application handlers: Marketing handlers in app/Application/Marketing
Owns: InteractionRecorded event, interaction repository interface, and CTA-type definitionsResponsibilities: Recording every customer-initiated CTA: WhatsApp button taps, phone call taps, and “get directions” map taps. These events feed the analytics read model.Key domain events:
EventWhen it fires
InteractionRecordedA visitor taps a CTA on a business microsite
Application handlers: Interactions handlers in app/Application/Interactions
Owns: TenantAnalytic entity, analytics repository interface, and metric definitionsResponsibilities: Recording tenant visit counts, aggregating interaction metrics, syncing analytics to a read model, and providing data for the business dashboard and exportable reports.Key domain events:
EventWhen it fires
AnalyticsSyncedAnalytics metrics are aggregated and written to the read model
Application handlers: Analytics handlers in app/Application (analytics flows)
Owns: Review entity, review repository interface, and rating constraintsResponsibilities: Allowing customers to submit reviews for tenant businesses, enforcing one-review-per-customer rules, and providing the review feed for public microsites.Key domain events:
EventWhen it fires
ReviewCreatedA customer submits a new review
Application handlers: Reviews handlers in app/Application/Reviews
Owns: Directory DTOs, city/category lookup contracts, and SEO-slug resolutionResponsibilities: Powering the public business directory, city landing pages, and category landing pages. Provides the contracts that the Infrastructure and HTTP layers implement for discovery queries.Key domain events: Directory is primarily a read-side context. It consumes events from Identity and TenantGovernance to keep directory listings current.
Owns: AI prompt templates, enrichment data DTOs, and budget-control contractsResponsibilities: Generating and applying AI-suggested improvements to tenant profiles (description, SEO copy, category tagging). Every AI call is subject to a per-tenant budget cap, and all consumption is audited.Key domain events: Enrichment results trigger TenantProfileEnhanced in the TenantGovernance context.Application handlers: AI handlers in app/Infrastructure/AI and queued via app/Application/Actions
Owns: Public-facing microsite contracts, storefront query interfaces, and announcement deliveryResponsibilities: Serving the tenant microsite (/t/{tenant}), the public landing page, and the discovery/explore pages. Provides read-model contracts that the Infrastructure layer fulfils with cached queries.Key domain events: Public is a read-side context. It reacts to TenantUpdated and ProductPriceChanged to invalidate cached microsites.

How contexts communicate

Contexts are decoupled at the class level. Three patterns are used:

Domain events via outbox

A handler appends a domain event to the outbox table inside its transaction. The outbox worker dispatches it after commit. Listeners in other contexts receive it asynchronously.

Public interfaces

A context exposes a narrow interface (e.g., TenantRepositoryInterface) that other Application handlers may depend on. The concrete implementation is in Infrastructure.

Read models

Contexts that only need to query another context’s data do so through a dedicated read-model query (e.g., a Catalog query in the Sales checkout flow), never by importing the other context’s entities.

Build docs developers (and LLMs) love