Auto-replenishment system for small restaurants.
ReStocka solves a critical operational problem: restaurant owners are the purchasing bottleneck because managers are not empowered or reliable. When supplies run out, operations stop and owners are constantly interrupted.
This system automates replenishment with rule-based ordering, keeping businesses running even when humans fail.
- Real-time stock status overview (OK, Low, Critical, Out)
- Active alerts count
- Pending orders count
- Critical items list
- Recent orders list
- View stock levels by location
- Color-coded status indicators
- Days remaining calculation based on daily usage
- Multi-location support for owners
- Full order lifecycle tracking (Draft → Sent → Delivered/Not Delivered)
- Manager delivery confirmation with one tap
- Automatic stock level updates on delivery
- Alert creation on delivery failures
- Low stock warnings
- Draft PO pending approval
- Emergency reorder notifications
- Delivery failure alerts
- Dismissable by owners
- Owner: Full access to all locations, products, suppliers, and settings
- Manager: Limited to assigned location, can only view stock and confirm deliveries
- Expo SDK 53
- React Native 0.76.7
- React Query for server state
- NativeWind (TailwindCSS)
- Expo Router for navigation
- Bun runtime
- Hono server
- Prisma ORM with SQLite
- Better Auth for authentication
/
├── src/
│ ├── app/
│ │ ├── (tabs)/ # Tab screens
│ │ │ ├── index.tsx # Dashboard
│ │ │ ├── inventory.tsx
│ │ │ ├── orders.tsx
│ │ │ ├── alerts.tsx
│ │ │ └── settings.tsx
│ │ ├── login.tsx # Login/signup screen
│ │ ├── onboarding.tsx # Business setup
│ │ ├── add-product.tsx # Add new product
│ │ ├── add-supplier.tsx # Add new supplier
│ │ ├── create-order.tsx # Create purchase order
│ │ ├── edit-stock.tsx # Edit stock levels
│ │ └── _layout.tsx
│ ├── components/
│ │ └── AuthGate.tsx # Auth flow controller
│ └── lib/
│ ├── api.ts # API client
│ ├── authClient.ts # Auth client
│ └── useSession.tsx # Session hook
├── backend/
│ ├── src/
│ │ ├── routes/ # API routes
│ │ │ ├── me.ts
│ │ │ ├── onboarding.ts
│ │ │ ├── locations.ts
│ │ │ ├── products.ts
│ │ │ ├── suppliers.ts
│ │ │ ├── stock.ts
│ │ │ ├── orders.ts
│ │ │ ├── alerts.ts
│ │ │ └── dashboard.ts
│ │ ├── auth.ts
│ │ ├── db.ts
│ │ └── index.ts
│ └── prisma/
│ └── schema.prisma
└── shared/
└── contracts.ts # Shared API types
POST /api/auth/sign-up- Create accountPOST /api/auth/sign-in- Sign inPOST /api/auth/sign-out- Sign out
GET /api/me- Get current user with membership
POST /api/onboarding- Create organization (become owner)
GET /api/locations- List locationsPOST /api/locations- Create location (owner only)
GET /api/products- List productsPOST /api/products- Create product (owner only)PUT /api/products/:id- Update product (owner only)
GET /api/suppliers- List suppliersPOST /api/suppliers- Create supplier (owner only)
GET /api/stock/:locationId- Get stock levelsPUT /api/stock/:locationId/:productId- Update stock (owner only)
GET /api/orders- List ordersPOST /api/orders- Create order (owner only)PUT /api/orders/:id/send- Send order (owner only)PUT /api/orders/:id/confirm- Confirm delivery
GET /api/alerts- List alertsPUT /api/alerts/:id/read- Mark as readPUT /api/alerts/:id/dismiss- Dismiss alert (owner only)
GET /api/dashboard- Get dashboard summary
- Primary: Teal
#0D9488 - Dark: Navy
#0F172A - Success: Emerald
#10B981 - Warning: Amber
#F59E0B - Critical: Orange
#F97316 - Danger: Rose
#EF4444
- OK: Green - plenty of stock
- Low: Yellow - getting low
- Critical: Orange - urgent
- Out: Red - out of stock
- Gated access: Users must sign in and set up their business before accessing the main app
- Sign out option: Available on onboarding screen to switch accounts
- Pull-to-refresh: All list screens support pull-down to refresh
- Clear error states: Form errors displayed inline, not as alerts
- Loading indicators: Activity indicators during async operations
- Add Products: Create products with name, SKU, unit, and category
- Add Suppliers: Create suppliers with contact details
- Create Purchase Orders: Multi-step wizard to create orders
- Edit Stock Levels: Tap any inventory item to update on-hand quantity and daily usage
- View All Locations: Access all locations in the organization
- View Inventory: See stock levels for assigned location (read-only)
- Confirm Deliveries: Mark orders as delivered or not delivered
- View Alerts: See location-specific alerts (read-only)
- Login Screen - First screen users see. Sign in or create account.
- Onboarding - After login, new users create their business and first location.
- Main App (Tabs) - Only accessible after login + business setup complete.
- Sign up for an account
- Create your organization with first location
- Add products to your catalog
- Add suppliers
- Set up reorder rules with automation modes
- Monitor dashboard for stock status
- Run reorder checks to automate purchasing
ReStocka supports four automation modes for reorder rules:
- Manual: Creates alerts only when stock is low. You manually create orders.
- Assisted: Creates draft purchase orders for your review before sending.
- Auto: Automatically sends purchase orders to suppliers when stock is low.
- Emergency: Immediately sends orders and creates critical alerts for urgent situations.
Each rule is configured with:
- Safety Days: Trigger threshold (e.g., reorder when < 3 days of stock remain)
- Reorder Quantity: How much to order each time
- Price Cap: Optional maximum price per unit
- WhatsApp notifications
- Delivery SLA tracking
- Feature flags for gradual rollout