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.