· 2 min read
Designing for traceability: principles behind MedSpora
Why medicine distribution software should treat every stock movement as an auditable event, and how role-based access and a single operational view fit together.
- Product building
- System design
- Healthcare
MedSpora is a platform I'm building to streamline medicine distribution, inventory and audit workflows across the stakeholders involved in getting medicines from one place to another. This post is about the design principles behind it rather than implementation details — the ideas I keep coming back to when deciding how the system should behave.
The problem: many hands, scattered records
Medicine moves between many parties. Each hand-off is a moment where records can drift: a spreadsheet isn't updated, a message gets lost, a stock count is entered twice. When something needs to be checked later, the history has to be reconstructed from fragments.
The goal is a system where that history never needs to be reconstructed, because it was recorded correctly the first time.
Principle 1: movements are events, not edits
The most important design choice in traceability software is how you represent change.
If a stock level is just a number that gets overwritten, you know what the stock is today but not how it got there. If every receipt, transfer, adjustment and dispatch is stored as its own event — who did it, when, what moved, from where to where — then the current stock level is something you can always derive and, crucially, explain.
This is the same idea behind accounting ledgers and event sourcing: the log is the source of truth, and balances are a view of it.
Principle 2: audit is a feature, not a report
Audit workflows are often bolted on at the end as an export. When the underlying data is an append-only history of events, audit becomes a first-class workflow instead:
- Reviewers can trace any item's path through the distribution chain.
- Discrepancies show up as a difference between expected and recorded events.
- Corrections are new events that reference what they correct, rather than silent edits.
Principle 3: role-based access matches real responsibilities
Different stakeholders need different things. Someone managing inventory at one location shouldn't be able to change records at another; an auditor needs to see everything but change nothing.
Role-based access control maps permissions to roles that mirror real responsibilities. It keeps data safe, but it also makes the audit trail meaningful — every event is tied to an identity that was allowed to perform it.
Principle 4: one operational view
Coordination problems are often visibility problems. When every stakeholder looks at a different spreadsheet, they argue about which one is right. Centralized operational management means one shared, consistent view of inventory and distribution, with each role seeing the slice that's relevant to them.
What MedSpora is not
It's worth being explicit: MedSpora is about operational workflows — inventory, distribution, traceability and audit. It's not a medicine information site, and it's a different project from MediSage, an earlier AI experiment that explains medicines in multiple languages.
Where it's going
MedSpora is in active development. I'll share more about the stack and architecture here once they're settled.