Introducing Sruja: Why We're Building Architecture-as-Code for the AI Era
In an era where AI is reshaping software development, we need architecture tools that bridge human creativity and machine intelligence. Sruja is our answer—a bidirectional architecture editor that syncs visual diagrams with code, making architecture documentation machine-readable and AI-assistable.
If you’ve ever tried to maintain architecture diagrams in a modern software team, you know the pain: beautiful diagrams that become outdated within weeks, endless debates about which tool to use, and the constant tension between visual documentation and code-first workflows.
As AI transforms how we build software, this problem is about to get much worse—or much better, depending on the tools we choose.
Today, we’re excited to introduce Sruja, a bidirectional architecture editor that finally solves the visual-versus-code dilemma. But more importantly, we’re sharing why we believe architecture documentation needs to be machine-readable in the age of AI-assisted development.
The Problem: Architecture Documentation Doesn’t Scale
Picture this: You’re a senior engineer who just spent hours crafting the perfect system architecture diagram in Draw.io. It’s beautiful. It’s accurate. Everyone loves it.
Fast forward three months. The codebase has evolved. New services were added. Dependencies changed. But your diagram? It’s still sitting in Confluence, frozen in time, now actively misleading new team members.
Or maybe you’re a product manager trying to understand how your system works. The engineering team points you to a Mermaid diagram in a README file. It’s code, which is great for version control, but you can’t easily modify it or see it visually without learning the syntax.
Or perhaps you’re an architect trying to use AI assistants to help design new features. You ask ChatGPT to review your architecture, but all it sees is a PNG image. The AI can’t read the relationships, can’t understand the dependencies, can’t help you optimize the design.
This is the architecture documentation paradox:
- Visual tools (Draw.io, Lucidchart) are intuitive but disconnected from code
- Code tools (Mermaid, PlantUML) are version-controllable but inaccessible to non-developers
- None of them sync bidirectionally
- None of them are truly AI-friendly
We’ve all accepted this tradeoff for years. But in the AI era, it’s no longer acceptable.
Why This Matters in the AI Era
AI assistants are becoming integral to software development. GitHub Copilot, Cursor, ChatGPT, Claude—they’re all helping developers write code faster, debug issues quicker, and design systems better.
But here’s the thing: AI needs structured, machine-readable data to be useful.
When you show an AI assistant a PNG diagram, it can describe what it sees, but it can’t:
- Understand the relationships between components
- Suggest architectural improvements based on best practices
- Generate implementation code from the architecture
- Detect inconsistencies or anti-patterns
- Keep the architecture in sync with code changes
When you give an AI assistant structured, parseable architecture data (like code), suddenly it can:
- ✅ Analyze dependencies and suggest optimizations
- ✅ Generate boilerplate code from architecture models
- ✅ Validate architectural decisions against patterns
- ✅ Help refactor architectures as requirements evolve
- ✅ Answer questions about system design with actual context
This is why Architecture-as-Code matters now more than ever.
But “code-only” solutions have a fatal flaw: they exclude 70% of your team. Product managers, designers, business stakeholders—they can’t easily contribute to or understand architecture when it’s locked in code.
The Sruja Solution: Bidirectional Sync
Sruja is built on a simple but powerful idea: architecture documentation should work like Notion works for documents.
In Notion, you can edit visually with a rich editor, but underneath, it’s structured markdown that syncs bidirectionally. Edit the visual representation, and the markdown updates. Edit the markdown, and the visual representation updates. Everyone can use the tool in the way that makes sense for them.
Sruja brings this same paradigm to architecture:
Visual-First for Everyone
Product managers can drag and drop components onto a canvas. They don’t need to learn DSL syntax. They can see relationships visually. They can understand the system at a glance.
Code-First for Developers
Developers can write .sruja files directly. They get autocomplete, validation, and the full power of their IDE. The code is version-controlled in Git. It integrates with CI/CD pipelines.
Bidirectional Sync: The Magic
Here’s where it gets interesting: changes sync both ways automatically.
- Edit a diagram visually → The
.srujacode updates in real-time - Edit the
.srujacode → The visual diagram updates automatically - Export your architecture → Get a clean, version-controlled
.srujafile - Commit to Git → Your entire team can see the changes
This isn’t one-way sync (like Structurizr). This isn’t “export to code” (like Draw.io). This is true bidirectional sync, where both representations are always in sync.
AI-Friendly by Design
Because Sruja architectures are stored as structured DSL files, AI assistants can:
- Read and understand your architecture (it’s not a black-box image)
- Generate suggestions based on architectural patterns and best practices
- Help you iterate on designs through conversational interfaces
- Keep documentation current by analyzing code changes and suggesting architecture updates
- Answer questions about your system with actual context from the architecture model
Imagine asking ChatGPT: “Review my microservices architecture and suggest optimizations”—and it can actually read your architecture file, understand the relationships, and provide actionable feedback.
Or imagine using Copilot to generate boilerplate code that matches your architecture exactly, because it understands the structure you’ve defined.
This is the future of architecture documentation: human-friendly visuals, developer-friendly code, and AI-friendly structure—all in one.
How Sruja Helps Different Roles
For Developers and Architects
The workflow you’ve always wanted:
# Write architecture as code
cat > my-architecture.sruja << 'EOF'
person = kind "Person"
system = kind "System"
container = kind "Container"
database = kind "Database"
customer = person "Customer"
ecommerce = system "ECommerce" {
web = container "Web App" {
technology "React"
}
api = container "API Gateway" {
technology "Node.js"
}
db = database "PostgreSQL" {
technology "PostgreSQL 14"
}
}
customer -> ecommerce.web "visits"
ecommerce.web -> ecommerce.api "calls"
ecommerce.api -> ecommerce.db "reads and writes to"
EOF
# Validate and lint
sruja lint my-architecture.sruja
# Export to visualize
sruja export json my-architecture.sruja
Then open it in the visual designer, make changes with drag-and-drop, and see the code update automatically. Or work entirely in code. Your choice.
Integration with your workflow:
- Version control in Git (
.srujafiles are just text) - CI/CD integration (validate architecture in pipelines)
- LSP support (autocomplete, syntax highlighting in your IDE)
- Export to multiple formats (JSON, Markdown, Mermaid)
For Product Managers
The visual interface you need:
- Open Sruja Designer (no installation, works in browser)
- Create architecture diagrams with drag-and-drop
- See relationships, components, and flows visually
- Export to share with stakeholders
- Switch to code view to see the structured representation (optional)
No need to learn DSL syntax. No need to wait for engineering to update diagrams. You can iterate on architecture visually, and the code representation stays in sync.
For Teams Collaborating
True collaboration:
- Developers work with code, get all the benefits of version control
- Product managers work visually, contribute without coding
- Both see the same architecture, always in sync
- AI assistants can read and help improve the architecture
- Documentation stays current because it’s connected to the workflow
No more “who owns the architecture diagram?” No more “is this diagram still accurate?” The architecture lives in Git, evolves with your codebase, and everyone can contribute in the way that works for them.
The Road Ahead
Sruja is still in alpha. We’re building fast, but we know we have a long way to go. Here’s what’s working today:
✅ Bidirectional visual ↔ code sync
✅ Visual designer (web-based, no installation)
✅ CLI tool for developers
✅ DSL validation and linting
✅ Export to JSON, with more formats coming
✅ VS Code extension (early version)
And here’s what’s coming:
🔄 Real-time collaboration
🔄 AI assistant integrations
🔄 Architecture pattern library
🔄 Automated architecture drift detection
🔄 Integration with popular tools (GitHub, GitLab, Jira)
But we’re sharing Sruja now because we believe the conversation about architecture tools in the AI era needs to happen now, not later.
Try Sruja Today
Ready to see what bidirectional architecture sync feels like?
Try Sruja Designer → (no signup required)
Open it in your browser, create a simple architecture, and watch the code tab update as you drag components around. Then edit the code, and watch the diagram update. It’s the “Notion moment” for architecture—that feeling when you realize this is how it should have worked all along.
Or if you’re a developer who wants to dive into the code:
curl -fsSL https://raw.githubusercontent.com/sruja-ai/sruja/main/scripts/install.sh | bash
Then check out our examples and documentation.
Why We’re Building This
We’re building Sruja because we’ve lived the pain of outdated architecture documentation. We’ve seen teams waste hours maintaining diagrams that nobody trusts. We’ve watched product managers struggle to understand systems because the documentation was locked in developer tools.
But more than that, we’re building Sruja because we see what’s coming: AI assistants that can help us design better systems, if only we give them the right data. We see a future where architecture documentation isn’t a burden—it’s a living, breathing part of the development process that makes everyone more productive.
We’re building Sruja because architecture deserves better tools. Tools that work for humans, work for machines, and work for the AI-augmented future we’re all building together.
Join us. Try Sruja. Share your feedback. Contribute to the project. Help us shape the future of architecture documentation.
This is just the beginning.
Key Takeaways
- Architecture documentation is broken: Visual tools disconnect from code, code tools exclude non-developers, and nothing syncs bidirectionally
- AI needs structured data: AI assistants can’t help with architecture when it’s locked in images—they need machine-readable, structured formats
- Bidirectional sync is the solution: Like Notion for documents, architecture tools should let everyone work in their preferred way (visual or code) with automatic sync
- Sruja is in alpha: We’re building the future of architecture documentation, and we’d love your feedback
- Try it today: Sruja Designer is free, works in your browser, and requires no signup
Further Reading
- Sruja Documentation - Complete guides and tutorials
- GitHub Repository - Open source, contributions welcome
- Language Specification - Full DSL reference
- Examples Gallery - 40+ real-world architecture examples
Have questions or feedback? Join our Discord or open an issue on GitHub.