Skip to content

Case study 08 · Marketplace and revenue

Five kinds of user in one codebase, separated by route

Service vendors, fleet carriers, owner operators, company drivers and a call center each had their own dashboard, with permissions set by user type and role.

EngagementTechnical Lead · US marketplace for truck services · 2022–2026 · team of 12 · same engagementPublished

506 routes

the headline number

1 constraint

Five kinds of user did different work on the platform, but every payment, branding or security change had to reach all five.

The story in 5 steps

Stack

  • React
  • Redux
  • Node.js
  • Express
  • MySQL

01 · Context

The platform served five kinds of user who did different work on it.

One codebase served all five, and the company's own team used a separate internal CRM.

02 · Could not change

Building five separate applications looks cleaner, and for about six months it is faster.

With five applications, every shared change, such as a payment flow, a branding update or a security fix, has to be made five times.
A single application with role conditions scattered through the interface is the opposite mistake, and just as common.

03 · What I did

I separated the user types by route. Each type had its own set of routes under /dashboard/{user_type}/{page}, so the vendor's routes showed everything a vendor could do.

Permissions resolved as user type plus roleEvery user type had at least two roles, such as admin, owner and operator, and a permission depended on the combination.
The backend checked permissions tooSeparate routes in the client only organized the code, so the API checked every permission independently.
I split the API in twoPublic routes and admin routes were two separate sets instead of one set with checks inside.

04 · Result

Five user types and their roles served from one codebase

506 API routes in two separate sets
Permissions that could be audited by reading one set of routes

05 · Differently

The permission model existed in the routing and in the API, but it was never written down anywhere a person could read it as a whole.

Related services

The services that draw on this work.

Case study 08

Working on a similar problem? We reply within one business day.

The first call takes 30 minutes, and you’re under no obligation.

Tell us about your projectcontact@microtech.consulting