How virtocommerce/vc-platform works
1. What this repo is
This is the Virto Commerce Platform runtime: an ASP.NET Core/.NET 10 backend plus an AngularJS-based admin SPA. It is designed as a modular commerce platform, not a single business app. Most business capabilities are delivered as loadable modules rather than hard-coded features.
2. Top-level runtime shape
The main executable is src/VirtoCommerce.Platform.Web. It hosts HTTP APIs, authentication, Swagger, health checks, SignalR push notifications, static SPA assets, and startup/configuration wiring. The rest of the solution is split into reusable libraries that the host composes.
3. API and host boundary
Controllers under Controllers/Api expose the platform surface for modules, security, settings, localization, jobs, diagnostics, licensing, change log, and push notifications. Middleware in the web project handles API error wrapping, cache headers, security headers, and authentication/authorization behavior.
4. Core domain and contracts
VirtoCommerce.Platform.Core defines the platform’s shared abstractions and domain primitives: entities, repositories, unit of work, commands, events, settings, dynamic properties, localization, export/import, push notifications, modularity, and security contracts. This layer is intentionally persistence- and transport-agnostic.
5. Persistence and business services
VirtoCommerce.Platform.Data contains the concrete EF Core implementations for the shared platform features. It provides repository/unit-of-work infrastructure, CRUD/search services, settings storage, dynamic properties, localization, change log, countries, file/zip helpers, and transaction-aware file operations.
6. Database provider split
The repo has separate provider packages for SQL Server, PostgreSQL, and MySQL. Each contains provider-specific EF Core configuration, migrations, health checks, and certificate loading. Architecturally, this means the platform core data model is shared, while storage behavior and schema evolution are provider-specific.
7. Security subsystem
VirtoCommerce.Platform.Security and the web project together implement identity and authorization. The stack includes ASP.NET Core Identity, OpenIddict, custom user/role stores and managers, API key and basic auth handlers, permission authorization, external sign-in, server certificate management, and background jobs for token pruning and account lockout.
8. Modularity and module lifecycle
VirtoCommerce.Platform.Modules is the module runtime. It handles module discovery, manifests, cataloging, installation, versioning, optional dependencies, assembly loading, and app manifest management. This is the central extensibility boundary: modules can contribute APIs, UI, settings, data, and startup behavior.
9. Caching and scale-out coordination
VirtoCommerce.Platform.Caching and VirtoCommerce.Platform.DistributedLock provide cache regions, memory cache abstractions, Redis-backed cache invalidation, and distributed locks. This matters for multi-instance deployments where module state, settings, and notifications must stay consistent across nodes.
10. Background processing
VirtoCommerce.Platform.Hangfire integrates Hangfire for recurring and background jobs. The web host uses it for scheduled jobs and operational tasks, with explicit user-context middleware and authorization hooks for the admin experience.
11. Push notifications and real-time UI
Push notifications are modeled in Core and implemented in Web with SignalR hubs, in-memory storage, and a scalable notification manager. This is used by admin workflows and long-running operations such as module installation, export/import, and job progress.
12. Admin UI structure
The admin front end lives in wwwroot/js/app and is organized by feature areas such as security, settings, modularity, dynamic properties, change log, diagnostics, and user profile. The UI uses a blade/navigation pattern, feature-specific resources/services/widgets, and localized JSON bundles under wwwroot/Localizations.
13. Data flow through the platform
Typical request flow is: SPA or external client -> web controller -> application/service layer -> repository/EF Core -> relational database. For cross-cutting concerns, the same flow may also trigger events, cache invalidation, push notifications, or background jobs.
14. Operational/deployment boundaries
The repo includes Docker Compose files, Azure deployment templates, and GitHub workflows, indicating it is meant to run in containerized and cloud deployments. The docs also reference Redis and a broader local stack, reinforcing that the platform is built for distributed, modular commerce environments.
15. Where to draw the main diagram boxes
A useful architecture diagram would show: the Web host at the center; Core as shared contracts; Data and provider-specific persistence underneath; Modules as a runtime/plugin subsystem; Security, Caching, Distributed Lock, and Hangfire as cross-cutting services; and the AngularJS admin SPA and external clients as consumers of the APIs.
Main entry points: VirtoCommerce.Platform.Web Platform Web · VirtoCommerce.Platform.Data Platform Data · app Admin SPA · VirtoCommerce.Platform.Modules Module runtime
Components 23
Web host
ASP.NET Core runtime, API surface, middleware, Swagger, health checks, SignalR, and admin SPA delivery.
- Platform Web · Main executable that wires HTTP APIs, middleware, auth, Swagger, health checks, SignalR, static assets, and startup composition.
src/VirtoCommerce.Platform.Web - API controllers · Controller surface for modules, security, settings, localization, jobs, diagnostics, licensing, change log, and push notifications.
src/VirtoCommerce.Platform.Web/Controllers/Api - Web security · Authentication handlers, OpenIddict integration, authorization policy provider, and security background jobs.
src/VirtoCommerce.Platform.Web/Security - Push runtime · SignalR hub, in-memory notification storage, scalable notification manager, and synchronization task.
src/VirtoCommerce.Platform.Web/PushNotifications
Shared platform
Core abstractions and reusable platform services composed by the host.
- Platform Core · Shared domain abstractions, commands, events, settings, modularity contracts, security contracts, export/import, and push notification models.
src/VirtoCommerce.Platform.Core - Domain model · Base entities, repositories, unit of work, value objects, factories, and tracking primitives.
src/VirtoCommerce.Platform.Core/Domain - Modularity contracts · Module manifests, dependency solving, install lifecycle, assembly loading contracts, startup hooks, and optional dependency support.
src/VirtoCommerce.Platform.Core/Modularity - Security contracts · Users, roles, permissions, API keys, server certificates, external sign-in, and security events/contracts.
src/VirtoCommerce.Platform.Core/Security - Settings model · Setting descriptors, localized settings, overrides, and search/update contracts.
src/VirtoCommerce.Platform.Core/Settings - Push contracts · Push notification abstractions, search criteria, storage contract, and options.
src/VirtoCommerce.Platform.Core/PushNotifications
Persistence
EF Core data layer plus database-provider specific configuration and migrations.
- Platform Data · Concrete persistence, CRUD/search services, settings storage, dynamic properties, localization, change log, and file helpers.
src/VirtoCommerce.Platform.Data - Security store · Security DbContext, repositories, user/role/session services, API keys, and server certificate persistence.
src/VirtoCommerce.Platform.Security - SQL Server · SQL Server-specific EF Core configuration, migrations, health checks, and certificate loading.
src/VirtoCommerce.Platform.Data.SqlServer - PostgreSQL · PostgreSQL-specific EF Core configuration, migrations, health checks, and certificate loading.
src/VirtoCommerce.Platform.Data.PostgreSql - MySQL · MySQL-specific EF Core configuration, migrations, health checks, and certificate loading.
src/VirtoCommerce.Platform.Data.MySql
Extensibility
Module runtime, background jobs, caching, distributed coordination, and push notifications.
- Module runtime · Discovers, installs, catalogs, loads, and manages modules and app manifests.
src/VirtoCommerce.Platform.Modules - Caching · Memory and Redis-backed cache regions and invalidation messaging.
src/VirtoCommerce.Platform.Caching - Distributed lock · No-op and Redis-backed distributed locking for multi-instance consistency.
src/VirtoCommerce.Platform.DistributedLock - Hangfire · Recurring/background job integration, user-context middleware, and authorization hooks.
src/VirtoCommerce.Platform.Hangfire
Admin UI
AngularJS backoffice SPA, localized assets, and feature blades.
- Admin SPA · Feature-based admin UI with blades, resources, widgets, navigation, localization, and common UI components.
src/VirtoCommerce.Platform.Web/wwwroot/js/app - Translations · Server and client localization bundles and country/language resources.
src/VirtoCommerce.Platform.Web/wwwroot/Localizations
Consumers
External clients and deployment/runtime environments that interact with the platform.
- Clients · External clients, storefronts, and deployment/runtime environments that consume the platform APIs.
- Deploy stack · Docker, compose, Azure templates, and CI/CD workflows used to run and ship the platform.
DockerCompose
Connections 25
- Clients → Platform Web: HTTP/SPA · External clients and the admin UI reach the platform through the web host.
- Admin SPA → API controllers: calls · The backoffice SPA talks to the API controller surface.
- Platform Web → API controllers: hosts · The host exposes the platform API surface.
- Platform Web → Web security: configures · The host wires authentication, authorization, and security jobs.
- Platform Web → Push runtime: serves · The host publishes push notifications over SignalR.
- Platform Web → Module runtime: loads modules · Startup composes the module runtime and module contributions.
- Platform Web → Hangfire: runs jobs · The host integrates recurring and background job execution.
- Platform Web → Caching: uses cache · The host depends on shared caching and invalidation.
- Platform Web → Distributed lock: uses locks · The host coordinates multi-instance operations with distributed locks.
- Platform Web → Platform Data: uses · The host delegates business data operations to the persistence layer.
- Web security → Security store: persists identity · Security features are backed by EF Core repositories and stores.
- Platform Data → Platform Core: implements · Concrete data services implement shared platform contracts.
- Security store → Security contracts: implements · Security persistence and services implement core security contracts.
- Platform Data → SQL Server: provider split · SQL Server package supplies provider-specific persistence behavior.
- Platform Data → PostgreSQL: provider split · PostgreSQL package supplies provider-specific persistence behavior.
- Platform Data → MySQL: provider split · MySQL package supplies provider-specific persistence behavior.
- Module runtime → Modularity contracts: implements · The module runtime realizes the modularity contracts.
- Caching → Platform Core: supports · Caching primitives are defined in the shared core and implemented in the cache package.
- Distributed lock → Platform Core: supports · Distributed lock abstractions are shared through core contracts.
- Hangfire → Platform Web: integrates · Background job infrastructure is hosted by the web app.
- Push runtime → Push contracts: implements · SignalR and storage services implement push notification contracts.
- Admin SPA → Translations: loads · The SPA consumes localized UI bundles.
- Admin SPA → Module runtime: extends via modules · Feature areas in the admin shell are module-driven.
- Module runtime → Admin SPA: publishes UI · Modules contribute UI blades, widgets, and navigation.
- Deploy stack → Platform Web: deploys · Container and cloud artifacts target the web host.