Skip to Content
ArchitectureOverview

Architecture Overview

IOTA SDK follows a layered, modular architecture built on Domain-Driven Design (DDD) principles.

System Architecture

Design Principles

1. Domain-Driven Design (DDD)

The codebase is organized around business domains rather than technical concerns. Each module represents a bounded context with its own:

  • Ubiquitous Language - Domain terms used consistently
  • Aggregates - Consistency boundaries
  • Entities - Objects with identity
  • Value Objects - Immutable concepts

2. Layered Architecture

Clear separation of concerns with four distinct layers:

LayerResponsibilityDependencies
PresentationHandle HTTP, render UIDepends on Services
ApplicationCoordinate use casesDepends on Domain
DomainBusiness logic & rulesNo external deps
InfrastructurePersistence, external APIsDepends on Domain

3. Multi-Tenancy

Single deployment serves multiple organizations (tenants) with complete data isolation:

Module System

Module Lifecycle

Module Communication

Modules communicate through:

  1. Event Bus - Loose coupling via domain events
  2. Service Registry - Direct service access via app.Service()
  3. Shared Entities - Core entities used across modules

Technology Stack

Backend

ComponentTechnologyPurpose
LanguageGo 1.24+Type-safe, performant
Routergorilla/muxHTTP routing
DatabasePostgreSQL 13+ACID, JSON support
Data accesssqlx + pgxQueries and driver
GraphQLgqlgenAPI schema
Validationgo-playground/validatorInput validation
i18ngo-i18nLocalization

Frontend

ComponentTechnologyPurpose
TemplatingTemplType-safe HTML
InteractivityHTMXAJAX via HTML
ReactivityAlpine.jsLightweight JS
StylingTailwind CSSUtility classes
IconsLucideSVG icons

Infrastructure

ComponentTechnologyPurpose
SessionsCookies + RedisStateful sessions
FilesHashFSFingerprinted assets
WebSocketCustom HubReal-time updates
EventsIn-memory BusPub/sub messaging

Request Flow

HTTP Request Processing

HTMX Request

For HTMX requests (AJAX), the flow is similar but:

  • Response is partial HTML (not full page)
  • Triggers client-side updates via HTMX attributes
  • Supports out-of-band swaps for multiple elements

Data Flow

Write Operation

Read Operation

Next Steps

Learn more about specific architectural patterns:

Last updated on