Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ sruja Public

Sruja is a developer-friendly language for defining, visualizing, and validating software architecture. It brings governance to architecture design and supports AI-driven development—helping individuals follow best practices and enabling organizations to standardize systems with consistent policies and standards.

License

Notifications You must be signed in to change notification settings

sruja-ai/sruja

Repository files navigation

Sruja

Sruja is a next-generation architecture-as-code language with first-class support for requirements, ADRs, and extensible validation.

⚠️ Alpha Release (v0.1.0): Sruja is under active development. APIs may change. See ROADMAP.md for the path to v1.0.0.

Documentation

https://sruja.ai

Features

  • 🎯 Architecture DSL: Define systems, containers, components, and relations
  • Validation Engine: Cycle detection, orphan detection, unique IDs, valid references
  • 📊 D2 Export: Export to D2 diagrams for rendering
  • 🎨 Code Formatter: Auto-format your architecture with sruja fmt
  • 🌳 Tree View: Visualize hierarchy with sruja tree

Project Structure

sruja/
├── cmd/
│   └── sruja/            # Main CLI tool
├── pkg/                  # Shared Go packages
│   ├── engine/           # Validation engine
│   ├── language/         # Parser, AST, lexer
│   └── export/           # Exporters (D2, etc.)
└── examples/             # Example .sruja files

Installation

Automated Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/sruja-ai/sruja/main/scripts/install.sh | bash

Manual Download

Download the latest release from GitHub Releases.

From Source

go install github.com/sruja-ai/sruja/cmd/sruja@latest

Quick Start

Create example.sruja:

architecture "My System" {
    system App "My App" {
        container Web "Web Server"
        datastore DB "Database"
    }
    person User "User"

    User -> Web "Visits"
    Web -> DB "Reads/Writes"
}

Export to D2:

sruja export d2 example.sruja

Lint your code:

sruja lint example.sruja

Format your code:

sruja fmt example.sruja

View hierarchy:

sruja tree --file example.sruja

Development

Prerequisites

  • Go 1.25+

Setup

# Install dependencies
go mod download

# Setup git hooks (recommended)
make setup-hooks

# Build CLI
make build

Git Hooks

A pre-commit hook automatically tests code compilation when you commit changes to the learn/ directory. This prevents broken code from being committed.

Setup:

make setup-hooks

The hook will:

  • Test playground examples compile correctly
  • Test course code blocks compile correctly
  • Test docs code blocks compile correctly
  • Block commits if any code fails to compile

See docs/DEVELOPMENT.md for more details.

Contributing

We welcome contributions of all sizes — from small doc fixes to core features.

Pull Request Checklist

  • Run local checks: make test, make fmt, make lint
  • Add/update tests for new behavior
  • Keep changes focused and well‑scoped
  • Use Conventional Commits (e.g., feat: …, fix: …, docs: …)

License

MIT

About

Sruja is a developer-friendly language for defining, visualizing, and validating software architecture. It brings governance to architecture design and supports AI-driven development—helping individuals follow best practices and enabling organizations to standardize systems with consistent policies and standards.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published