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
- Learn Deployment Modeling for infrastructure perspective
- Test yourself: see Beginner path for optional quiz references.