Software Architecture Documentation Template (Free)
The usual way an architecture document gets written: a new engineer joins, asks how the system fits together, and someone promises to "write it down properly". They search for a software architecture documentation template, find a forty-page Word file from 2012 or a university PDF, fill in half of it, and never open it again. A year later the next new hire finds it, trusts it, and gets it wrong.
The problem is rarely the lack of a template. It's templates that ask for everything, so nothing gets finished, and documents with no owner, so nothing gets updated. The template below is deliberately lean: one markdown file, nine sections, each one there because someone reading it will need it. Copy it into your repository, no signup, no download. Then read the section-by-section notes on what goes in each part, and how to stop it going stale.
What an architecture document is for (and who reads it)
An architecture document answers the questions that code can't answer quickly: what the system is for, what it talks to, how it's split up, why it's split that way, and what's known to be fragile. It isn't a design spec for one feature, and it isn't an API reference.
It has five kinds of reader, and it helps to write for them by name:
| Reader | What they need from it | Sections they'll read |
|---|---|---|
| A new engineer, week one | Where things are and how a request flows | Context, containers, key flows, glossary |
| A reviewer of a design change | What the change touches and what was already decided | Containers, decisions, quality goals |
| The on-call engineer at 3 am | What depends on what, and what's known to break | Containers, key flows, risks |
| An auditor or a security review | Boundaries, data flows, external parties | Context, constraints, decisions |
| You, in a year | Why you did it this way | Decisions, risks |
If a section in your document serves none of them, delete it. That rule does more for documentation quality than any template.
A note on names: "architecture document", "system design document" (SDD) and "software architecture document" (SAD) get used for roughly the same thing. SDD templates tend to be written per project or per feature and include detailed design; an architecture document describes the system as it is and changes with it. The template here is the second kind.
The template (one markdown block)
Copy this into docs/architecture.md (or ARCHITECTURE.md at the root) and fill it in. Everything in angle brackets is a placeholder. Delete any section that doesn't apply rather than leaving it empty.
# <System name>: Architecture
| | |
|---|---|
| Owner | <team or person accountable for keeping this true> |
| Last reviewed | <YYYY-MM-DD> |
| Next review | <YYYY-MM-DD, or "on every change to sections 3-5"> |
| Status | <draft / current / being replaced by X> |
## 1. Context and scope
<Two or three sentences: what the system does, for whom, and why it exists.>
**Users**
- <Role>: <what they do with the system>
**External systems**
- <System>: <what we send or receive, protocol>
**Out of scope**
- <Things people assume this system does but it doesn't>
**System context diagram (C4 level 1)**
<Link or embed. The system as one box, every kind of user, every external system.>
## 2. Quality goals
The three to five qualities that win when they conflict with each other, in priority order.
| Priority | Quality | Concrete scenario |
|---|---|---|
| 1 | <e.g. Availability> | <e.g. Checkout keeps working when the recommendation service is down> |
| 2 | <e.g. Latency> | <e.g. p95 checkout under 2 s at 500 orders/minute> |
| 3 | <e.g. Changeability> | <e.g. A new payment method ships without touching the order service> |
## 3. Constraints
Things we didn't choose but have to live with.
- <e.g. Runs on the company Kubernetes platform>
- <e.g. Customer data stays in the EU>
- <e.g. Backend services in Go or Java only>
## 4. Architecture
**Container diagram (C4 level 2)**
<Link or embed. Every deployable unit and data store, with technology and protocols.>
| Container | Technology | Responsibility | Owner |
|---|---|---|---|
| <Web app> | <React SPA> | <What it does> | <Team> |
| <API> | <Go> | <What it does> | <Team> |
| <Database> | <PostgreSQL> | <What it stores> | <Team> |
**Component diagrams (C4 level 3)**
<Only for the one or two containers a newcomer would struggle with. Link or embed.>
**Key flows**
<The two or three scenarios that matter most, as numbered steps or a C4 dynamic diagram.>
1. <Actor> -> <Container>: <what happens>
2. <Container> -> <Container>: <what happens, protocol, sync or async>
## 5. Key decisions
Full records live in <docs/adr/>. This is the index.
| ADR | Decision | Status | Date |
|---|---|---|---|
| [ADR-001](adr/001-<slug>.md) | <e.g. One database per service> | Accepted | <YYYY-MM-DD> |
| [ADR-002](adr/002-<slug>.md) | <e.g. Kafka for order events> | Accepted | <YYYY-MM-DD> |
## 6. Crosscutting concerns
How the whole system handles things every container touches. One or two lines each, with a link to detail.
- **Authentication and authorization:** <where it happens, what token>
- **Observability:** <logs, metrics, traces, where to look>
- **Error handling and retries:** <conventions, idempotency>
- **Data and privacy:** <PII locations, retention>
## 7. Deployment and operations
- **Environments:** <production, staging, ...> and how they differ
- **Where it runs:** <cloud, region, cluster>
- **Runbooks:** <link>
- **Dashboards and alerts:** <link>
## 8. Risks and technical debt
| Risk or debt | Impact if it bites | Plan | Owner |
|---|---|---|---|
| <e.g. Stock reserved before payment, no compensation> | <Phantom reservations after payment failures> | <Add release on failure, Q4> | <Team> |
## 9. Glossary
| Term | Meaning here |
|---|---|
| <Order> | <Definition as the business uses it> |
That's the whole template. Filled in for a system with ten or so containers, it typically runs a few pages. If yours runs much longer, something in it probably belongs in a linked document rather than this one.
Section by section
Header: owner and review date
The four lines at the top matter more than any section below them. Owner says who fixes the document when it's wrong. Last reviewed tells a reader how much to trust it. A document that says "last reviewed fourteen months ago" is honest; one that says nothing looks current when it isn't.
1. Context and scope
Start here because every other section depends on the boundary. List every kind of user and every external system, including the ones you take for granted (identity provider, email service, payment gateway). The out of scope list saves more meetings than anything else in the document: it's where you write down that this system doesn't handle refunds, even though everyone assumes it does.
The diagram is a C4 system context diagram: your system as one box, users and external systems around it, labeled arrows. The system context diagram guide covers what belongs on it.
2. Quality goals
Most architecture documents skip this section, and it's the one that explains the rest. "Availability over consistency" or "changeability over raw performance" tells a reader why the containers look the way they do. Keep it to three to five goals, rank them, and give each a scenario concrete enough to test: a number, a load, a failure.
3. Constraints
Constraints are the decisions someone else made: the platform team, legal, the company's language policy. Writing them down stops the "why didn't you just use X?" conversation, and tells a future reader which choices can be revisited and which can't.
4. Architecture: the C4 diagrams
This is the section most people think of as "the architecture". Use the C4 model because it gives each diagram one job:
- Container diagram (level 2), always. Every deployable unit and data store, each with its technology, each arrow with a protocol. If you only draw one diagram, draw this one. The container diagram guide has a worked example.
- Component diagrams (level 3), selectively. Only for containers a newcomer would struggle with.
- Key flows. Two or three scenarios as numbered steps. A static diagram shows that two containers talk; a flow shows in what order, and which steps the user waits for. The C4 dynamic diagram guide shows how to write one.
The container table with an Owner column is there on purpose. A container nobody owns is one nobody will update in this document either.
If you're new to C4, what the C4 model is explains the four levels. For examples of these diagrams applied to real, large systems, see our C4 model examples.
5. Key decisions (ADRs)
Don't write decisions inline. Keep each one as an architecture decision record in its own file (context, decision, alternatives considered, consequences) and keep only the index here. ADRs are written once and superseded rather than edited, so the document stays short and the history stays intact. The complete guide to architecture decision records covers the format and when a decision deserves one.
A good test for the index: a new engineer should be able to point at any surprising box in section 4 and find the ADR that explains it.
6. Crosscutting concerns
Some things don't live in any one container: authentication, logging, error handling, where personal data sits. One or two lines each is enough, with a link to the detail. This section is where an auditor spends most of their time, so make it easy for them.
7. Deployment and operations
Keep this short and link out. Environments and how they differ, where the system runs, and links to runbooks and dashboards. The detail belongs in your infrastructure code and your runbooks, which change more often than this document should.
8. Risks and technical debt
The honest section. Write down what's known to be fragile, with an owner and a plan, even if the plan is "accepted, revisit in Q3". A risk written down is a risk someone can prioritize. A risk that lives in one engineer's head leaves with them.
9. Glossary
Every system has words that mean something specific here: "order" vs "basket", "account" vs "tenant", "fulfilment". Define each once. New engineers read this section more than you'd expect.
How this relates to arc42
If this template looks familiar, it's because it's a lean cut of the same ideas as arc42, the free, open-source architecture documentation template created by Peter Hruschka and Gernot Starke. arc42 has twelve sections and itself advises you to document "only what your stakeholders need" (arc42 FAQ, B-1). The mapping:
| This template | arc42 section |
|---|---|
| 1. Context and scope | 1 Introduction and Goals (purpose), 3 Context and Scope |
| 2. Quality goals | 1 Introduction and Goals (quality goals), 10 Quality Requirements |
| 3. Constraints | 2 Constraints |
| 4. Architecture | 4 Solution Strategy (briefly), 5 Building Block View, 6 Runtime View |
| 5. Key decisions | 9 Architecture Decisions |
| 6. Crosscutting concerns | 8 Crosscutting Concepts |
| 7. Deployment and operations | 7 Deployment View |
| 8. Risks and technical debt | 11 Risks and Technical Debt |
| 9. Glossary | 12 Glossary |
Choose arc42 when you need its full structure: regulated environments, large systems with several architects, or an organization that already standardizes on it. Choose something this size when the alternative is no document at all. For a detailed comparison, including which C4 diagram goes in which arc42 section, see arc42 vs C4.
Keeping it from going stale
Every architecture document is accurate on the day it's merged. Whether it's accurate in six months depends on a few habits, most of which are about the diagrams, because sections 4 and 5 are where reality changes fastest.
Keep it in the repository. docs/architecture.md next to the code means a pull request that splits a service can update the container table in the same review. A wiki page can't be part of a code review.
Link diagrams, don't paste screenshots. A screenshot of the container diagram is stale the moment a container is renamed. A diagram rendered from a model (Structurizr DSL, a YAML model, or a tool that holds one) is only as stale as the model.
Put the review date to work. Add the document to whatever checklist runs when a container is added or removed: the pull request template, the architecture review, the quarterly planning. "Next review: on every change to sections 3 to 5" is a valid entry.
Write decisions forward. Never edit an accepted ADR. Supersede it. The index in section 5 then shows the history, which is the part people need most.
Check the structural parts automatically. Sections 1 and 4 describe things that exist in code: services, data stores, dependencies. Those can be compared against the repository. Sections 2, 6 and 8 can't, and need a person on a schedule. The architecture drift detection guide covers the methods for the first kind and what each one can and can't see.
This is the problem archyl is built for, for the diagram half of the document. Connect a repository and AI discovery proposes the C4 model (systems, containers, components and relationships) for you to review and approve rather than draw. ADRs, docs and flows link to the elements they describe. A drift score then checks whether the documented elements still exist in the code, deterministically and without AI in the path, so a stale section 4 shows up as a number rather than a surprise. It doesn't check your quality goals or your risk list; those still need the review date. For the practices that keep documentation current with or without a tool, see living architecture documentation.
FAQ
What should a software architecture document include?
At minimum: the system's context and scope (users and external systems), a container-level diagram with technologies, the key architecture decisions with their reasons, the known risks, and an owner with a review date. The template above adds quality goals, constraints, crosscutting concerns, deployment notes and a glossary, all short.
Is this template really free?
Yes. It's the markdown block above. Copy it and change it to fit your system. No signup, no download, no email.
Where should the architecture document live?
In the repository, as docs/architecture.md or ARCHITECTURE.md, next to the ADRs in docs/adr/. That way changes to the architecture and changes to the document go through the same pull request.
How long should an architecture document be?
As short as it can be while answering its readers' questions. For a system with around ten containers, a few pages is normal. If it grows much past that, move detail into linked documents (runbooks, ADRs, API references) and keep this one as the map.
What's the difference between this and a system design document?
A system design document is usually written for one project or feature, before it's built, and includes detailed design. An architecture document describes the whole system as it is now and changes with it. Teams often have one architecture document per system and many design documents over its lifetime, with the design docs' lasting decisions ending up as ADRs.
Should I use arc42 instead?
If you need its full structure or your organization already uses it, yes. This template maps to arc42's sections (see the table above), so you can start here and grow into arc42 later without rewriting anything.
Want the diagrams in section 4 to come from your code instead of from memory? Try archyl free on the Developer plan, no credit card. Keep reading: arc42 vs C4 | Architecture Decision Records: The Complete Guide | What is the C4 Model? | Living Architecture Documentation | Architecture Drift Detection.