How we took the Saudi Armed Forces off paper
An entire branch of the Saudi Armed Forces ran quality assurance on paper. Not partly on paper — entirely on paper. Thousands of distinct forms: inspections, audits, compliance checklists, training records, non-conformance reports, each with its own fields, approval logic, and chain of command. The conventional estimate for digitising all of that was two years.
We had ten weeks.
The form engine
The first decision was the most important one. We were not going to build thousands of forms. We were going to build one engine that could render any of them.
Each form type is defined as a Python object with its fields, field types, validation rules, and routing logic. The object is serialised and stored. When a user opens a form, the engine deserialises it and renders it dynamically.
def render_form(form_id: int) -> dict:
raw = db.query(FormDefinition).filter_by(id=form_id).first()
form = pickle.loads(raw.definition)
return form.to_dict()
A new form type is added by defining a new Python object. No new frontend code. No new database migrations. No new deployment. This is the decision that made the timeline possible.
The approval engine
Military approval chains are not linear. On a single form, different fields route to different approvers depending on rank, department, and the values entered. A field value of "non-conformant" might trigger a review chain that a "conformant" value bypasses entirely.
We modelled all of this as configuration, not code. The approval logic lives in the form definition. The engine reads it and constructs the correct routing at runtime. Adding a new approval rule means editing a configuration object, not writing a new code path.
Role-based access
The chain of command is enforced in software. Every action is gated by rank and role. Officers see what their role permits. Senior officers see across their commands. Nothing leaks outside the hierarchy.
This is not complicated in principle. It is time-consuming to get right in practice — the edge cases live in the intersections between rank, department, and form type, and in a military organisation there are many of them.
Audit trail
Every form, every field change, every signature, every approval, every state transition is logged with a timestamp and a verified identity. The log is immutable. It is structured for command oversight — not just readable, but defensible.
The result
The Quality Corps moved off paper in ten weeks. Every new form, every new approval cycle, every new objective category is now a configuration change, not a development cycle. The system is Arabic-first, RTL, and deployed on-premises. What was scoped as a two-year programme shipped as a ten-week deployment, and continues to expand without us.