Toshfa OptimaX Toshfa OptimaX Full System Architecture
Full System Architecture

Toshfa OptimaX

A layered, secure, deploy-anywhere architecture for the complete medical-insurance lifecycle — prepared for Amana's technical and infrastructure review.

Angular · PrimeNG · Tailwind ASP.NET Core · Dapper SQL Server Dedicated Per Insurer IIS · Windows Server On-Prem · Amazon EC2 (IaaS)
Acess Meditech
Prepared for: Amana — CTO / CIO / Enterprise & Solution Architects / Security / DevOps
Overview · 01

Executive Summary

One platform, whole lifecycle — architected for isolation, security and multi-cloud portability.

Platform Snapshot
15+
Business domains
Quote · Policy · Provider · Finance · CRM
Dedicated
Database per insurer
Hard, physical data isolation
Governed
Stored-procedure data access
No dynamic or ORM-generated SQL
Multiple
Live insurer deployments
Each isolated, instance + database

Modular

Each domain owns its procedures, services and API surface.

Dedicated per insurer

Own instance, own database — hard data isolation, not row-level tenancy.

Secure by default

JWT + refresh + OTP, form-level RBAC, immutable audit.

Deploy anywhere

IIS-hosted — on-prem or Amazon EC2 (IaaS).

Thesis — every architectural choice serves isolation, auditability, performance and portability.
Principles · 02

Deployment Model — Standalone Per Insurer

No tenant concept in the system: each insurer runs a completely separate, standalone application and its own database.

Isolation Model
Insurer A
App Instance A
Database A
Insurer B
App Instance B
Database B
Insurer C
App Instance C
Database C
No shared path — no query, backup, credential or migration path crosses an insurer boundary. Each instance is scaled, patched and upgraded independently.

Data isolation

Physical separation — the strongest boundary for compliance.

Independent ops

Scale, patch or upgrade one insurer without touching another.

Regulatory fit

Simplifies data-residency and CCHI/NPHIES audit obligations.

Architecture · 03

Layered Architecture

Client → API → Data → Services, wrapped in a hosting/runtime layer. Control flows one direction.

5 Tiers
Client
Angular SPA
API
ASP.NET Core
Data
Dapper · SQL Server
Services
Jobs · CRM · AI
Runtime
IIS · Windows Server
Design rule — the browser never touches the database. Every request is authenticated at the gate, business rules run once in the service layer, and data access is centralised through governed stored procedures.
Architecture · 04

Technology Stack

Mainstream, enterprise-proven components — easy to hire for, easy to support, no exotic dependencies.

Full Stack
Client
Angular · PrimeNG
SPA + enterprise UI components
Tailwind CSS
Responsive — desktop/tablet/mobile
JWT Auth Client
Attach + auto-refresh tokens
API
ASP.NET Core
REST, one surface per domain
Middleware Pipeline
AuthN · context · logging
Security Layer
JWT + refresh · RBAC · OTP
Data
Dapper
Micro-ORM over stored procedures
SQL Server
System of record, per insurer
Elasticsearch
Party search & BI read index
Services
Hangfire
Scheduled + background jobs
WhatsApp Business
Omnichannel CRM
SMTP / SMS
Transactional notifications
AI Query Engine
Natural-language data query
Runtime
IIS · Windows Server
Hosts Angular front end + API
Docker · Kubernetes
Elasticsearch only
On-Prem / Amazon EC2 (IaaS)
Same deployment, any target
Architecture · 05

API Request Lifecycle

Every request follows the same governed path from the edge to the database and back.

ASP.NET Core · IIS
1
Secure Edge
WAF, reverse proxy and load balancer terminate HTTPS and route the request.
2
Middleware Pipeline
JWT validation, request context, correlation/logging, exception shaping.
3
Controllers thin
Route, bind and validate the request — no business logic here.
4
Domain Services rich
Business rules — rating, adjudication, endorsement calculation, workflow transitions.
5
Dapper Repositories
Typed calls into stored procedures — no dynamic SQL in the request path.
6
SQL Server
Stored procedure executes against the insurer's dedicated database; JSON/typed result returns to the client.
Architecture · 06

Data Architecture

Stored-procedure-first access to a dedicated database per insurer.

SQL Server

Governed data contract

  • All reads & writes pass through stored procedures — none inline or ORM-generated
  • Consistent naming: SPME_<Module>_<Action>
  • Every procedure independently reviewable by a DBA
  • No shared registry — each insurer's application is entirely standalone

Core domain data groups

  • Identity & access — users, roles, permissions, tokens
  • Quotation → Policy → Endorsement
  • Provider network — profiles, contracts, price lists
  • Claims — intake, adjudication, denial reasons
  • Finance — double-entry ledger
  • Workflow engine, Documents, HDF underwriting
  • Regulatory — CHI/IA tables
Dedicated
Database per insurer
Governed
Stored-procedure data access
1
Dedicated database per insurer
Architecture · 07

Integration Architecture

A dedicated integration layer — external calls never sit inside domain business logic.

Regulatory + External

Regulatory (ships with core)

  • NPHIES eligibility & pre-auth adjudication, denial codes
  • CCHI policy registration & member upload
  • SFDA-aligned medicine master

Identity & partner systems

  • Yakeen/Absher, Muqeem, GOSI verification
  • TPA & provider RCM/HIS systems
  • PBM for medication decisioning
  • ERP payables & general ledger

Messaging & search

  • WhatsApp Business, SMTP, SMS
  • OCR intake for scanned documents
  • Elasticsearch party search
  • AI natural-language query engine
Scope note — the regulatory data model ships with core OptimaX; the depth of live system-to-system connectivity per integration is a go-live configuration and scope decision — see the Workflow Blueprint's feature-availability matrix.
Architecture · 08

Security Architecture

Defence in depth — from the network edge to the row of data.

Security

Perimeter

  • WAF, reverse proxy, load balancer — single hardened ingress
  • HTTPS-only external traffic

Identity & access

  • JWT + hashed refresh tokens, OTP where configured
  • RBAC enforced to individual forms & permissions

Data protection & audit

  • Immutable audit trail on financial & identity changes
  • Per-insurer database isolation as a security control

Application-layer

  • Stored-procedure-only access removes SQL-injection surface
  • Middleware centralises every authZ/authN check
Architecture · 09

Background Processing & Workflow Engine

Scheduled execution and configurable business process orchestration.

Hangfire · Workflow

Hangfire background jobs

  • Recurring reports & batch-style processing
  • Reminder & escalation jobs
  • Job/queue/state history — retries tracked, not fire-and-forget

Configurable workflow engine

  • Approval chains as data, not hard-coded logic
  • Case assignment, escalation, status transitions
  • Business users change rules — no code deployment
Why it matters — this is the mechanism that lets a business user change an auto-approval rule, add a rejection reason, or adjust an SLA threshold live, without a developer or a release.
Architecture · 10

Deployment Topology

Single secure ingress, isolated application core per insurer — the same shape on any infrastructure.

On-Prem · Amazon EC2 (IaaS)
Actors
Insurer Staff
Brokers / Agents
Members / Providers
Secure Edge
WAF · Reverse Proxy · Load Balancer
Application Core (IIS)
Angular · ASP.NET Core · Dapper
Platform Services
Identity · Jobs · Search · Workflow · Docs · Audit
Isolated Per Insurer
Dedicated Database
External Systems
Architecture · 11

Deployment Targets

Same IIS-hosted deployment, two infrastructure choices — no code changes between them.

Portability

On-Premises primary

Inside Amana's own data centre, behind existing perimeter controls, IIS on Amana-managed Windows Server infrastructure. Best fit where data residency demands the platform stay fully within Amana's environment.

Amazon EC2 IaaS

IIS on Windows Server virtual machines running on Amazon EC2 — infrastructure-as-a-service, so Amana trades infrastructure ownership for elasticity and managed operations without any change to application code. Elasticsearch runs on Amazon EKS alongside it.

Architecture · 12

Scalability, HA & Disaster Recovery

Designed to scale horizontally; HA/DR posture finalised with Amana's infrastructure standards.

Resilience

Scalability

  • Stateless API tier — add IIS server instances behind the load balancer
  • Elasticsearch offloads search/read load from SQL Server
  • Hangfire moves heavy/batch work off the request path

HA & DR

  • Windows Server / IIS health monitoring restarts failed instances; Kubernetes does the same for Elasticsearch
  • SQL clustering/replication and DR RPO/RTO configured per deployment
  • Finalised jointly with Amana's infrastructure team during solution design
Architecture · 13

DevOps & Delivery Model

Standard CI/CD to IIS — one build, any target.

CI/CD
Source
Build & Test
IIS Deployment Package
Dev → QA → UAT
Production
Monitor
Configuration ≠ deployment — rules, workflows, benefit tables and reports change at runtime by business users, not through a code release. Exact CI/CD tooling is agreed with Amana's IT team during implementation planning.
Appendix · 14

Platform Snapshot

The profile behind the architecture.

Reference
MetricValue
Business domains15+
Data accessStored-procedure-first via Dapper (SPME_<Module>_<Action>)
Deployment modelStandalone application & database per insurer — no tenant concept
FrontendAngular · PrimeNG · Tailwind CSS
BackendASP.NET Core REST · Dapper
DatabaseSQL Server, one per insurer
SearchElasticsearch
Background processingHangfire
MessagingWhatsApp Business · SMTP · SMS
Application hostingIIS (Windows Server)
Search infrastructureElasticsearch — containerised via Docker · Kubernetes
Deployment targetsOn-Premises (primary) · Amazon EC2 (IaaS)
Close · 01

Why This Architecture

Six commitments, every one demonstrated in this deck.

The Case

Modular & Proven

15+ domains, governed procedures throughout.

True Isolation

Dedicated instance & database per insurer.

Secure & Audited

JWT + RBAC + immutable audit trail.

Performance-First

Dapper + governed SQL, ES offload, async jobs.

Deploy Anywhere

IIS-hosted — on-prem or Amazon EC2 (IaaS).

AI-Ready

Live NL query today; a foundation for more.

Full System Architecture

Questions &
Discussion

Happy to deep-dive any layer — security & identity, isolation model, data, deployment, or delivery.

Security & Identity Isolation Model Data & Integration Deployment & DR
Toshfa OptimaX — Enterprise Medical Insurance Platform · Confidential