ShelfLife Household Inventory Tracker
Stack: MongoDB · Express · Node.js · React (MERN)
Build a collaborative expiry tracking application for shared households. Roommates manage groceries together, receive expiration alerts, and compete to reduce waste.
1. Authentication & User Management
6. Automated Notifications
Rule
Implementation
No AI services
Use date math and database queries only
No external APIs
Except open barcode database for product names
MongoDB only
All data persistence via Mongoose
React functional components
Hooks only, no class components
// User
{
_id : ObjectId ,
name : String , // required, 2-30 chars
email : String , // required, unique
password : String , // hashed, min 6 chars
householdId : ObjectId , // nullable
createdAt : Date
}
// Household
{
_id : ObjectId ,
name : String , // required, 3-30 chars
inviteCode : String , // unique, 6 chars uppercase
members : [ ObjectId ] , // user references
wasteScore : Number , // 0-100, default 0
createdAt : Date
}
// Item
{
_id : ObjectId ,
householdId : ObjectId , // required
addedBy : ObjectId , // user reference
name : String , // required
category : String , // enum: produce, dairy, meat, pantry, frozen, other
quantity : Number , // default 1
expiryDate : Date , // required
status : String , // enum: fresh, expiring-soon, expired, used, wasted
createdAt : Date ,
updatedAt : Date
}
Method
Endpoint
Body
Response
POST
/api/auth/register
{name, email, password}
{token, user}
POST
/api/auth/login
{email, password}
{token, user}
Method
Endpoint
Auth
Description
POST
/api/households
Yes
Create new household
POST
/api/households/join
Yes
{inviteCode} → join existing
GET
/api/households/me
Yes
Get current user's household
GET
/api/households/:id/members
Yes
List all members
Method
Endpoint
Query Params
Description
GET
/api/items
?status=&category=
List household items
POST
/api/items
—
Create new item
PUT
/api/items/:id
—
Update item details
PATCH
/api/items/:id/status
{status}
Mark used/wasted
DELETE
/api/items/:id
—
Remove item
Method
Endpoint
Description
GET
/api/dashboard/stats
Waste score, counts by status
GET
/api/dashboard/expiring
Items expiring in 24h
Path
Component
Access
/login
LoginForm
Public
/register
RegisterForm
Public
/dashboard
Dashboard
Private
/household
HouseholdManager
Private
/items
InventoryList
Private
/add
AddItemForm
Private