Blog / Engineering · 8 min read ·
Capstone system diagrams: ERD, DFD, use case, architecture
What each capstone diagram is for, the rules panelists check, and ready-to-edit Mermaid examples for enrolment, water billing and clinic queue systems.
Diagrams are where panelists check whether you understand your own system. A clean ERD, a balanced DFD and a use case diagram that matches your objectives tell them your design is deliberate.
This guide explains what each diagram is for, the rules teams break most often, and gives you Mermaid examples to edit for your own project.
Which diagram answers which question
Each diagram answers a different question. Using the wrong one, such as drawing a flowchart where the panel expects a DFD, is a common source of revision notes.
| Diagram | Question it answers | Shows | Does not show |
|---|---|---|---|
| Entity relationship diagram (ERD) | What data do we store and how is it related? | Entities, attributes, keys, cardinality | Processes or screen order |
| Data flow diagram (DFD) | How does data move through the system? | External entities, processes, data stores, data flows | Decisions, loops or timing |
| Use case diagram | Who uses the system and for what? | Actors, use cases, system boundary | How each use case works inside |
| Flowchart | What are the steps and decisions in one process? | Sequence, decisions, start and end | Data structure |
| System architecture | What are the parts and how are they deployed? | Clients, servers, database, external services | Business rules |
Free tools for drawing diagrams
- draw.io (diagrams.net) for general diagrams, with shape libraries for ERD, DFD and UML.
- Mermaid for diagrams written as text, which you can keep in your repository and update alongside the code. Many documentation tools and Markdown viewers can render it.
- dbdiagram.io for database diagrams written as table definitions.
- Figma free plan if your team already uses it for wireframes.
Features and free-plan limits change, so confirm what each tool currently offers. Whatever you choose, use one notation consistently across the manuscript and follow your school's prescribed notation if it has one.
Entity relationship diagram (ERD)
The ERD is the blueprint of your database. Each entity becomes a table, each attribute a column, and each relationship is enforced by a foreign key. The example below is a simplified school enrolment system. Notice that STUDENT and SECTION have a many-to-many relationship, resolved by the ENROLMENT junction entity.
erDiagram
STUDENT ||--o{ ENROLMENT : makes
SECTION ||--o{ ENROLMENT : receives
COURSE ||--o{ SECTION : "is offered as"
TERM ||--o{ SECTION : schedules
STUDENT {
int student_id PK
string student_no UK
string last_name
string first_name
date birth_date
}
ENROLMENT {
int enrolment_id PK
int student_id FK
int section_id FK
date enrolled_on
string status
}
SECTION {
int section_id PK
int course_id FK
int term_id FK
string schedule
int capacity
}
COURSE {
int course_id PK
string code UK
string title
int units
}
TERM {
int term_id PK
string school_year
string semester
}In Mermaid's notation, ||--o{ reads as "exactly one to zero or more". One student makes zero or more enrolments; each enrolment belongs to exactly one student.
- Every entity needs a primary key. Prefer a surrogate key such as
student_idand keep natural identifiers such as the student number as unique columns. - Resolve many-to-many relationships with a junction table that holds both foreign keys.
- Do not store values you can compute, such as a student's total units, unless you have a stated reason.
- Normalise to at least third normal form, and be ready to explain any deliberate exception.
- Name entities in the singular and use one naming style for all columns.
Data flow diagram: context and level 0
A DFD shows how data enters, moves through and leaves the system. Start with the context diagram (some textbooks call it level 0 and number the next diagram level 1; follow your school's convention), which shows the whole system as one process surrounded by external entities. Then decompose it into the level 0 diagram, which breaks that single process into major sub-processes and data stores. The examples use a municipal water district billing system.
flowchart LR
MR[Meter reader] -->|meter reading| P0(("0 Water Billing System"))
BA[Billing administrator] -->|rate changes| P0
C[Concessionaire] -->|payment| P0
P0 -->|billing statement| C
P0 -->|official receipt| C
P0 -->|collection report| GM[General manager]flowchart LR
MR[Meter reader] -->|meter reading| P1(("1.0 Record readings"))
P1 -->|reading| D1[("D1 Meter readings")]
BA[Billing administrator] -->|rate changes| P5(("5.0 Maintain rates"))
P5 -->|rate schedule| D2[("D2 Rates")]
D1 -->|current and previous reading| P2(("2.0 Compute bill"))
D2 -->|rate schedule| P2
P2 -->|bill| D3[("D3 Bills")]
P2 -->|billing statement| C[Concessionaire]
C -->|payment| P3(("3.0 Accept payment"))
D3 -->|unpaid bill| P3
P3 -->|official receipt| C
P3 -->|payment record| D4[("D4 Payments")]
D4 -->|collection data| P4(("4.0 Generate reports"))
P4 -->|collection report| GM[General manager]Check the example: the context diagram's six flows, from meter reading to collection report, all appear in the level 0 diagram, and every data store connects only to processes.
Use case diagram
A use case diagram shows actors (roles, not individual people) and the goals they achieve with the system, inside a system boundary. Each use case should start with a verb and map to one of your specific objectives. Formal UML uses stick figures and ovals; if your Mermaid version has no dedicated use case diagram type, a flowchart with a subgraph approximates one well enough for drafts. Use draw.io for the final UML version if your school requires strict notation.
flowchart LR
Patient["Actor: Patient"]
Staff["Actor: Intake staff"]
Doctor["Actor: Doctor"]
subgraph sys["Clinic Queue System"]
UC1(["Get queue number"])
UC2(["View queue status"])
UC3(["Register patient"])
UC4(["Call next patient"])
UC5(["Record consultation"])
UC6(["Search patient record"])
end
Patient --- UC1
Patient --- UC2
Staff --- UC3
Staff --- UC1
Doctor --- UC4
Doctor --- UC5
UC3 -.->|include| UC6
UC5 -.->|include| UC6Use include when one use case always performs another, as registering a patient always searches for an existing record first to avoid duplicates. Use extend for optional behaviour, such as sending an SMS reminder only when the patient opted in.
Flowchart
A flowchart shows the step-by-step logic of a single process, including decisions. Draw flowcharts for processes with real branching, such as how a patient is routed into the queue, rather than for every screen.
flowchart TD
A([Start]) --> B[Patient arrives at clinic]
B --> C{Existing record?}
C -- Yes --> D[Search record by name and birth date]
C -- No --> E[Register new patient]
D --> F{Priority patient?}
E --> F
F -- Yes --> G[Add to priority lane]
F -- No --> H[Add to regular lane]
G --> I[Print or send queue number]
H --> I
I --> J([End])Define what counts as a priority patient, such as senior citizens, persons with disabilities and pregnant patients, in your business rules, and check that the decision in the flowchart matches the rule in your code.
System architecture diagram
The architecture diagram shows the deployable parts of your system and how they communicate. Panelists use it to ask about hosting, security and what happens when the network fails, so label each part with its actual technology.
flowchart LR
subgraph clients["Clients"]
W[Web browser - barangay staff]
M[Android app - residents]
end
subgraph server["Application server"]
API[REST API - Laravel]
Q[Background queue worker]
end
DB[(MySQL database)]
SMS[SMS gateway provider]
W -->|HTTPS| API
M -->|HTTPS| API
API --> DB
API --> Q
Q -->|request status updates| SMSA workflow that keeps diagrams consistent
- 01
Start from objectives
Draw the use case diagram first, so every use case traces to a specific objective.
- 02
Model the data
Build the ERD from the nouns in your use cases and requirements.
- 03
Trace the flows
Draw the context diagram, then the level 0 DFD, using data stores that match your ERD entities.
- 04
Detail complex logic
Add flowcharts only for processes with meaningful decisions.
- 05
Show deployment
Draw the architecture once your stack is decided.
- 06
Cross-check
Confirm names match across diagrams, the database and the manuscript before each consultation.
Next step
Draw your context diagram and level 0 DFD before your next adviser meeting, then check that every data store matches an entity in your ERD. When the diagrams agree, turn them into screens with the wireframing guide.