In production
Itevo — ERP for technical training institutes
Multi-branch ERP in production for technical institutes. I was responsible for the roles and permissions system.
- Year
- 2025 — 2026
- Role
- Authorization and permissions
- Stack
- Next.js · React · TypeScript · Prisma · MariaDB · NextAuth

Context
Dominican technical institutes run their entire operation here: enrollment, installment payments, tax invoicing, cash closing and verifiable diplomas. It's 81,000 lines built by a team of five over 23 months. I contributed to attendance, schedules, cash registers and reports, but the subsystem I owned end to end is roles and permissions.
The problem
Cashiers, coordinators, branch managers and owners. The same person can be a cashier at one branch and a coordinator at another. And exceptions are the norm: one particular person needs a report, or needs the void-invoice option taken away. With fixed roles that ends in dozens of nearly identical roles nobody can audit anymore.
The solution
The role sets the baseline and per-user exceptions adjust it in both directions, always scoped to a single branch. I separated authentication from authorization: the middleware only checks that a session exists, and each route, page and button resolves its own permission. Roles are managed from a visual matrix, not by touching the database.
Technical decisions
- The token carries the active branch, never the permissions. If it carried them, revoking one from a cashier wouldn't take effect for another twelve hours.
- I split MENU from READ: whether a module appears in the menu is one question, whether you can read its data is another. That way a coordinator can populate a user picker without that module opening up to them.
- Exceptions subtract as well as add, so there's no need to invent a new role for every special case.
- Voiding an issued invoice asks for a supervisor's credentials and validates their role, not the permission: who performs an action and who authorizes it are different questions.
Results
- 33 modules with permissions configurable from the interface: creating a role stopped requiring a deployment.
- I fixed a cache that served stale permissions after a role change: better an indexed query than a stale authorization.
- 26 releases shipped, running across several branches.
Project screenshots
Click any image to enlarge it.