All notes

Frontend & UI / dei-klien-inventory-manager

Rasoi

The Smart Kitchen Companion for Dei Klien A 10-day rationing brain, a pantry that keeps its own books, and a meal planner that actually knows what's in the fridge.

April 24, 20268 min readTypeScript
Open the full technical write-up

The Smart Kitchen Companion for Dei Klien

A 10-day rationing brain, a pantry that keeps its own books, and a meal planner that actually knows what's in the fridge.


Table of Contents


What is Rasoi?

Rasoi is a web app that helps a household run its kitchen on a 10-day ration cycle. It takes the guesswork out of grocery shopping, keeps a live inventory of what's in the pantry, and spins up a personalized meal plan that respects everyone's dietary preferences — then auto-deducts ingredients as meals are cooked.

Think of it as a household ops tool that combines:

  • Grocery planning (what to buy, how much, how often)
  • Inventory tracking (what's actually left in the kitchen, right now)
  • Meal recommendation (what to cook, given what we have + who's eating)
  • Dynamic replanning (because real life rarely sticks to the plan)

Built initially for the Dei Klien household, designed to scale to anyone who wants less friction between "we need groceries" and "dinner is ready."


Why it exists

Running a household kitchen is a quietly complex optimization problem:

  • Buy too much → food rots, money wasted.
  • Buy too little → emergency runs, stressed evenings.
  • Plan meals without knowing inventory → "we're out of onions again."
  • Plan meals without knowing preferences → someone's quietly pushing peas around the plate.

Rasoi closes the loop: plan → purchase → cook → decrement → replan — automatically.


Core workflows

1. Household Profiles

  • Multiple user profiles (up to 3 per household)
  • Dietary preferences: vegetarian, vegan, keto, diabetic, gluten-free, etc.
  • Allergies & cuisine preferences
  • Household-level config: size, consumption patterns

2. 10-Day Grocery Planning Engine

  • Generates a categorized grocery list: Grains · Vegetables · Fruits · Dairy · Proteins · Spices & Essentials
  • Quantity estimation based on a per-person-per-day consumption model
  • Adjustable recommendations
  • Exportable / shareable list (WhatsApp, print, CSV)

3. Inventory Management

  • Initial inventory seeded from the confirmed grocery purchase
  • Live quantity tracking (kg, L, units)
  • Expiry tracking with proactive alerts
  • Manual override: add, remove, adjust anytime

4. Meal Recommendation Engine

  • 10-day lunch & dinner plan
  • Respects diet restrictions for up to 3 users simultaneously
  • Filters by what's actually in stock
  • Recipe details: cook time, difficulty, nutrition

5. Auto-Decrement on "Cooked"

  • One tap to confirm a meal was prepared
  • Ingredients are deducted from inventory automatically
  • Handles partial usage and substitutions

6. Dynamic Replanning

  • If inventory shifts (shortage, guests, eating out) → plan recalculates
  • Suggests alternative meals instead of rigid adherence

7. Analytics Dashboard

  • Consumption trends over cycles
  • Wastage tracking (items expired without use)
  • Cost estimation & optimization suggestions

8. Notifications & Reminders

  • Refill reminders ("time to shop again")
  • Meal prep nudges
  • Expiry alerts

9. Responsive UI

  • Mobile-first — designed to live on the phone near the kitchen
  • Clean dashboards: today's meals, inventory snapshot, upcoming needs

Smart Differentiators

Feature What it does
AI meal recommendations Learns your household's taste and rhythm over cycles
Substitution engine No paneer? Suggests tofu. No cream? Suggests cashew paste.
Budget optimizer Set a budget ceiling; the grocery list adjusts to fit
Consumption learning Tunes the quantity model to your actual usage, not averages

Tech Stack

Frontend

  • Next.js (App Router) + TypeScript
  • Tailwind CSS for styling
  • Zustand for state management (with localStorage persistence)

Backend (Phase 2+)

  • Node.js / Express or Python / FastAPI (TBD)
  • REST or GraphQL API

Data

  • PostgreSQL for structured data
  • Redis for caching hot queries

Optional AI Layer (Phase 3)

  • Python microservice
  • Rule-based recommender → ML upgrade path

DevOps

  • GitHub Actions for CI
  • Vercel for frontend hosting
  • Railway / Fly.io for backend (TBD)

System Architecture

┌─────────────────────────────────────────────────────────┐
│                    Rasoi Web App                        │
│           (Next.js · React · Tailwind · TS)             │
└────────────────────────┬────────────────────────────────┘
                         │ REST / GraphQL
┌────────────────────────▼────────────────────────────────┐
│                  Application Server                     │
│              (Node.js / FastAPI — TBD)                  │
│                                                         │
│  ┌───────────┐  ┌──────────┐  ┌────────────────────┐    │
│  │ Grocery   │  │ Meal     │  │  Inventory         │    │
│  │ Planner   │  │ Planner  │  │  Service           │    │
│  └───────────┘  └──────────┘  └────────────────────┘    │
└────────┬──────────────┬──────────────────┬──────────────┘
         │              │                  │
    ┌────▼────┐    ┌────▼────┐        ┌────▼──────┐
    │ Postgres│    │  Redis  │        │ AI Micro- │
    │ (truth) │    │ (cache) │        │ service   │
    └─────────┘    └─────────┘        └───────────┘

Data Models

User

{
  id: string
  name: string
  household_id: string
  dietary_preferences: string[]   // ["vegetarian", "diabetic"]
  allergies: string[]             // ["peanuts"]
  cuisine_preferences: string[]   // ["north-indian", "thai"]
}

Inventory Item

{
  id: string
  name: string
  category: "grains" | "veg" | "fruit" | "dairy" | "protein" | "spice"
  quantity: number
  unit: "kg" | "g" | "L" | "ml" | "unit"
  expiry_date?: string            // ISO
  household_id: string
}

Meal

{
  id: string
  name: string
  ingredients: { item: string, qty: number, unit: string }[]
  diet_tags: string[]             // ["vegetarian", "gluten-free"]
  nutrition: { kcal: number, protein_g: number, carb_g: number, fat_g: number }
  cook_time_min: number
  difficulty: "easy" | "medium" | "hard"
}

Meal Plan

{
  id: string
  household_id: string
  day: number                     // 1..10
  meal_type: "lunch" | "dinner"
  meal_id: string
  status: "planned" | "cooked" | "skipped"
}

Application Flow

  1. Setup → Create household + user profiles, capture diets & allergies
  2. Grocery Planning → App generates 10-day grocery list, user tweaks & confirms
  3. Inventory Initialization → Confirmed purchase seeds inventory
  4. Meal Planning → App generates 10-day lunch/dinner plan respecting diets & stock
  5. Meal Execution → User taps "cooked" → ingredients deducted automatically
  6. Monitoring & Replanning → Alerts, analytics, dynamic adjustments

Getting Started

Prerequisites

  • Node.js ≥ 20.x
  • npm ≥ 10.x (or pnpm / yarn)
  • Git

Installation

# Clone the repo
git clone https://github.com/Tuhin-SnapD/dei-klien-inventory-manager.git
cd dei-klien-inventory-manager

# Install dependencies (once scaffolded)
npm install

# Start the dev server
npm run dev

Open http://localhost:3000 in your browser.

Available Scripts

Script Description
npm run dev Start development server with hot reload
npm run build Create production build
npm start Run production build
npm run lint Run ESLint
npm test Run unit + integration tests

How files are organized

dei-klien-inventory-manager/
├── app/                        # Next.js App Router pages
│   ├── (onboarding)/           # Profile setup
│   ├── grocery/                # 10-day grocery list
│   ├── inventory/              # Live inventory view
│   ├── meals/                  # Meal plan + cook confirmation
│   ├── dashboard/              # Home dashboard
│   └── layout.tsx
├── components/                 # Shared UI components
├── lib/
│   ├── store/                  # Zustand stores
│   ├── engine/                 # Grocery + meal planning logic
│   └── data/                   # Seed data (ingredients, meals, consumption rates)
├── public/
├── plan.md                     # Original product plan
├── README.md
└── package.json

Roadmap

Phase 1 — MVP In progress

  • User & household profiles
  • 10-day grocery list generation
  • Basic inventory tracking
  • Static meal plans with diet filtering
  • "Mark as cooked" inventory decrement

Phase 2 — Smart Loop

  • Dynamic meal recommendations
  • Substitution engine
  • Notifications (refill, expiry, prep)
  • Shareable grocery list (WhatsApp / CSV export)

Phase 3 — Intelligence

  • Consumption-pattern learning
  • Budget optimizer
  • Analytics dashboard (wastage, trends, cost)
  • Personalized ML meal recommender

Phase 4 — Beyond the Browser

  • React Native / Flutter mobile app
  • Voice input ("I cooked dal today")
  • Barcode scanning for inventory
  • Grocery-delivery integrations (Blinkit, Zepto, Instamart)
  • Smart-kitchen IoT hooks

Testing

  • Unit — Business logic (grocery math, meal filtering, decrement logic)
  • Integration — API layer and state flows
  • E2E — Cypress for the full user journey
  • Real-world — Weekly dogfood in the Dei Klien kitchen
npm test              # unit + integration
npm run test:e2e      # Cypress

Security & Privacy

  • Authentication via JWT / OAuth (Phase 2+)
  • Data encrypted at rest and in transit
  • No sharing of household data with third parties
  • User data is the user's — export & delete on demand

Contributing

This started as a household tool, but contributions are welcome.

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/amazing-idea)
  3. Commit your changes with a clear message
  4. Push and open a Pull Request

Please:

  • Keep PRs focused and small
  • Add tests for new logic
  • Run npm run lint before submitting

License

MIT © Tuhin Chakrabarty


The Name

Rasoi (रसोई) — Hindi for "kitchen" — the warm, unglamorous heart of every home. The place where rationing meets routine, where planning meets appetite, where Dei Klien actually gets fed.

"A smart kitchen isn't one with gadgets. It's one that knows what it has, what it needs, and what it's about to make."

Related notes

Frontend & UI

LevelUp Habit Tracker

A local-first habit tracker that turns daily routines into a visual, gamified system.

Frontend & UI

Portfolio

A modern, responsive portfolio website built with Next.js 14, featuring glassmorphic design, 3D animations, and dark/light mode toggle.

Frontend & UI

Online Banking App

A modern, feature-rich online banking application built with Angular 15.