
Most inventory tools want an account, a subscription and a week of setup before they’ll tell you how many HDMI cables are in the cupboard. My inventory-app is the opposite: one small Node.js server and one SQLite file. Run it, open the page, start typing.
- Edit in place. Click a cell, change it, press Enter — no edit form, no separate page.
- Search as you type, across every field.
- A real REST API underneath, so scripts and other tools can use the same data.
- No build step. Plain HTML, CSS and JavaScript in the browser, Express on the server.
It’s a good small project to learn from, too: a complete front end, back end and database you can read in one sitting.
Run it
You need Node.js 18 or newer.
git clone https://github.com/amirh3sam/inventory-app.git
cd inventory-app
npm install
npm start # or: npm run dev, for automatic restarts while you edit
Open http://localhost:3000. The database file, database.db, is created on the first run, so there’s nothing to set up.
What each item stores
| Field | What it holds |
|---|---|
name |
What the item is |
manufacturer |
Who made it |
model |
Model or part number |
quantity |
How many you have |
location |
Where it is — shelf, drawer, room |
description |
Anything else worth writing down |
The field that earns its keep is location. Six months from now you won’t remember where something went, and a consistent naming scheme such as Shelf B / Bin 3 turns the search box into a map of your storage.
The REST API
The page in the browser is just one client — everything it does is available over HTTP:
| Method | Path | What it does |
|---|---|---|
GET |
/api/items |
Every item |
POST |
/api/items |
Add an item |
PUT |
/api/items/:id |
Update an item |
DELETE |
/api/items/:id |
Remove an item |
# list everything
curl http://localhost:3000/api/items
# add an item
curl -X POST http://localhost:3000/api/items
-H "Content-Type: application/json"
-d '{"name": "HDMI Cable 2m", "manufacturer": "Generic", "model": "HDMI-2M",
"quantity": 12, "location": "Shelf B / Bin 3", "description": "High speed"}'
# change the quantity of item 1
curl -X PUT http://localhost:3000/api/items/1
-H "Content-Type: application/json" -d '{"quantity": 10}'
# delete item 1
curl -X DELETE http://localhost:3000/api/items/1
CORS is enabled, so a page served from somewhere else can call the API too. And because it’s a real API, it’s also a handy target for practising API tests — the same techniques as in my Postman local-server guide.
Deploying it: two lines to change first
The repo includes a render.yaml, so Render can pick up the build and start commands. But two things in server.js work fine locally and break a deploy, which is exactly why they’re easy to miss:
- The port is hard-coded. Line 56 is
app.listen(3000, ...). Hosting platforms tell the app which port to use through thePORTenvironment variable —render.yamlsets it to 10000 — so change the line to:app.listen(process.env.PORT || 3000, () => { - There’s no health-check route, but
render.yamlsetshealthCheckPath: /health. Add one beforeapp.listen:app.get("/health", (req, res) => res.json({ status: "ok" }));
Without the first fix the platform can’t reach the app at all; without the second it keeps restarting a container that’s actually working.
One more warning: SQLite writes to a file on the server’s disk. On platforms with a temporary filesystem — Render’s free tier included — that file is wiped on every redeploy and restart. Fine for trying it out; for data you care about, use a persistent disk or a hosted database. At home, the app runs happily on a Raspberry Pi or any always-on machine, like the ones in my home server guide.
Frequently asked questions
Where’s my data?
In database.db in the project folder. Copy that file to back everything up, or open it with DBeaver or any SQLite tool to look inside.
How do I start over?
Stop the server, delete database.db, and start it again — a fresh empty table is created on boot.
Can several people use it at once?
For a small team on one network, yes — it’s one shared server and file. There are no user accounts, though, so don’t put it on the open internet without something in front of it, such as a password-protected proxy.
Code and setup notes: inventory-app on GitHub.
