Building a Pantry Tracker, Part 1: The Plan
Why I'm building this
Hi! I'm building a pantry tracker, a small app that keeps track of the food at home and tells me what to eat first. It's also my excuse to get properly hands-on with Go, Vue and React Native. I learn best by building something I'll actually use, so that's the plan here.
The idea came straight from my own kitchen. Something gets pushed to the back of a shelf, I forget it's there, and a week later I find it well past its date. Or I come home from the shop with a second jar of something I already had. An app that answers "what do I have, and what should I eat soon?" would fix both.
This is the first post in a series where I share each step of the build as I go. Here I'll walk through the plan: what the app does, how I'm splitting up the work, and why I picked each tool. If you're learning any of these too, I hope it's useful to follow along.
What the app needs to do
The first version has to cover the basics, and nothing more:
- Sign up, log in and log out. Every pantry belongs to one person.
- Add, edit and delete items. Each item has a name, a quantity, an expiry date and a category.
- See all items in a list, with the ones expiring soonest at the top.
- On the phone, scan a barcode to fill in the product name instead of typing it.
That sorted list is the heart of the app. Storing items is easy; any notes app can do it. The value is in the order. When I open the app, the first thing I see should be the yogurt that expires tomorrow, not the rice that lasts a year.
Some features are useful but can wait:
- Expiry reminders. A daily check that sends a phone notification or email when something is about to expire. This turns the app from something I have to remember to open into something that reminds me.
- Shared households. Most kitchens are shared, so family or flatmates should see the same pantry.
- A shopping list and waste stats. Nice extras once the core works.
I'm keeping these out of the first version on purpose. A small app that works beats a big one that's half finished.
How the pieces fit together
Both apps use Supabase to log in. After logging in, they get a token, a kind of digital pass that proves who the user is.
The apps never talk to the database directly. Every request goes to my Go backend, along with that token. The backend checks the token, applies the rules ("you can only see your own items"), and is the only part that reads or writes data.
Keeping the rules in one place means the web app and the phone app always behave the same, and I only have to get each rule right once.
Why these tools
Supabase for the database and login. Supabase gives me a hosted database and a ready-made login system in one place. It runs in the cloud, so there's nothing to install, and the free plan is enough for a project like this. Writing my own login system would be a project of its own, and an easy place to make security mistakes.
Go for the backend. Go is often praised for speed, but honestly a pantry app will never need it. I picked Go because it's simple to read, it builds into a single file that's easy to deploy, and it's widely used for exactly what I'm building: web APIs and scheduled background jobs. And I want to learn it.
Vue for the web app. I want to get properly comfortable with Vue. I'm using plain Vue rather than a bigger framework like Nuxt. Nuxt adds its own layer of rules on top, and once the basics of Vue click, picking up Nuxt later is easy. Learning the base first feels like the right order.
React Native with Expo for the phone app. One codebase gives me both Android and iOS. Expo makes the setup painless and lets me preview screens quickly while I work. It also gives me a chance to compare React with Vue side by side, building the same screens in both.
How I'm organising the work
In a team, the backend and the apps are often built at the same time. That works when everyone agrees up front on how the parts will talk to each other. I'm working alone, so I'll build one part at a time, in this order:
- Requirements. What the app must do, written down (above).
- Database. Everything else depends on how the data is stored, so it comes first.
- API plan. Before writing backend code, I'll list every request the apps can make and what each one returns. This is the agreement between the backend and the apps, so there are no surprises later.
- Backend in Go. Login checks, saving and loading items, the barcode lookup.
- Web app in Vue. Login and the item list. This is my first real checkpoint: a working app I can use. Here I'll stop and decide whether the plan still makes sense.
- Phone app in React Native. The same features, plus barcode scanning.
- Reminders, then households. Built on top of what already works.
Why the backend before the screens? If I built the web app first, I'd need fake data to make it work, and all of that would be thrown away once the real backend exists. Building backend first means every screen I make talks to real data from day one.
Why the web app before the phone app? A web app works on a laptop and on a phone browser, so it covers almost everything on its own. The phone app is the extra that adds what a browser can't do well: the camera for scanning and, later, push notifications. That makes it the natural last step, not a must-have for a first usable version.
Barcode scanning: a nice extra that's easy to add
I went back and forth on whether barcode scanning belongs in the first version. Typing a product name works fine, so scanning is really a convenience. I kept it in because it turns out to be a small addition.
The phone reads the barcode itself, right in the camera view, and turns it into a number. It sends only that number to my backend. The backend looks it up in Open Food Facts, a free, community-built product database, and sends back the product name to fill in the form. It also saves the result, so scanning the same product again is instant.
The extra work is small: asking for camera permission, stopping after the first scan, and falling back to normal typing when a product isn't found. The barcode doesn't know when my package expires, so I still type the expiry date by hand.
What's next
Next up is the database: which tables I need, what each column holds, and a few decisions that look small but matter later, like how to store an expiry date so it doesn't shift with time zones. I'll write about what I chose, what confused me, and what I'd do differently.
For more, you can follow me on LinkedIn, GitHub, or Instagram.
Comments
No comments yet. Start the discussion.