Skip to main content
Back to Projects ArchiveProject 02 of 04
Technical Pilot • Deployed MVPCloud Kitchen & Campus Logistics OS
Chef Apedo Foods logo

Chef Apedo Foods

Full-Stack Food Ordering & Delivery Management Platform

A vertically integrated food ordering and dispatch operations system engineered for a delivery-only cloud kitchen serving the University of Ghana, Legon campus community.

Next.js 16 (App Router)React 18TypeScriptTailwind CSSSupabase PostgreSQLSupabase RealtimeLeaflet MapsZodVitest (116 Tests)
https://chefapedofoods.vercel.app
Technical Pilot Preview
Chef Apedo Foods Storefront Landing Hero
Storefront landing interface with mobile-first menu discovery and real-time orderingCustomer Portal
Project Classification

Technical Pilot / Deployed MVP

Demonstrates architectural viability and operations. Not an active commercial business taking public orders.

Financial Precision

Integer Pesewas Accounting

Zero floating-point math across line items, proteins, and delivery fees. 1 GHS = 100 pesewas.

Kitchen Operations

Supabase WebSocket KDS

Realtime subscriptions push tickets to kitchen displays instantly without manual polling.

Checkout Reality

Manual Order Flow (Hubtel Inactive)

Active flow uses manual arrangements; Hubtel gateway integration is present in codebase but currently inactive.

01 • CONCEPT & OPERATIONAL REALITY

The Idea: A Cloud Kitchen Built for Campus Logistics

Chef Apedo Foods was conceived around the operational needs of an independent, delivery-only culinary business serving the University of Ghana, Legon campus. Traditional food aggregators impose prohibitive commission fees (often 20% to 30%) and standard retail e-commerce software assumes conventional street addresses, credit card payments, and postal delivery.

On a Ghanaian university campus, food delivery is fundamentally different:

Hyper-Localized Dropoffs

Orders are bound to specific student residential halls (Evandy, Pentagon, Commonwealth, Volta, Night Market) where street addresses do not exist.

Dual Payment Separation

Food revenue belongs to the kitchen, while delivery fees are collected physically by dispatch riders at the hostel gate.

High-Volume Kitchen Rushes

Orders arrive in intense lunch and evening bursts, necessitating an auto-updating Kitchen Display System rather than manual phone checks.

02 • ENGINEERING CHALLENGES

The Engineering & Architectural Challenges

01

Complex Combinatorial Meal Pricing

Ghanaian cuisine involves dynamic combinations: a base rice portion (Regular or Large), an included protein package (e.g. Crispy Chicken, Grilled Tilapia, or Boiled Egg), and optional supplementary proteins. Calculating these combinations on the client risks price manipulation if not strictly validated on the server.

02

Unreliable Mobile Network Conditions

Students and riders frequently browse under throttled mobile 3G/4G connectivity. If interactive map tile servers (OpenStreetMap/Leaflet) fail to load, the ordering pipeline must degrade gracefully to a pre-cached text landmark selector rather than blocking checkout.

03

Three-Way State Synchronization

A single order moves through distinct stages across three separate personas: the student tracking progress, the kitchen staff advancing tickets, and the dispatch rider confirming physical cash/MoMo collection at the gate.

03 • CUSTOMER EXPERIENCE

The Customer Ordering Workflow

From interactive menu selection and protein package customization to landmark delivery and live order tracking.

A • Deep Item Customization

Portion Sizing & Protein Packages

Customers choose base meals (Signature Jollof, Fried Rice, Assorted Waakye) and customize portions. Each option updates running totals in real time on the client before being sent for server-authoritative validation.

Chef Apedo Foods Interactive Menu & Customization Interface
B • Resilient Location & Tracking

Map Selection with Landmark Fallbacks

Students can pick delivery dropoffs using an interactive Leaflet map centered on Legon campus or select from pre-seeded landmarks (hostels, lecture halls). If map tiles fail on poor connections, the form gracefully falls back to instant landmark radio buttons.

Delivery Pricing & Campus Coverage
  • GPS Tier (0–3.0 km from South Legon Hub)GH₵ 7.00 base
  • Additional Distance (> 3.0 km, up to 15.0 km)+GH₵ 2.00 / km
  • Configurable Regional Zones (East Legon, Osu, Spintex)GH₵ 10 – 20
04 • CORE BUSINESS LOGIC

Server-Authoritative Pricing & Pesewa Accounting

Eliminating client price tampering and JavaScript IEEE 754 floating-point inaccuracies.

All currency values throughout the Chef Apedo Foods architecture are calculated and stored exclusively as integers in Ghanaian Pesewas (1 GH₵ = 100 pesewas). The client transmits only item IDs, portion selections, and extra protein IDs; the server looks up database records directly and recomputes every line item.

lib/pricing/index.ts — Server-Authoritative Subtotal Calculation
// Source: chefapedo/lib/pricing/index.ts
import { MEAL_SIZES, EXTRA_PROTEIN_PESEWAS } from "@/config/business";

type SizeKey = keyof typeof MEAL_SIZES;
type ExtraKey = keyof typeof EXTRA_PROTEIN_PESEWAS;

export function calculateFoodSubtotalPesewas(
  size: SizeKey,
  extras: { chicken?: number; sausage?: number; egg?: number; fish?: number } = {}
): number {
  // 1. Look up authoritative base price from locked business configuration
  let total: number = MEAL_SIZES[size].basePesewas; // small: 4500, medium: 7000, large: 9000

  // 2. Accumulate additional protein add-ons in pure integer pesewas
  (Object.keys(extras) as ExtraKey[]).forEach((key) => {
    const qty = extras[key] ?? 0;
    if (qty > 0) {
      total += EXTRA_PROTEIN_PESEWAS[key] * qty;
    }
  });

  return total; // Always integer pesewas (never float; 1 GH₵ = 100 pesewas)
}
Integer Precision

Guarantees zero fractional pesewa drift across financial calculations and Paystack/Hubtel transactions.

Operating Hours Gate

Window: 6:00 AM – 5:00 PM GMT; same-day cutoff at 10:00 AM (first slot 11:30 AM); ASAP cooking: 8:00 AM – 3:00 PM GMT.

Order Expiration Engine

Unpaid orders expire after 15 minutes with gateway payment status verification before cancellation.

05 • KITCHEN & BACKOFFICE

Kitchen Display System (KDS) & Financial Ledger

Realtime WebSocket order queues, status dispatch, and daily payment channel reconciliation.

Kitchen Display System (/admin)

Live Supabase WebSocket Ticket Feed

Kitchen staff monitor orders across active state columns: Awaiting Confirmation → Preparing → Ready → Dispatched. One-tap actions assign available dispatch riders and trigger SMS notifications to students.

Chef Apedo Foods Kitchen Overview Admin Dashboard with real-time Supabase subscriptions
Financial Ledger (/admin/finance)

Daily Revenue, MoMo & Courier Fee Audit

Tracks daily culinary revenue and isolates delivery fees collected by riders. Provides reconciliation breakdown across Mobile Money (MTN, Telecel, AT) and on-delivery cash settlements.

Chef Apedo Foods Financial Ledger auditing food revenue and MoMo splits
06 • LOGISTICS DISPATCH

The Courier Experience (/rider)

Dedicated Dispatch View

Focused Mobile Queue with Cash Collection Gate

Dispatch couriers log in using their verified phone number to access an isolated delivery queue. Couriers see only active orders assigned to them, complete with student contact numbers, dropoff landmarks, and directions.

  • 1-Tap Navigation: Direct deep-links to Google Maps with landmark destination coordinates.
  • Mandatory Payment Gate: Courier must explicitly confirm collection of the delivery fee before closing out the order.
  • Automated Customer Review Trigger: Marking delivery completed fires an automated SMS inviting the student to submit a 1–5 star dish review.
Chef Apedo Foods Kwame Dispatch Courier Logistics Portal
07 • SYSTEM ARCHITECTURE

Verified Stack & Architectural Pipeline

1. Frontend & State

Next.js 16 (App Router), React 18, TypeScript, Tailwind CSS, Framer Motion transitions.

2. Validation Layer

Zod schemas validate all API payloads (line items, phone numbers, landmark codes).

3. Database & Realtime

Supabase PostgreSQL with Realtime Channels powering live KDS push updates.

4. External Gateways

Agoo SMS for customer dispatch alerts. Hubtel payment code present but inactive.

08 • RELATIONAL DATA MODEL

Database Schema & Migration Structure

Verified across 6 SQL migrations in supabase/migrations/ (0001_init through 0006_order_expiry_and_reconciliation).

Table EntityPurposeKey Columns & Relationships
ordersCore order transaction lifecycle & payment reconciliationid, customer_id (FK), address_id (FK), subtotal_pesewas, delivery_fee_pesewas, order_status, payment_status, payment_collected, rider_id (FK), expires_at, created_at
order_itemsIndividual meal line items & snapshot packagesid, order_id (FK), meal_id (FK), size_id (FK), quantity, base_price_pesewas, included_protein_package_name
meals & meal_sizesCatalog dishes, portion tiers (Small/Medium/Large) & base tariffsmeals: id, name, description, available; meal_sizes: id, meal_id (FK), size, base_price_pesewas
protein_options & packagesPortion-bundled protein options & add-on tariffsprotein_options: id, name, additional_price_pesewas; protein_packages: id, meal_size_id (FK), name
delivery_zonesRegional coverage zones & delivery tariffsid, name, areas (text[]), fee_pesewas, active
ridersCampus dispatch couriersid, full_name, phone_number, is_active, created_at
reviewsPost-delivery rating & feedback loopid, order_id (FK, unique), rating (1–5), customer_comment, created_at
kitchen_settingsAtomic daily order capacity & kitchen shift gatesid, open, daily_capacity (default: 12), orders_today, orders_date
09 • QUALITY ASSURANCE

Testing Suite & Reliability Verification

Verified execution using Vitest test runner.

116 Tests Passing Across 19 Test Files (Vitest Runner)

Command: npm test (vitest run) • Zero Failures

Duration: 7.30s
Unit Test Suites (10 files • 73 tests)
  • • landmarks.test.ts (19 tests) — Campus coordinate fallbacks
  • • validation.test.ts (9 tests) — Zod schema input barriers
  • • operating-hours.test.ts (9 tests) — Kitchen time shift gates
  • • delivery.test.ts (7 tests) — Zone fee algorithms
  • • pricing.test.ts (6 tests) — Pesewa rounding integrity
  • • distance-pricing.test.ts (6 tests) — Off-campus tariff scaling
  • • edge-cases.test.ts (6 tests) — Empty trays & invalid IDs
  • • expiration.test.ts (5 tests) — 15-minute order lifecycle
  • • timing.test.ts (5 tests) — ETA calculation windows
  • • logistics-timing.test.ts (3 tests) — Dispatch delays
API & Integration Suites (9 files • 43 tests)
  • • webhooks.test.ts (10 tests) — Hubtel webhook security
  • • orders.test.ts (5 tests) — Order creation and persistence
  • • hubtel.test.ts (5 tests) — Hosted payment initiation
  • • promos.test.ts (5 tests) — Promotional code redemption
  • • rider.test.ts (4 tests) — Courier queue filtering
  • • marketing.test.ts (4 tests) — SMS blast dispatcher
  • • feedback.test.ts (4 tests) — Customer review intake
  • • manual-orders.test.ts (3 tests) — Cash-on-delivery endpoint
  • • golden-path.test.ts (1 test) — Full checkout integration
10 • ENGINEERING INSIGHTS

Key Lessons & Software Engineering Takeaways

Never Trust Client Pricing

In food ordering systems, allowing client applications to pass total prices directly to checkout is an invitation to manipulation. Enforcing server-authoritative calculations where client payloads transmit only references ensures financial integrity.

Security Audits Before Commercial Scaling

Moving from a working prototype to a live commercial platform requires rigorous security review. Code inspections identified areas where administrative authorization, webhook signature validation, and database Row Level Security policies require hardening before handling open financial transactions.

11 • CURRENT STATUS & LIMITATIONS

Current Limitations & Verification Boundaries

Technical Pilot Classification

Chef Apedo Foods is deployed as an engineering pilot demonstrating end-to-end culinary logistics. It is not currently operating as an active public food venture, and order volume or commercial traction metrics are not claimed.

Payment & Authorization Hardening Needed

The active checkout uses manual payment arrangements rather than the hosted Hubtel payment gateway. Administrative authorization and rider verification require production hardening prior to open commercial use.

12 • FUTURE WORK

Planned Architecture Improvements

Key steps to advance the pilot into a fully hardened, production-grade cloud kitchen:

01

Hardened RBAC & RLS Policies

Enforce strict role-based access control (RBAC) across administrative endpoints and lock down rider table policies to prevent unauthorized record reading.

02

Active Payment Webhook Verification

Activate automated Mobile Money payment processing with mandatory cryptographic webhook signature verification and idempotent order reconciliation.

03

Scheduled Background Processing

Implement resilient Vercel cron tasks with strict secret verification for automated order expiration, kitchen shift rollover, and daily financial reconciliation.

Project 01 • Luxury E-Commerce & Spatial Logistics

MENSAH

Luxury tailoring, deterministic virtual sizing & Haversine courier dispatch prototype.

• Case Study AvailableRead Case Study
Project 03 • Academic Software Engineering

Raku Vehicle Rental Management System

Fleet inventory, client reservations & backoffice management engine.

• Case Study AvailableRead Case Study
Project 04 • Nonprofit Platform & Health Hub

Davcie Foundation

Paediatric diabetes health education, emblem motion physics & authenticated admin portal.

• Case Study AvailableRead Case Study