← All Reports

Dev Sprint 1 Report

Supabase Schema + Auth + React Scaffold
Report 2026-03-19 6 Stories, 34 SP Complete
6
Stories Delivered
34
Story Points
174
Tests Passing
7
Database Tables

Overview

Dev Sprint 1 delivered the complete technical foundation for the Pantry App. The sprint goal was to establish the database schema, authentication flow, and React scaffold so that all subsequent feature sprints can build on a solid, tested base.

All six user stories were completed. The Supabase PostgreSQL schema covers households, members, inventory, receipts, and budgets. Row-Level Security policies enforce multi-tenant data isolation. The React 19 + Vite 8 scaffold includes protected routes, auth context, and a component library wired to OKLCH design tokens from the Design Sprint.

Deliverables

ID Deliverable Detail Status
D-01React/Vite ScaffoldReact 19, Vite 8, ESLint, folder structure, routingComplete
D-02Supabase Schema (7 tables)households, household_members, categories, inventory_items, baseline_stock, receipts, budget_periodsComplete
D-03RLS PoliciesRow-Level Security with helper functions for multi-tenant isolationComplete
D-04Auth FlowSign-up, sign-in, sign-out with Supabase AuthComplete
D-05Household ManagementHousehold creation and member invite flowComplete
D-06Protected RoutesAuth-guarded pages with redirect to loginComplete
D-07Test Suite (174 tests)97 schema, 57 RLS, 11 auth flow, 9 componentComplete
D-08Cloudflare Pages DeployCI pipeline, production build, live URLComplete

Database Schema

Seven tables form the core data model. All tables include created_at and updated_at timestamps. Foreign keys enforce referential integrity across the household boundary.

Table Overview

Table Purpose Key Columns
householdsTop-level tenant containerid, name, created_by, currency (ZAR)
household_membersUser membership and roleshousehold_id, user_id, role (manager/member/viewer)
categoriesGrocery categorieshousehold_id, name, icon, sort_order
inventory_itemsCurrent pantry stockhousehold_id, category_id, name, quantity, unit, expiry_date
baseline_stockIdeal stock levels per itemhousehold_id, item_name, target_quantity, unit
receiptsScanned receipt recordshousehold_id, store, total_zar, scanned_at, items (JSONB)
budget_periodsMonthly budget trackinghousehold_id, month, budget_zar, spent_zar

RLS Policy Design

Every table has Row-Level Security enabled. Two PostgreSQL helper functions simplify policy definitions:

Policies enforce that users can only read and write data within their own households. Manager-only operations (inviting members, deleting items) check the role function. This design ensures complete multi-tenant data isolation without application-level filtering.

Tech Decisions

React 19 + Vite 8
Latest stable React with Vite for fast HMR. Server components deferred to a later sprint; client-side rendering is sufficient for the current feature set.
Supabase (Auth + PostgreSQL)
Managed PostgreSQL with built-in auth, real-time subscriptions, and RLS. Eliminates the need for a custom backend in early sprints.
OKLCH Design Tokens
Warm cream (#FAF7F2) and forest green palette from the Design Sprint. Tokens are CSS custom properties, consumed by all components.
Vitest + Testing Library
Vitest for unit and integration tests. React Testing Library for component tests. Supabase test helpers for schema and RLS validation.

Test Suite Breakdown

97
Schema Tests
57
RLS Tests
11
Auth Flow Tests
9
Component Tests

All 174 tests pass in CI. Schema tests verify table structures, constraints, and foreign keys. RLS tests confirm that users in one household cannot access another household's data. Auth flow tests cover sign-up, sign-in, sign-out, and session refresh. Component tests validate the login form, household selector, and protected route wrapper.

South African Context

Acceptance Criteria

All 13 acceptance criteria passed during sprint review.

Team

Role Responsibility
Tech LeadArchitecture decisions, schema design, RLS policies, code review
Full-Stack DevReact scaffold, auth integration, protected routes, component library
Backend DevSupabase migrations, helper functions, test suite (schema + RLS)
QA EngineerAuth flow tests, component tests, CI pipeline, deploy verification

Next Sprint

Dev Sprint 2 will focus on building the dashboard and inventory screens using the prototypes from the Design Sprint. Key objectives: