A full-stack e-commerce platform with an Express.js + TypeScript backend and React frontend. Features M-Pesa STK Push integration with comprehensive phone number format validation and atomic payment processing.
Highlights
The Problem
Most e-commerce frameworks are built for card payments and Western payment processors. Integrating M-Pesa as a first-class payment method โ with all its format quirks, callback patterns, and mobile-native UX expectations โ requires significant custom engineering.
Kenyan consumers expect to enter their phone number, receive an STK Push prompt, and complete payment without leaving the app. The backend must handle this atomically to prevent partial orders and inventory inconsistencies.
The Solution
Zawadi places M-Pesa at the center of the checkout flow. The TypeScript backend validates phone numbers across all Kenyan formats (07XX, 01XX, +254XX, 254XX), initiates STK Push, and processes callbacks atomically โ ensuring that inventory reservation, order creation, and payment confirmation happen as a single unit of work.
The React frontend provides a seamless shopping experience with real-time cart updates, product search, category filtering, wishlist management, and a checkout flow optimized for mobile-money payment patterns.
Features
Tech Stack
Express.js with TypeScript for type-safe API development. Structured with controllers, services, and middleware layers.
React with component-based architecture, context API for state management, and Axios for API communication.
M-Pesa Daraja API with STK Push, callback handling, transaction status queries, and comprehensive error recovery.
Development and production environment configurations with automated build pipeline and environment variable management.