I wrote something very similar to this a couple years ago for our household. It runs on a raspberry pi and uses a barcode scanner and when we go shopping we scan everything in and then scan things out as we use them. We live far away from town and shopping trips are rare, big all day events. It's easy to forget to scan things out and then things that don't have barcodes like vegetables are hard to track so we don't bother. Manually entering it all in and then remembering to remove it while cooking is too much trouble (we tried).