System Architecture Overview
BPMN Architect is built upon a decoupled, three-tier architecture designed for high reliability, enterprise security compliance, and independent horizontal scaling.
High-Level Topology
1. Client Web Platform (bpmn-architect-ui)
The frontend layer is completely isolated from the backend application logic:
- Zero-Backend Execution: Served as static assets. There are no server-side Node.js runtimes, PHP scripts, or Python templating dependencies required to run the frontend.
- Client-Side Manifest: Maintains a lightweight list of recently visited diagrams (
bpmn_recent_diagrams) in the browser'slocalStorage. - High-Availability Fallback:
- The client API module (
api-client.js) checks the microservice endpoint (serviceUrl). - If the service is unreachable (network timeout or service offline), it transparently attempts to fetch
{id}.bpmnand{id}.jsondirectly from the static directory (dataStaticServeUrl). - Viewers can continue exploring and inspecting diagrams uninterrupted.
- The client API module (
2. Headless Microservice (bpmn-architect-service)
The backend layer is an event-driven Python microservice powered by FastAPI and Uvicorn:
- Stateless Operations: Diagram state is stored directly on the filesystem as
{id}.bpmn,{id}.svg, and{id}.json. This eliminates external database dependencies like PostgreSQL or MySQL for core diagram persistence. - Dual-Save Atomic Writes:
- The service persists incoming BPMN 2.0 XML and pre-rendered SVG simultaneously.
- Files are written to temporary sibling files (
.tmp) and swapped atomically usingos.replace.
- Cooperative Soft-Lock Broker:
- In-memory lock state tracked by
LockManagerwith automated expirations. - Supports cooperative handoff negotiation, ping presence tracking, and administrator force unlocks.
- In-memory lock state tracked by
- Direct SVG Image Serving:
- Directly serves vector SVGs (
GET /api/diagram/{id}/svg) with HTTP caching headers (Cache-Control: public, max-age=60).
- Directly serves vector SVGs (
3. Storage Layer & File Structure
The storage layer organizes all diagram assets in a single directory configured via STORAGE_DIR:
diagram_storage/
├── A2nX5VOZAp1W.bpmn # Validated BPMN 2.0 XML definitions
├── A2nX5VOZAp1W.svg # Pre-rendered vector SVG graphic
├── A2nX5VOZAp1W.json # Descriptive metadata & lifecycle state
├── 6EaJLIOae5rz.bpmn
├── 6EaJLIOae5rz.svg
└── 6EaJLIOae5rz.jsonMetadata JSON Schema ({id}.json):
json
{
"id": "A2nX5VOZAp1W",
"friendly_name": "Invoice Approval Flow",
"project_name": "Finance Operations",
"project_description": "End-to-end multi-tier invoice approval procedure.",
"author": "a.taylor",
"last_edited_by": "j.doe",
"created_at": "2026-11-06T13:07:57.903461+00:00",
"updated_at": "2026-11-06T14:31:20.245605+00:00",
"is_deleted": false
}4. Decoupling Advantages
- Failure Domain Isolation: A failure or reboot of the Python microservice does not break the web application. Users can continue navigating the library, viewing existing diagrams, and exporting SVGs.
- Simplified Maintenance: The frontend and backend can be deployed, scaled, and upgraded independently.
- Enterprise Compliance: The static frontend can live in a locked-down DMZ or static hosting zone, while the Python microservice lives within the internal application network.