Skip to content

Architecture Overview

System Architecture Philosophy

The ABS Platform is built on a hub-and-spoke architecture within the broader DIRAC framework, designed to coordinate complex multi-stakeholder ecosystems while maintaining high performance and scalability. The architecture separates concerns between API coordination (FED), messaging orchestration (BRO), and domain-specific services (ABS, ARM, etc.).

DIRAC Framework Integration

Core Components

The ABS Platform operates as a key component within the DIRAC framework's six-layer architecture:

DIRAC Framework Architecture

Component Responsibilities

UXI (Unified User Experience)

  • Single Point of Access: Unified web and mobile interfaces
  • React Applications: Responsive customer and operator interfaces
  • Authentication & Authorization: Centralized user management
  • Multi-Tenant Support: Customer, operator, and management portals

FED (Federated API Layer)

  • GraphQL Gateway: Type-safe, unified API interface
  • Service Orchestration: Coordinated calls across ABS, ARM, and external systems
  • Schema Federation: Combined schemas from multiple services
  • Request Routing: Intelligent routing to appropriate service endpoints

BRO (Messaging Broker Exchange)

  • MQTT Hub: Real-time event coordination using /dirac/{domain}/* topics
  • Event Orchestration: Asynchronous communication between components
  • Signal Compression: External complexity reduced to fundamental FSM inputs
  • Message Persistence: Reliable delivery and replay capabilities

ABS Platform Core Architecture

Layered Architecture Design

ABS Platform Architecture

Key Architectural Principles

1. Finite State Machine (FSM) Foundation

  • O(1) Performance: Precomputed transition maps for constant-time state lookups
  • Mathematical Correctness: Pure functions implementing f:(S,Σ)→(S′,P(Λ))
  • Signal Compression: Complex external events compressed to fundamental FSM inputs
  • Deterministic Behavior: Predictable state transitions with comprehensive validation

2. Data-Driven Agent Architecture

  • Functional Design: Agent logic as pure TypeScript functions
  • Plugin Registry: Extensible agent registration and execution system
  • Context Injection: Rich execution context with calculation utilities
  • Model Confinement: Agent-specific state types isolated from shared schemas

3. Template-Driven Configuration

  • ServicePlanTemplate: Immutable configuration templates for service models
  • Version Pinning: Agent versions pinned at template creation for stability
  • Country/Jurisdiction Binding: Legal and currency frameworks defined at template level
  • Configuration Inheritance: ServicePlans inherit all template settings

4. Event-Driven Messaging

  • MQTT Integration: Real-time communication with IoT devices and external systems
  • Signal Patterns: Emit/echo for coordination, call/return for critical operations
  • Topic Conventions: Structured topic hierarchies for message routing
  • Message Persistence: Reliable delivery with replay capabilities

Technology Stack

Backend Technologies

Node.js + TypeScript

  • Performance: Asynchronous I/O for high-concurrency service coordination
  • Type Safety: Complete TypeScript implementation with strict typing
  • Ecosystem: Rich npm ecosystem for rapid development
  • Scalability: Horizontal scaling through stateless service design

GraphQL with Apollo Server

  • Type Safety: Schema-first development with automatic validation
  • Federation: Combined schemas from multiple services
  • Real-time: Subscription support for live updates
  • Caching: Intelligent query caching and optimization

Database & Persistence

  • TypeORM: Object-relational mapping with migration support
  • PostgreSQL: ACID-compliant transactions with JSON support
  • Redis: High-performance caching and session management
  • State Persistence: Pluggable persistence with versioned state management

Frontend Technologies

React.js Ecosystem

  • Component Architecture: Reusable UI components with TypeScript
  • State Management: Redux Toolkit for predictable state management
  • GraphQL Client: Apollo Client for type-safe API integration
  • Mobile Support: React Native for cross-platform mobile applications

Infrastructure & Deployment

Containerization

  • Docker: Containerized services with multi-stage builds
  • Kubernetes: Orchestrated deployment with auto-scaling
  • Helm Charts: Templated deployments for multiple environments
  • Service Mesh: Istio for service-to-service communication

Monitoring & Observability

  • Prometheus: Metrics collection and alerting
  • Grafana: Operational dashboards and visualization
  • Jaeger: Distributed tracing for request flow analysis
  • ELK Stack: Centralized logging and log analysis

Integration Architecture

External System Integration

Odoo ERP Integration

  • Payment Processing: Subscription billing and deposit management
  • Customer Management: CRM integration with customer lifecycle
  • Financial Reporting: Revenue recognition and financial analytics
  • MQTT Synchronization: Real-time payment status updates

ARM (Asset Relations Management)

  • Asset Tracking: Battery and station inventory management
  • IoT Device Management: Device monitoring and control
  • Digital Twins: Real-time asset state representation
  • Fleet Optimization: AI-powered asset allocation and maintenance

External API Integration

  • Payment Gateways: Multiple payment processor support
  • Identity Providers: OAuth 2.0 and SAML integration
  • Mapping Services: Location-based services for station finding
  • Notification Services: SMS, email, and push notification delivery

Message Flow Patterns

Service Request Flow

  1. Customer Request: Mobile app initiates service request
  2. FED Coordination: GraphQL mutation coordinates service allocation
  3. ABS Processing: Service plan validation and agent execution
  4. ARM Integration: Asset allocation and availability checking
  5. BRO Messaging: Real-time status updates to customer and operators
  6. Odoo Synchronization: Billing and usage tracking updates

Asset State Synchronization

  1. IoT Events: Battery and station sensors emit state changes
  2. ARM Processing: Asset state updates and validation
  3. BRO Broadcasting: Asset state changes broadcasted to relevant services
  4. ABS Updates: Service availability and allocation updates
  5. Customer Notification: Real-time updates via mobile app

Performance & Scalability

Performance Characteristics

FSM Engine Performance

  • O(1) State Transitions: Constant-time lookups regardless of FSM complexity
  • Memory Efficiency: Precomputed transition maps minimize runtime computation
  • Concurrent Processing: Lock-free state transitions for high throughput
  • Validation Caching: Cached validation results for repeated operations

Horizontal Scalability

  • Stateless Services: All services designed for horizontal scaling
  • Database Sharding: Partitioned data for distributed storage
  • Message Queue Scaling: Distributed MQTT brokers for high message throughput
  • CDN Integration: Static asset delivery through global CDN

Capacity Planning

Traffic Patterns

  • Peak Usage: Morning and evening commute time optimization
  • Geographic Distribution: Multi-region deployment for latency optimization
  • Seasonal Variations: Capacity scaling for holiday and event traffic
  • Growth Projections: Linear scaling architecture for business growth

Resource Allocation

  • CPU Optimization: Agent processing and FSM calculations
  • Memory Management: State caching and session management
  • Network Bandwidth: MQTT message throughput and API requests
  • Storage Requirements: Transaction history and audit trail retention

Security Architecture

Authentication & Authorization

Multi-Tenant Security

  • Role-Based Access Control: Granular permissions by user type and organization
  • JWT Tokens: Stateless authentication with secure token validation
  • API Rate Limiting: Request throttling and abuse prevention
  • Session Management: Secure session handling with automatic expiration

Data Protection

  • Encryption at Rest: Database and file storage encryption
  • Encryption in Transit: TLS 1.3 for all network communication
  • Personal Data Protection: GDPR and local privacy regulation compliance
  • Audit Logging: Comprehensive audit trails for all system actions

Infrastructure Security

  • Network Segmentation: Isolated network zones for different service tiers
  • Container Security: Vulnerability scanning and secure base images
  • Secrets Management: Centralized secret storage and rotation
  • Backup Security: Encrypted backups with secure recovery procedures

Quality Assurance

Testing Strategy

  • Unit Testing: Comprehensive test coverage for all business logic
  • Integration Testing: End-to-end workflow validation
  • Performance Testing: Load testing and capacity validation
  • Security Testing: Vulnerability assessment and penetration testing

Monitoring & Alerting

  • Business Metrics: Service availability and customer satisfaction tracking
  • Technical Metrics: System performance and resource utilization
  • Alert Management: Proactive alerting with escalation procedures
  • Incident Response: Automated incident detection and response workflows

The architecture represents a mature, production-ready platform designed for enterprise-scale multi-stakeholder coordination while maintaining the flexibility and performance required for real-time service delivery.