Nweremizu BrunoFull-stack engineer
← Index

SaaS Platform · 2025–26

Trackar workspace access control

Trackar controls who may enter a workspace, records every entry and exit, and gives operators a live picture of who is on site, for standalone offices, shared-building operators, and the tenant companies inside them, all from one deployment. I built it for a Lagos-based client as one of two engineers: sole author of the front end and primary author of the backend.

Trackar screenshot
  • Django
  • Django REST Framework
  • PostgreSQL
  • React
  • TypeScript
  • TanStack Query
  • Tailwind CSS
  • Render

Problem

Most buildings still run their front desk on a paper logbook: no way to know who is inside right now, no approval step before a visitor turns up, and no audit trail when something goes wrong. Shared buildings make it harder: the operator needs to see everyone, but each company renting space must never see its neighbours.

Challenge

Tenancy has three shapes, not one. A Workspace Hub operates a building and sees its own activity plus every tenant's; a Tenant Company inside that hub is fully isolated and can never see the hub or a sibling; a Standalone Organization is neither. Rather than filter by organization in each view (where one forgotten filter leaks one customer's people and movements to another), isolation is enforced in the data layer, by an organization-scoped model manager applied at query time across all 13 models. A hub reads across its tenants only by deliberately widening that scope, which is why hub and tenant admins see different data on the same screens.

Architecture

A Django and Django REST Framework API on PostgreSQL: 97 endpoints across 8 feature modules, refactored from a single monolithic app into feature slices over shared core, business, and infrastructure layers, with business rules in service functions instead of HTTP views. A separate scheduler worker auto-checks-out stale visits, isolated as its own service so scheduled work never competes with API traffic. The React 19 and TypeScript front end (177 components and 35 routes, split into 72 lazy-loaded chunks) covers role-aware dashboards, an entry kiosk with live camera QR scanning, a drag-and-drop ID-card designer with PNG export, and occupancy analytics. It runs on Render (API, worker, Postgres) and Vercel, with Sentry, PostHog, Cloudinary, and Resend around it, and 775 automated tests across both halves.

Decisions

  • Members and visitors are two separate identities with their own credentials and login endpoints, not one table with a role column: staff sign in with a four-digit PIN scoped to their organization, while visitors self-register with email and password and belong to no organization.
  • A ranked five-tier role system (Super Admin → Admin → Manager → Staff → Badge Holder) with weight-based checks, so no one can grant a role at or above their own.
  • Rate limits on credential endpoints live in a shared database cache, so a four-digit PIN's 10,000 combinations stay throttled at the real limit across all four Gunicorn workers instead of quietly multiplying by four.
  • The visitor lifecycle is an explicit state machine: request, host approval, single-use QR token, staffed check-in and check-out, then an immutable access log.
  • Attendance is modelled separately from access logs: recurring schedules with a stable public link, used to integrate church attendance capture from ChurchTeck without bending the access model to fit.

What went wrong

Putting isolation in the data layer only protects the queries that go through it. A pre-launch audit I ran still turned up a few cross-organization access gaps in code paths that sat outside that layer, plus a race condition in check-in. Each was a small, targeted fix and now has a regression test, but they had made it into code that looked correct and had passed review.

Lessons

Security boundaries have to live somewhere no one can forget them, and then you still have to go looking for the places that route around them. The audit taught me to treat "most queries are scoped" as a finding, not a reassurance: the one unscoped path is the whole story.