Skip to content

Lab · Full-Stack Development

Lab: plan a tiffin subscription app

Labbeginner· about 2 hours· 4 steps

The brief

Ghar Ka Khana delivers home-style lunch and dinner tiffins to students and office workers in Bengaluru, and wants an app. Plan it like a professional: check the user stories, design the tables with their rules, prove the model answers the owner's first business question, and write the API contract the frontend and backend will both follow.

Why it matters

Most failed projects fail in planning, not in code: a missing table, a vague requirement, a frontend and backend that disagree about a field name. Freelancers and product teams in India write exactly these documents before quoting a price or starting a sprint.

Skills you practise

  • user stories
  • parsing text with a regular expression
  • tables, keys and constraints
  • a business query with LEFT JOIN and GROUP BY
  • an API contract
  • one error shape

What you will have at the end

plan.js and model.sql: checked user stories, a data model with its rules, a working revenue query and an API contract for Ghar Ka Khana.

How it is marked (rubric, 100 points)
Correct resultsEvery check passes.45
Rules in the right placeKeys, UNIQUE and CHECK constraints in the schema; one error shape in the contract.25
Clear planningStories have a role, a want and a reason; endpoints use nouns and the right status codes.20
Can explainYou can explain why the LEFT JOIN condition goes in ON, not WHERE.10

0/4 steps done

Step 1 of 4

Check the user stories

parseStory(text) returns { role, want, benefit } for "As a <role>, I want <something>, so that <reason>" (a or an, any case, optional comma, optional full stop) and null for anything else.

A user story says who wants what, and why: "As a hostel student, I want to pause my tiffin during exams, so that I do not pay for meals I skip." The why is what helps the team build the right thing. The owner wrote 20 stories in a WhatsApp chat; this function checks each one has all three parts and pulls them out for the planning sheet.

A regular expression with three capture groups ( ) does it. The i flag ignores case; .+? takes as little text as possible, so each group stops at the next fixed words.

Run shows what your code prints. Check runs the step's tests. Ctrl+Enter checks too.