CASE STUDY: PERSONAL PROJECT
Family Shopping App
A specialized mobile-only shopping and meal planning tool built for household coordination. By focusing strictly on a compact mobile scope, it provides a streamlined experience for family members to plan weekly meals, manage grocery checklists, and automatically optimize grocery routes by learning the aisle layout of your physical store as items are sorted.
Core Technology Stack
Designed For Family Context
Mobile-Only Design
Purpose-built exclusively for mobile viewports to align with the real-world context of grocery store shopping and quick kitchen meal planning. Avoids unnecessary desktop bloat.
Family Meal Planner
Integrates meal planning directly with shopping lists, allowing recipes and ingredients to dynamically generate and adjust the weekly grocery checklist.
Multi-Tenant Family Groups
Uses a session-based Group tenant system to isolate list contents. Invites allow family members to share lists and sync checks in real-time.
Route Optimization
Learns the layout of your supermarket as you drag items into order. Future shopping lists automatically sequence items to match your path through the aisles.
Architecture & Algorithm
Decimal Ordering Algorithm
Solves index-recalculation penalties by using fractional sort_order values (precision 15, scale 5). Moving an item calculates the midpoint between adjacent nodes (prev + next) / 2 in O(1) DB write time.
Modern Hotwire Stack
Powered by Rails 8.1 and Hotwire (Turbo + Stimulus). Re-renders list item checks and sorting updates instantly over the wire without full page requests.
Secure Tenant Scoping
Chains database queries strictly through current_group to prevent cross-tenant data leaks. Secured with bcrypt authentication.
Decimal/Fractional Ordering Algorithm
Traditional drag-and-drop lists assign integer indexes (1, 2, 3...) to items. However, inserting an item into the middle of the list forces the system to increment the sort index of all subsequent rows, triggering an expensive O(N) update query in the database.
Midpoint Calculation Formula:
By implementing a decimal sort_order field in the database (using SQLite's floating point decimal properties with precision: 15, scale: 5), we can calculate a fractional midpoint. For example, dragging an item between sort position 1.0 and2.0 updates only the single shifted item's value to1.5. This delivers a constantO(1) write complexity, scaling gracefully for daily family sorting activities.
This ordering is crucial for weekly grocery runs. As family members drag items into order while shopping, the app learns their relative supermarket aisle positions. When these items are added to subsequent shopping lists, the database automatically sequences them to match the optimal path through the physical store, streamlining the family shopping routine.
Live Project Link
Visit the live Family Shopping App interface to check out the mobile-optimized checklist, meal planner, and sorting features.
