Requirements & Architecture Planning
Overview
Every successful project starts with a solid plan. This tutorial covers the critical first phase of your capstone project: gathering requirements, defining user stories, writing functional specifications, and creating architecture diagrams using the C4 model. You will also learn about Architectural Decision Records (ADRs) to document your design choices.
1. Gathering Requirements
Requirements define what the system should do. They come from stakeholders, users, and business objectives.
Types of requirements
- Functional: What the system does (e.g., "Users can create an account.").
- Non‑functional: How the system performs (e.g., "Page load time < 2 seconds.").
- Business: Strategic goals (e.g., "Support 10,000 concurrent users.").
2. User Stories & Use Cases
User stories describe features from the user's perspective. They follow the format: "As a [role], I want [action] so that [benefit]."
Use cases go deeper, describing the step‑by‑step flow of a user interaction.
3. Functional Specifications
A functional specification (or spec) translates user stories into detailed technical requirements. It includes:
- Endpoints: API routes, methods, and request/response formats.
- Data models: Entities and their relationships.
- Business logic: Validation, calculations, and workflows.
- User flows: Step‑by‑step interaction sequences.
4. C4 Architecture Model
The C4 model provides a structured way to visualise architecture at four levels, each with a different audience:
- Level 1: System Context – The system and its users (for executives).
- Level 2: Containers – High‑level services (frontend, backend, database).
- Level 3: Components – Internal building blocks of each container.
- Level 4: Code – Classes and functions (for developers).
5. Architectural Decision Records (ADR)
ADRs document important design decisions. They help future developers understand why certain choices were made.
Quiz
Question 1
What does the "C" in the C4 model stand for?
- Code
- Container
- Component
- All of the above (Context, Container, Component, Code)
Show answer
Question 2
Which requirement type defines how the system performs (e.g., response time)?
- Functional
- Non‑functional
- Business
- Technical
Show answer
Question 3
What is the purpose of an Architectural Decision Record (ADR)?
- To track bugs
- To document design decisions and their rationale
- To store user passwords
- To generate code
Show answer
Exercises
Exercise 1
Write 3 user stories for a food delivery app (customer side). Use the "As a... I want... so that..." format.
Sample answer
- As a hungry customer, I want to browse restaurants by cuisine so that I can find food I'm craving.
- As a hungry customer, I want to track my order in real‑time so that I can know when to expect my food.
- As a repeat customer, I want to reorder my favourite meal so that I can save time.
Exercise 2
Write a simple C4 Level 2 (Containers) diagram for a blog platform with users, posts, comments, and a database.
Sample answer
Homework
Homework 1
For your capstone project idea, write a complete set of functional requirements (at least 10) and create a Level 2 (Containers) C4 diagram.
Sample outline
- Requirements: List 10+ functional requirements for your project.
- Containers: Identify the main containers (e.g., React app, Node.js API, PostgreSQL DB).
- Diagram: Draw connections between containers with arrows showing data flow.
- Justification: Explain why you chose each container technology.
Mini‑Project
Architecture Planning for Your Capstone
Create a comprehensive architecture plan for your capstone project:
- Write 5–10 user stories
- Define functional and non‑functional requirements
- Create C4 Level 1 (System Context) and Level 2 (Containers) diagrams
- Write at least 3 ADRs for key decisions (e.g., framework choice, database choice)
Sample outline
- Project name: Your capstone project name
- User stories: 5–10 stories covering core features
- Requirements: List of functional and non‑functional requirements
- C4 diagrams: Use draw.io or similar to create diagrams
- ADRs: Document at least 3 decisions with context, decision, and rationale
Tutorial Summary
You learned the essential planning phase of the capstone project: gathering requirements, writing user stories, defining functional specifications, creating C4 architecture diagrams, and documenting decisions with ADRs. This foundation will guide the entire implementation.
Key takeaway: Good architecture is planned, not emergent. Invest time in planning and documentation to ensure a smooth development process and a successful capstone project.