Every screen needed to know who's viewing AND what they can do. Hardcoding role checks per component would scale terribly across hundreds of forms.
SBM
Smart Building Management — multi-tier admin panel with role-based access for residents, service providers, and super-admins. Handles requests, maintenance, security, and finance.
- year
- 2024
- role
- Frontend Developer
- duration
- 5 months
- live
- —
> stack react · typescript · mui · react query
A three-role admin platform for residential and commercial building operators. One codebase serves residents (requests, bills), service providers (job queue, work logs), and super-admins (configuration, finance, audit). TypeScript everywhere, MUI for the dense forms, React Query for the cache.
- 01Three role dashboards from one component tree
- 02Service request lifecycle: open → assigned → in-progress → closed
- 03Maintenance scheduling and recurring task templates
- 04Security log with timestamped events and incident reports
- 05Finance: rent collection, expense tracking, balance sheets
- 06Audit trail across all role actions
Optimistic updates feel great but the audit log must reflect actual server state. Couldn't ship 'looks done' if it wasn't actually done.
Some screens have 30+ fields with conditional sections. Keeping them performant and the bundle small required careful component split.
Roles × resources × actions = one declarative table. Components ask `can(role, resource, action)` instead of nesting role-conditionals. New role = one table row.
Optimistic mutate on submit, server reconciles, automatic rollback on failure with an inline toast. Audit log only reflects post-server state — kept in a separate cache key.
Each form is a Zod schema. Validation, types, and field rendering all derived from one source. Conditional fields are schema-driven, not JSX-driven.
- c1f3a8bchore: scaffold + TS strict
- e4d2b97feat: permission matrix + role context
- a8c5e10feat: service request lifecycle
- 0b6d4f3feat: maintenance schedule + recurring
- 9f7e2a4feat: finance dashboards + audit trail
- reviewmilestone: client review
- ✓Three role dashboards from one codebase, no duplication
- ✓TypeScript end-to-end — caught the permission edge cases at compile time
- ✓Currently in client review