RESTful endpoints for every car operation
Listing, reading, creating, updating and removing vehicles through predictable resource URLs.
A case study in designing the backend for a car management system: RESTful vehicle endpoints, JWT authentication and authorization, Mongoose data models, central error handling and a Postman test collection.

Elentra Car API is a Node.js car management REST API I architected and built as the backend for car management systems, on Express, MongoDB and Mongoose.
It handles vehicle data operations, user management and third-party integrations through RESTful Express endpoints, with JWT for authentication and authorization and Postman for testing. It was designed to support high-traffic applications.
The screenshot shows the Elentra front end; this case study is about the API side. A client sees predictable resource URLs for cars and users, a token check before anything protected runs, and errors that come back as consistent JSON whatever went wrong.
A car management system asks more of its data than a typical CRUD app, because the same vehicles are read in different shapes by different screens.
Each vehicle record holds many fields: a list needs a summary, a detail page needs everything, an admin view needs to edit it. Reads far outnumber writes, so the backend has to answer common queries quickly without sending more than each screen needs.
On top of the vehicle data, the API manages user accounts, decides which users may do what, and exchanges data with outside services through third-party integrations. It was also meant to support high-traffic applications, which ruled out designs that only hold up under light load, such as keeping session state in one server's memory.
| Before Elentra Car API | With Elentra Car API |
|---|---|
| Every screen fetching the full vehicle record | Lean list responses, with the full document from the detail route |
| Session state held in one server's memory | A signed JWT that any instance can verify |
| Validation repeated, or missed, in each handler | Validation declared once in the Mongoose schemas |
| Errors in a different shape from every route | One error handler and consistent JSON |
The brief I set myself
I architected and developed the Elentra backend, from the route structure and the Mongoose models for vehicles and users to the Postman collection used to test it.
Between those two ends sat the authentication and authorization layer, the error handling and logging middleware, and the third-party integrations. Because the API has no screen of its own, the Postman collection was also how I checked each route as it was built.
| Routes | Resource-based Express routers and controllers for cars and users, with deliberate status codes. |
|---|---|
| Data | Mongoose schemas for vehicles and users, with validation and indexes on the fields used to filter and sort. |
| Auth | A JWT authentication middleware, and a second middleware for what each user may do. |
| Reliability | One Express error handler, logging middleware, and wrapped calls to third-party services. |
| Testing | A Postman collection with a request for each endpoint, including the failure cases. |
Every protected request takes the same path: its token is checked, its permissions are checked, the data goes through a Mongoose model, and a consistent response comes back.
Step 1
The first middleware verifies the signed JWT on a protected route. Any instance can do this on its own, with no shared session store to consult.
Step 2
A second middleware checks what that user is allowed to do. Only then does the request reach the router and controller for its resource.
Step 3
The controller works through the Mongoose model. Writes are validated against the schema, and list reads return only the fields a list view needs.
Step 4
A success comes back as JSON with a deliberate status code. A failure goes to the single error handler, which returns consistent JSON and logs the detail on the server.
The features are the things a client developer depends on: predictable endpoints for cars and users, authentication handled once, and errors that always look the same.
Listing, reading, creating, updating and removing vehicles through predictable resource URLs.
Protected routes are checked by middleware before any controller runs.
User accounts are a resource of their own, with permissions decided in middleware.
Vehicle information defined as Mongoose schemas with validation and indexes.
Errors come back in one consistent format, and the server records what went wrong.
Connections to outside services, wrapped so a failing service returns a clear error instead of crashing the process.
A request for each endpoint, used to test the API as it was built and as a reference for client developers.
Stateless authentication and indexed reads, the two choices that design rests on.
Four decisions shaped the API: resource-based routes, models built around how cars are read, stateless authentication, and one place for every error.
API
Cars and users are modelled as resources with predictable URLs and standard HTTP methods. Each resource has its own Express router and controller, which keeps route files short and lets a client developer guess an endpoint without opening the code. Status codes are chosen deliberately, so a client can tell a missing car from a validation failure or a permission problem.
Data
Since most traffic is reads, the vehicle schema is shaped for the queries clients make most often, with indexes on the fields used to filter and sort listings. List endpoints return only the fields a list view needs, and the full document comes from the detail route. Schema and index design did the same job at a larger scale in the Cyborg Gaming Node.js backend, where it cut query times.
Security
For an API expected to take heavy traffic, server-side sessions would force every instance to share a session store. A signed JWT lets any instance verify a request on its own. One middleware checks the token, a second checks what that user is allowed to do, and both run before the controller, so permission logic stays out of the individual handlers.
Reliability
Controllers pass failures on to a single Express error handler instead of each writing its own response. That handler turns validation errors, missing records and unexpected exceptions into consistent JSON with the correct status code, and logs the detail on the server, so clients never receive a stack trace while I still have one to debug from.
| Technology | What it does in Elentra Car API |
|---|---|
| Node.js | The runtime for the API. |
| Express.js | Resource routers, controllers, and the auth, logging and error middleware. |
| MongoDB | Storage for vehicle and user data, indexed for the common list queries. |
| JWT | Stateless authentication that any instance can verify. |
| Mongoose | Schemas with validation and indexes for vehicles and users. |
| Postman | A collection with a request for every endpoint, failure cases included. |
Three parts needed the most care: keeping vehicle data valid from every entry point, outside services that fail, and testing an API with no screen of its own.
Problem
Cars can be written from more than one place, including the third-party integrations. If validation lives only in a route handler, every new entry point is another chance for incomplete or mistyped records to reach the database.
Solution
Validation sits in the Mongoose schemas, where required fields, types and allowed values are declared once. Anything that writes a car goes through the same model, so the collection only holds records the clients can depend on.
Problem
An integration is code that depends on someone else's uptime. A slow or failing outside service should not take a car request down with it, or leave a client waiting until it times out.
Solution
Calls to outside services are wrapped so their failures are caught, logged through the same middleware and returned as a clear error response instead of crashing the process. The rest of the API keeps answering while an integration is unavailable.
Problem
A backend's bugs should not wait for a front end to discover them. Testing by hand with one-off requests is easy to skip and impossible to repeat exactly after a change.
Solution
I kept a Postman collection with a request for each endpoint, including the failure cases: missing or expired tokens, invalid ids and malformed vehicle data. Running the collection again after a change showed quickly whether anything had broken, and it gave client developers a working reference for every route.
The result is a Node.js car management REST API a front end can build on, with predictable routes, authentication handled once and errors in one shape.
Routes for vehicles and users follow one pattern, authentication runs once in middleware before any controller, and errors come back in the same shape every time. It was designed for high-traffic applications, and stateless authentication and indexed reads are the two choices that design rests on.
The token-based approach is the same one behind the team management system with three-tier access control, applied here to an API that serves other applications rather than its own interface.
Next I would add rate limiting and response caching for the busiest read endpoints, and publish OpenAPI documentation generated from the routes so client developers are not relying on the Postman collection alone.
Short answers to the questions developers ask most about the Elentra Car API, its authentication and how it was tested.
Elentra Car API is a Node.js REST API built as the backend for car management systems. It handles vehicle data operations, user management and third-party integrations through RESTful Express endpoints.
Node.js and Express.js for the API, MongoDB with Mongoose for vehicle and user data, JWT for authentication and authorization, and Postman for testing.
With a signed JWT. One middleware verifies the token, a second checks what that user is allowed to do, and both run before any controller, so permission logic stays out of the individual handlers.
The API was designed for high-traffic applications. Server-side sessions would force every instance to share a session store, while a signed JWT lets any instance verify a request on its own.
With a Postman collection holding a request for each endpoint, including missing or expired tokens, invalid ids and malformed vehicle data. Running it again after a change showed quickly whether anything had broken.
Calls to outside services are wrapped, so a failure is caught, logged and returned as a clear error response. The rest of the API keeps answering while the integration is unavailable.
Muhammad Abdullah Awais, a full-stack developer based in Pakistan. I architected and developed the backend, and I am available for freelance and full-time backend work like it.
The Node.js, MongoDB and Socket.IO backend behind a gaming community platform, with 99.8% uptime through launch.
Read the case studyA MERN team management system with Admin, Manager and Team Member roles, a Kanban board and per-role analytics.
Read the case studyA TypeScript MERN finance tracker with categorised transactions, live charts, custom reports and an admin panel.
Read the case studyI work remotely with teams in the US, Canada, the UK, Europe and the Gulf, and with clients across Pakistan. Based in Pakistan (PKT, UTC+5), available for freelance and full-time roles.