I started with an activity tracker on the dashboard.
The goal was to make the app show what has changed recently instead of just displaying inventory. I created an activity table in Supabase to store actions like adding items, changing quantities, restocking, and deleting items.
This time I created the database policies first so I didn’t run into the same RLS problems from earlier. After that I made activity.js to handle adding activity logs and connected it to the other features.
Then I created notifications.js.
Notifications check the inventory and show things like low stock items and products that are expiring soon. I added an ID to the notification button in the header and created a notification panel that works similarly to the side menu by sliding out.
I created notifications.css and tested it. At first it didn’t work because I forgot to add id="notification-list" to the HTML, so JavaScript had nowhere to display the notifications.
Edit/Delete
I wanted users to manage their inventory properly, so I added editing and deleting.
I created edit-item.html, which is similar to the add item page but loads existing data and updates it instead. I made inventory cards clickable so selecting an item opens the edit page, while keeping the +/- buttons working normally.
I also added delete functionality which removes the item and cleans it from the shopping list. Activity tracking was added so these changes appear on the dashboard.
Barcode History
Next I added barcode history.
I created a new barcode_history table to save scanned products. I updated addItem.js so it checks if a barcode already exists before searching OpenFoodFacts. This means repeated products can be added faster.
I can’t fully test this until the app is live because camera permissions work differently on mobile.
Receipt Scanner
I added receipt scanning using Camera OCR and Tesseract.
I added a scan button to the add item page and used OCR to read the receipt image. The text is cleaned by removing prices, store information, and other receipt details.
I created a product dictionary so common products can be recognised even if OCR makes small mistakes.
It works, but it is not perfect because every receipt layout is different and OCR can struggle with blurry images.
Household Mode
This changes Stocked from a personal app into something anyone can use.
I wanted my own private version while also making a demo for Hack Club, so I added household support.
I renamed index.html to dashboard.html and created a new login page with:
- Login
- Create account
- Try demo
I created setup.html where users can create a household or join an existing one. Each household has its own data so users don’t affect each other.
Settings
I created a settings page where users can manage their household and copy their household code to invite others.
Recipes
I added a recipe section that connects with inventory.
Recipes can check which ingredients are available, what is missing, and what needs to be added to the shopping list.
Analytics
I added consumption analytics to track how items are used.
The system records stock changes and can show things like most used items, weekly usage, and consumption patterns.
PWA
The final major feature was turning Stocked into a Progressive Web App.
I added:
manifest.json
- Service worker
- App icons
- Offline caching
This allows Stocked to be installed like a normal app on phones and computers.