Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DSL Basics

Sruja is an architecture DSL. This tutorial introduces its core elements.

Elements

import { * } from 'sruja.ai/stdlib'


Shop = system "Shop API" {
  WebApp = container "Web" {
    description "Gateway layer"
  }
  CatalogSvc = container "Catalog"
  MainDB = database "Database"
}

User = person "User"

User -> Shop.WebApp "Uses"
Shop.WebApp -> Shop.CatalogSvc "Routes"
Shop.CatalogSvc -> Shop.MainDB "Reads/Writes"

view index {
  include *
}

Descriptions and Metadata

import { * } from 'sruja.ai/stdlib'


Payments = system "Payments" {
  description "Handles payments and refunds"
  // metadata
  metadata {
    team "FinTech"
    tier "critical"
  }
}

Component‑level Modeling

import { * } from 'sruja.ai/stdlib'


App = system "App" {
  Web = container "Web" {
    Cart = component "Cart"
  }
}

Next Steps