Loading
October 26, 2026

AmirHesamTech

Raspberry Pi, homelab, Linux and automation — projects and practical guides

Inventory app built with Node.js, Express and SQLite

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.

Advertisement
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:

  1. The port is hard-coded. Line 56 is app.listen(3000, ...). Hosting platforms tell the app which port to use through the PORT environment variable — render.yaml sets it to 10000 — so change the line to:
    app.listen(process.env.PORT || 3000, () => {
  2. There’s no health-check route, but render.yaml sets healthCheckPath: /health. Add one before app.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.

Advertisement

65 Posts

SDET and QA engineer. I build Raspberry Pi servers, a Proxmox homelab and automations, and share how on TikTok and Instagram (@techwithamirh3sam).

View All Posts

You Missed

REWARDS 🔰 LV1 0🪙 ❯
🔰
Recruit
Guest Operative
Level1
XP0 / 100
💬 Need help?
coins0
Streak0 days · best 0
📋 Daily missions
↻ Resets daily at midnight
Rank ladder
How to earn
✓ Welcome bonus for joining — +200 🪙 & +100 XP (one-time)
✓ Daily check-in (streak bonus) — +20 XP & +12–24 🪙 (more 🪙 the longer your streak)
✓ Spin the daily wheel — +10 to +150 🪙 (free, once a day)
✓ Daily missions — check-in +15 🪙/+10 XP · daily spin +15 🪙/+10 XP
✓ Finish ALL daily missions — +30 🪙 & +20 XP bonus
✓ Level up — +25 🪙 every new level
✓ Achievements — first sign-in +50 🪙 · Lv5 +75 · Lv10 +150 · Lv25 +300 · 7-day streak +100 · 30-day +250 · collector +100 · subscriber +50
✓ Complete your profile (name, bio, photo) — up to +55 XP (one-time)
✓ Subscribe to the newsletter — +250 🪙 (one-time)
Coins and XP are just for fun: they have no cash value and can't be exchanged for money or prizes. You never earn them for viewing or clicking ads, or for how many pages or articles you open.
🛒 Token Shop0 🪙
🛍️ Shop0items
🎒 Inventory0items

🎡 Daily Spin

One free spin every day — pure bonus coins!
🪙
💬Need help?