Portfolio / Zawadi E-Commerce
๐ŸŽ E-Commerce ยท Fintech

Zawadi E-Commerce

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.

Role Full-Stack Developer
Duration 2 Months
Category E-Commerce / Fintech
Status Production
๐Ÿš€ Visit Live Shop โ†—

Platform overview.

TS
TypeScript Backend
STK
M-Pesa Push Integration
4+
Phone Format Supported
Atomic
Payment Processing

E-commerce in Kenya needs native payment support.

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.

M-Pesa-first e-commerce architecture.

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.

What makes it work.

  • ๐Ÿ’ณ M-Pesa STK Push โ€” One-tap payment initiation. Customer enters phone number, receives Safaricom prompt, enters PIN, payment confirmed โ€” all within the app flow.
  • ๐Ÿ“ฑ Multi-format phone validation โ€” Accepts 07XX, 01XX, +254XX, 254XX formats. Strips spaces, hyphens, and validates against Safaricom number ranges before API call.
  • โš›๏ธ Atomic transactions โ€” Inventory reservation, order creation, and payment processing wrapped in a transactional boundary. Failed payments auto-release reserved stock.
  • ๐Ÿ›’ Persistent shopping cart โ€” Cart state persisted across sessions. Quantity updates, item removal, and real-time subtotal calculation with currency formatting.
  • ๐Ÿ” Product discovery โ€” Full-text search, category filtering, price range selection, and sort options (price, name, newest). Responsive product grid with image lazy loading.
  • โค๏ธ Wishlist management โ€” Save products for later with one click. Wishlist synced across devices for authenticated users.
  • ๐Ÿ“ฆ Order tracking โ€” Real-time order status from payment confirmed โ†’ processing โ†’ shipped โ†’ delivered. Push notifications at each stage.
  • ๐Ÿ” TypeScript end-to-end โ€” Shared type definitions between frontend and backend ensure API contract safety and catch integration errors at compile time.

Built with purpose.

๐Ÿ–ฅ๏ธ Backend

Express.js with TypeScript for type-safe API development. Structured with controllers, services, and middleware layers.

Express.js TypeScript Node.js

โš›๏ธ Frontend

React with component-based architecture, context API for state management, and Axios for API communication.

React Axios CSS Modules

๐Ÿ’ณ Payments

M-Pesa Daraja API with STK Push, callback handling, transaction status queries, and comprehensive error recovery.

M-Pesa Daraja API STK Push

๐Ÿ”ง DevOps

Development and production environment configurations with automated build pipeline and environment variable management.

Node.js npm scripts dotenv

Building e-commerce for African markets?

Let's discuss M-Pesa-native checkout flows and TypeScript-first architectures.

Start a Conversation โ†—