A minimal but complete example of defining a software architecture as version-controlled YAML using the C4 model (System → Container → Component → Code).
Diagrams drawn in GUI tools drift out of date the moment code changes. Keeping your C4 model in a plain-text file next to your code means it is:
- Version-controlled — history, blame, and rollbacks like any other file.
- Reviewed in pull requests — architecture changes are discussed where code is.
- CI-checkable — you can fail a build when the documented architecture no longer matches reality.
archyl.yaml defines a small "Checkout" system: a web app, a payments API with two components, an orders database, and an external Stripe system, with the relationships between them.
This is the format used by Archyl, an AI-powered architecture documentation platform built on the C4 model. Commit archyl.yaml to your repo and Archyl renders interactive C4 diagrams, then computes a drift score (0–100%) of how well the model matches your actual codebase. Full schema and docs: https://www.archyl.com/docs.
Container types: web_app, mobile_app, desktop_app, api, database, file_storage, message_queue, cache, service, function, worker, consumer, infrastructure, gateway, library
Relationship types: uses, depends_on, calls, reads_from, writes_to, sends_to, receives_from, implements, extends, contains, deployed_on, provisions, publishes_to, consumes_from
- C4 model: https://c4model.com/
- Architecture as Code with Archyl: https://www.archyl.com