Skip to content
Back to all work

Inventory REST API

A compact inventory back end in TypeScript and Express, built the way production services should be: layered, validated and safe from SQL injection.

Type
API
Status
Open source
Built with
TypeScript, Node.js, Express, SQLite
Links
View the code

What it is

A REST API for managing products and stock, written in strict TypeScript on Express, with SQLite storage so it runs straight after cloning.

How it is built

  • Layered: routes, controllers, services and database each have one job, so the storage engine can be swapped by changing one layer.
  • Typed end to end: shared interfaces keep request bodies, service functions and database rows in agreement.
  • Validation as middleware: bad input is rejected before it reaches a controller.
  • One place for errors: a single handler turns typed errors into the right status code and JSON response.
  • Safe SQL: every query uses prepared statements with bound parameters.

Why it matters

Most of the AI and automation work I do for clients sits on top of an API like this one.

Tell me what is slowing you down

Describe your business, or your client's, and the problem you want solved. I'll reply within one working day with how I would approach it and a fixed price to start.