Skip to content

System Architecture

Service Registry

Ports, service codes, Snowflake worker IDs and base paths are generated from source - this is the single source of truth (also on Platform Facts):

14Services
14DB schemas
157Entities (tables)
0.1.1-5IGNIS
ServicePortBase pathSnowflakeService code
identity31010/v1/api/identity1SVC-00010-IDENTITY
commerce31020/v1/api/commerce2SVC-00020-COMMERCE
sale31030/v1/api/sale3SVC-00030-SALE
finance31040/v1/api/finance4SVC-00040-FINANCE
inventory31050/v1/api/inventory5SVC-00050-INVENTORY
ledger31060/v1/api/ledger6SVC-00060-LEDGER
pricing31070/v1/api/pricing7SVC-00070-PRICING
payment31080/v1/api/payment8SVC-00080-PAYMENT
signal31090/v1/api/signal9SVC-00090-SIGNAL
outreach31110/v1/api/outreach10SVC-00110-OUTREACH
helpdesk31032/v1/api/helpdesk0SVC-00120-HELPDESK
taxation31130/v1/api/taxation13SVC-00130-TAXATION
licensing31120/v1/api/licensing11SVC-00140-LICENSING
invoice1190/v1/api-SVC-00150-INVOICE

Auto-generated from packages/* env files + ServiceCodes + the schema tree at build time - never hand-typed.

Application base class - identity is the single trust root (issues JWKS); every other service verifies against it:

Base classServices
IssuerApplicationidentity
VerifierApplicationcommerce, sale, finance, inventory, ledger, pricing, payment, signal, outreach, helpdesk, taxation, licensing, invoice
infra (Traefik + Astro)gateway

Payment supports mode-based deployment: full (default, all-in-one), api (REST only, Snowflake 8), worker (BullMQ only, Snowflake 91, 92, ...).

Network Topology

Application Hierarchy

BaseApplication (@venizia/ignis)
  └── BaseApplication (@nx/core - CORS, Swagger, health check)
        ├── IssuerApplication (JWKS issuer - signs JWTs, serves /jw-certs)
        │     └── identity
        └── VerifierApplication (JWKS verifier - fetches remote /jw-certs)
              └── commerce, sale, finance, inventory, pricing, payment,
                  signal, ledger, outreach, licensing, taxation,
                  helpdesk, invoice

All services verify JWTs by fetching the identity service's /jw-certs JWKS endpoint. Only identity signs tokens.

Package Dependency Chain

Build order (from Makefile): third-parties first, then core, then all packages in dependency order. See Build System for the full target reference.

Database Schema Mapping

All schemas are defined in @nx/core and shared across services via the PostgresCoreDataSource. Each service connects to the same PostgreSQL database but operates on different schemas.

SchemaTablesPrimary ServicePurpose
helpdesk30helpdeskTickets, SLA, knowledge base, surveys, agents, notifications
public26identity, commerceUsers, roles, permissions, merchants, organizers, products, categories, variants, devices, sale channels, configurations
inventory17inventoryStock, purchase orders, purchase items, stock movements, materials, BOM
sale21saleSale orders, order items, checks, kitchen tickets, reservations, shifts
invoice9invoiceE-invoices, numbering, signatures, provider records
pricing9pricingFares, fare rules, costs, taxes, price evaluations
identity8identityUser credentials, identifiers, profiles, mail verification
ledger8ledgerLedger jobs, generated documents, data sources
finance6financeWallets, transactions, categories, vouchers
tax6taxationTax groups, tax templates, product tax provisioning
licensing5licensingPolicies, policy features, licenses, activations, license events
allocation4commerceEvent seating, venue layouts
outreach2outreachInquiries, subscribers
payment0paymentPaymentIntegration lives in the finance schema

Total: 151 tables across 14 schemas.

See Database Guide for migration workflow and ORM patterns.

Component Matrix

Which packages register which infrastructure components:

PackageKafka ProducerKafka ConsumerWebSocketCache RedisMail / SMS
core---Yes-
identity--Yes-Yes (SMS + Mail)
commerceYes-Yes--
saleYes-Yes--
finance-YesYes--
inventoryYesYesYes--
pricing-Yes---
ledgerYesYes---
taxation-Yes---
search-- (CDC)---
payment--Yes--
signal--Yes (E2E encrypted)--
outreach--Yes--
licensing---Yes-

See Event Architecture for the full topic and queue reference.

Frontend Applications

AppFrameworkPurposePort
@nx-app/clientReact 19 + Vite 7 + shadcn/uiAdmin dashboard3001
@nx-app/boReact 19 + Vite 7 + shadcn/uiBack office (merchant management)3000
@nx-app/sale-rendererReact 19 + Tauri 2 WebViewPOS desktop UI3002
@nx-app/sale-mainRust + Tauri 2POS desktop backend (SQLite, hardware plugins)-
@nx-app/overtureAstroMarketing / landing page4321
@nx-app/admin-ui-kitReact + Radix UIShared component library (43 shadcn + custom)-
@nx-app/coreTypeScriptShared constants, hooks, locales, utilities-

Third-Party Integrations

PackagePurposeProvider
@nx/mq-payMulti-provider payment (QR, Phone POS, Smart POS)VNPAY
@nx/mq-smsMulti-provider SMS gatewayVNPAY
@nx/iiapiVietnam e-invoice serviceVNPAY viiAPI
@nx/t-vanVietnam Tax Authority data transmissionT-VAN
PageDescription
Getting StartedLocal setup walkthrough
Build SystemMakefile targets, dependency graph
Event ArchitectureKafka topics, queues, WebSocket, CDC
Database GuideSchema details, migrations, ORM patterns
IGNIS PatternsApplication hierarchy, DI, controller factory
Packages OverviewPer-package documentation index

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.