Building Enterprise Desktop, Web, Mobile, and Docker Applications From One Shared Platform
This article presents a reference architecture for building desktop, web, mobile, service, and containerized applications around a shared platform core.
This reference implementation demonstrates how to organize an entire application platform around a shared domain model, repository abstractions, application services, OpenAPI contracts, and worker protocols. The result is an architecture that supports multiple runtime hosts while preserving a single, consistent business platform.
A ready-to-use template repository is available at: https://github.com/expert10000/multi-platform-template.
The Problem
Modern enterprise applications most often include desktop, web, mobile, backend services, worker processes, and containerized deployments. The challenge here is not simply sharing a presentation layer—it is sharing the application platform. The result should be real, true cross-platform development. The goal of this architecture is to build one shared application platform that can be hosted by multiple runtime environments. The proposed approach ensures integration of different runtimes such as React sites and .NET MAUI applications presented below:

Architecture Philosophy
The proposed approach ensures integration of different runtimes such as React sites, .NET MAUI applications, and Electron applications by means of a shared platform. The architecture is not UI-centric. It is platform-centric. Different platforms often need different interaction models. A shared platform diagram is presented below:

The shared business platform represents the architectural center of the system that allows individual layers to evolve independently. Every application host reuses the same business definitions and contracts, regardless of the implementation technology:
- Application hosts provide user experiences optimized for desktop, web, or mobile environments.
- Backend implementations expose identical business capabilities through the same OpenAPI contracts.
- Repository implementations encapsulate persistence behind common repository abstractions.
- Workers execute long-running or computational tasks independently of both clients and backend implementations.
Architecture Overview
The proposed architecture consists of seven layers:
- Application Hosts
- Shared Business Platform
- Contract Boundary
- Platform Services
- Repository Adapters
- Workers
- Persistence and External Assets
A diagram presenting the structure of the seven layers of the proposed architecture is presented below:

By treating frameworks, backend technologies, databases, and workers as interchangeable implementations around a shared business platform, the architecture becomes properly ordered, maintainable, avoids or minimizes duplication while remaining flexible to support different enterprise technology stacks.
Shared Business Platform
The architecture treats business concepts differently from transport and persistence. The shared business platform defines the domain models, application services, repository abstractions, and the OpenAPI specification. The OpenAPI contract acts as the common language between clients and servers and is used to generate DTOs for multiple programming languages. Each backend implementation consumes the generated DTOs, implements the shared business logic, and maps the domain models to its own persistence entities. Those entities remain internal to the chosen persistence technology, allowing different databases and ORMs without interfering with the shared platform.
It illustrates the reusable business layers that remain independent of user interface frameworks, backend technologies, databases, and worker implementations. Together, these layers define the stable contracts that every application host and backend implementation consumes.
Now, we describe parts of the Business Platform: Domain Models, Application Services, Repository Abstractions, and API Contracts, forming the Contract Boundary.
Domain Models
Domain models describe the business concepts of the solution. They do not contain database annotations, ORM details, or UI-specific fields. Example domain models:
export type DocumentStatus =
| "draft"
| "review"
| "approved"
| "archived";
export interface Workspace {
id: string;
name: string;
description?: string;
createdAt: string;
}
export interface Document {
id: string;
workspaceId: string;
title: string;
status: DocumentStatus;
tags: string[];
}
Application Services
Application services implement the business workflows of the system. They coordinate domain models, repository abstractions, validation, and background workers while remaining independent of user interfaces, databases, and backend frameworks. For example, a document service may validate a new document, store it through a repository, enqueue a background processing job, and return the resulting business object.
export interface DocumentService {
listDocuments(
workspaceId: string
): Promise<Document[]>;
getDocument(
id: string
): Promise<Document | null>;
createDocument(
input: CreateDocumentInput
): Promise<Document>;
}
Application services depend only on domain models and repository abstractions. They do not know whether the application runs inside Electron, React, .NET MAUI, Uno Platform, or Flutter, nor whether data is stored in SQLite, PostgreSQL, SQL Server, or another persistence technology.
This separation allows the same business workflows to be reused across desktop, web, mobile, and backend implementations while keeping user interfaces and persistence technologies independent of the business logic.
Repository Abstractions
Repository abstractions define how the application accesses business data without depending on a specific persistence technology. Application services interact only with repository interfaces, allowing the same business logic to work with SQLite, PostgreSQL, SQL Server, remote APIs, or in-memory implementations used for testing. For example, a document repository exposes operations for retrieving, creating, updating, deleting, and searching documents, regardless of where the data is stored.
export interface DocumentRepository {
listByWorkspace(
workspaceId: string
): Promise<Document[]>;
getById(
id: string
): Promise<Document | null>;
create(
document: Document
): Promise<Document>;
update(
document: Document
): Promise<Document>;
delete(
id: string
): Promise<void>;
}
Similarly, repositories can be defined for workspaces and background jobs.
export interface WorkspaceRepository {
list(): Promise<Workspace[]>;
getById(
id: string
): Promise<Workspace | null>;
create(
workspace: Workspace
): Promise<Workspace>;
}
Each backend provides its own implementation of these interfaces. Because application services depend only on repository abstractions, the persistence layer can be replaced without changing the business logic. This solution enables offline desktop workspaces, cloud deployments, unit testing with in-memory repositories, and future database technologies without modifying the shared business platform.
API Contracts
API contracts define how application hosts communicate with backend implementations. Rather than coupling clients to a specific server framework, the architecture uses an OpenAPI specification as a versioned contract shared across the platform. The specification defines available endpoints, request and response DTOs, validation rules, and standardized error responses. From this single contract, client libraries and DTOs can be generated for multiple programming languages, allowing Electron, React, .NET MAUI, mobile applications, and other hosts to communicate with backend services consistently. For example, the document service may expose endpoints such as:
GET /workspaces
GET /workspaces/{id}
GET /documents
GET /documents/{id}
POST /documents
PUT /documents/{id}
DELETE /documents/{id}
GET /jobs
POST /jobs
GET /jobs/{id}
Every backend implementation — whether built with Node.js, ASP.NET Core, Spring Boot, FastAPI, or Go — implements the same API contract. Likewise, Electron, React, React Native, .NET MAUI, Uno Platform, and Flutter clients consume the same generated client library and DTOs. Because the contract is versioned independently of any implementation, backend technologies can evolve without requiring changes to application hosts, provided the published contract remains compatible.
The main idea here is that every host uses the same platform concepts. A desktop workspace, a web dashboard, a mobile client, and a worker job all speak the same architectural language. Application Hosts include Electron Desktop — the primary desktop host. Electron runtime provides native filesystem access, local workspace management, offline execution, SQLite integration, desktop packaging, access to the Node.js ecosystem, and reuse of the React UI layer. In this architecture, Electron is not the whole product. It is one host around the shared platform core.
React web application runs in the browser and communicates with the service layer through HTTP and OpenAPI-generated clients.
React Native provides a mobile host for Android and iOS. It can reuse TypeScript models, generated API clients, validation logic, service contracts, and selected UI concepts. The mobile interface may be simpler than the desktop interface, but it still speaks the same platform language.
.NET MAUI application can be added as an optional native client. It does not directly import TypeScript packages. Instead, it consumes generated clients from OpenAPI contracts and communicates with the same service layer. This makes MAUI a compatible host without forcing the entire architecture into the .NET runtime.
Uno Platform can participate similarly. It can provide a .NET-based UI host that communicates through contracts. This is useful when a project wants a native or XAML-based client while preserving the same backend and domain contracts.
The Application Hosts layer forms the upper layer of the proposed architecture, as presented in the diagram below:

The scope of responsibilities of the five architecture layers is presented below:
| LAYER | PRIMARY RESPONSIBILITY | OWNS | SHOULD NOT OWN | TARGETS |
|---|---|---|---|---|
| Application Hosts | Adapt the platform to each runtime and interaction model | Navigation, platform UI, native integrations, host lifecycle | Core business rules, worker algorithms, duplicated domain logic | Lets desktop, web, and mobile differ without creating different products |
| Shared Platform Packages | Implement reusable application concepts | Domain models, validation, application services, repository abstractions | OS-specific behavior or deployment concerns | Keeps TypeScript hosts working from the same semantics |
| Contract Boundary | Define stable communication between runtimes | OpenAPI schemas, request/response models, worker envelopes, versioned payloads | Business implementation details | Allows .NET, Python, Flutter, and future runtimes to participate safely |
| Platform Services | Coordinate application state and execution | Workspace API, persistence access, project/job lifecycle, orchestration | Heavy analytics or presentation logic | Provides one consistent service boundary for all hosts |
| Workers | Execute specialized or expensive processing | Analytics, forecasting, imports, transformations, reports, automation | UI state or direct client dependencies | Heavy computation can evolve and scale independently |
| Persistence & Assets | Store application state and user/business data | SQLite metadata, files, CSV/Excel assets, generated reports | Application workflows | Separates durable state from processing and presentation |
| Deployment & Operations | Package and run the system consistently | Containers, builds, release scripts, environment configuration | Domain behavior | Makes the same architecture reproducible across development and production |
Repository Organization
A possible repository layout contains each directory representing an architectural responsibility:
apps/desktopcontains the Electron host.apps/webcontains the browser application.apps/mobilecontains the React Native application.apps/mauiis optional and can contain a .NET MAUI client generated from OpenAPI contracts.packages/corecontains domain entities, validation rules, and shared application logic.packages/workspacecontains workspace and repository abstractions.packages/contractscontains OpenAPI definitions, schemas, and generated client types.services/workspace-servercontains the HTTP API and service orchestration.services/worker-pythoncontains analytics and computational jobs.services/worker-nodecontains automation and integration jobs.docker/contains reproducible deployment definitions.
Multiplatform template overview is presented below:

Advantages
This architecture provides several practical benefits.
- Reduced Duplication – Business logic is not rewritten for every platform. The same models, services, contracts, and validation rules are reused across desktop, web, mobile, and backend hosts.
- Consistent Behavior – Every application host works with the same domain model, repositories, services, and contracts, producing consistent behavior across platforms.
- Language Interoperability – TypeScript hosts reuse shared packages directly, while .NET MAUI, Uno Platform, Flutter, and other technologies integrate through OpenAPI and JSON contracts.
- Worker Reuse – Python and Node workers are independent of any particular UI and can be invoked from desktop, web, mobile, or backend services.
- Easier Testing – Shared services, repositories, and OpenAPI contracts can be tested once and reused throughout the platform.
- Better Extensibility – New application hosts can be introduced by implementing existing contracts instead of duplicating business logic.
- Offline and Online Support – Desktop applications can work with local SQLite workspaces, while web, mobile, and server deployments use the same service layer.
Future Extensions
The presented template is intentionally modular and can evolve incrementally. Possible extensions include database repositories, cloud-native deployments, AI services, authentication providers, background schedulers, event-driven messaging, and Kubernetes deployments. Because the platform separates application hosts from the shared platform core, these capabilities can be introduced without redesigning the overall architecture.
A repository reference demonstrating the application of the proposed architecture is presented below:

Conclusion
Enterprise applications need shared business meaning, shared contracts, shared persistence abstractions, shared services, and shared worker protocols. The architecture described in this article is platform-centric rather than framework-centric. Electron, React, React Native, Dockerized services, and optional hosts such as .NET MAUI, Uno Platform, or Flutter become application hosts around a shared platform core. The result is a system where new clients are added by implementing existing contracts rather than duplicating business logic. Desktop, web, mobile, backend, and worker environments can evolve independently while preserving one consistent application platform.
The complete reference implementation is available in the accompanying GitHub repository.
Opinions expressed by DZone contributors are their own.