DSL Basics
Learn Sruja syntax: systems, containers, persons, relations, and descriptions.
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
- Take the quiz: DSL Basics Quiz