Portfolio Logo

Gerald Bahati.

Full-Stack Software Engineer

contact

Based in Nairobi, Kenya

make contact

Accessibility

Mon – Fri: 9:00 - 18:00

Async communication via Email

Legal

Imprint
Data protection

©2026 Gerald Bahati | All rights reserved.

Previous ProjectModern Dashboard
Next ProjectTeamFlow

Would you like to be featured here as well?

Feel free to use the contact form or other contact options.

Projekt anfragen

Webline Dashboard

ProjectsWebline Dashboard
Webline Dashboard

Complete e-commerce control center

Overview

Comprehensive admin panel for managing the Webline e-commerce platform. Built with Next.js 16 and oRPC for end-to-end type safety, featuring real-time data synchronization, order lifecycle management, and a dynamic promotion engine.

Architecture

LayerTechnology
FrontendNext.js 16, React 19, Tailwind CSS 4
APIoRPC with end-to-end TypeScript type safety
AuthBetter Auth (passkey, 2FA, OAuth support)
GatewayCloudflare Worker with resilience patterns
DatabaseCloudflare D1 + Drizzle ORM (25+ tables)

Order Lifecycle Management

Complete state machine for order tracking:

pending_payment → confirmed → processing → shipped → delivered
        ↓
    cancelled (from any state)

Each transition triggers:

  • Inventory updates
  • Customer notifications
  • Analytics events
  • Webhook dispatches

API Gateway Resilience

Rate Limiting (Sliding Window)

TierLimitWindow
API100 requests60 seconds
Auth5 requests300 seconds
Search30 requests60 seconds
Upload10 requests3600 seconds

Circuit Breaker Pattern

  • Closed State: Normal operation, requests pass through
  • Open State: After 5 failures, all requests fail-fast for 30 seconds
  • Half-Open State: Test single request, reset or re-open based on result

Retry with Exponential Backoff

delay = baseDelay * 2^attempt + random(0, 100)ms
// Capped at maxDelay (10 seconds)

Customer:

Webline Technologies

Period:

6 months

Performance:

Full-Stack DevelopmentAdmin DashboardAPI Gateway DesignAnalytics SystemsAuth & Security

Features:

Order Lifecycle TrackingProduct & Inventory ManagementPromotion EngineReal-Time AnalyticsRole-Based Access ControlCircuit Breaker Gateway

Indigo Primary

Success Green

Error Red

White

Challenge: Resilient Microservices Gateway

The Problem

Building an API gateway that handles rate limiting, circuit breaking, and graceful degradation across multiple backend services while maintaining sub-100ms response times.

The Solution

Implemented a Cloudflare Workers gateway with multiple resilience patterns:

  • Sliding Window Rate Limiting: Token bucket algorithm with KV storage for distributed state
  • 3-State Circuit Breaker: Automatic failure detection and recovery (5 failures → 30s cooldown)
  • Exponential Backoff with Jitter: Prevents thundering herd on retry storms
  • Stale-While-Revalidate: Serve cached responses immediately, refresh in background
  • Non-blocking Telemetry: waitUntil() for async logging without latency impact

Challenge: Complex Order State Management

The Problem

E-commerce orders have complex lifecycles with multiple state transitions, each requiring atomic updates across inventory, payments, and notifications.

The Solution

Designed an event-driven order system:

  • State Machine: Explicit transitions with validation rules (e.g., can't ship a cancelled order)
  • Soft References: Order items preserve product history even after deletion
  • Transaction Logging: Every state change recorded with timestamp and actor
  • Queue-Based Side Effects: Notifications and analytics processed asynchronously via Cloudflare Queues

Challenge: Flexible Promotion Rules

The Problem

Marketing teams need to create complex promotional campaigns with time-based triggers, usage limits, and stacking rules—without developer intervention.

The Solution

Built a dynamic promotion engine:

  • Rule Builder: Admin UI for creating conditions (user registration date, cart value, product categories)
  • Coupon Validation Middleware: Real-time checking with clear error messages
  • Redemption Tracking: Per-user limits with atomic increment operations
  • A/B Testing Support: Multiple promotion variants with automatic winner selection
Webline Dashboard - E-commerce admin panel
Metrics components
Analytics component
Sales Map Summary

The admin dashboard Gerald delivered gives us complete control over our e-commerce operations. The order lifecycle tracking is seamless, and the promotion engine has become essential for our marketing campaigns. What impressed me most was the resilient API gateway architecture—the circuit breaker and rate limiting ensure our system stays stable even under heavy load. Gerald's ability to architect complex systems while keeping the user experience simple is outstanding.

Patrick Gitau

Chief Executive Officer · Webline Technologies Ltd.

Tap to visit
Check it out!
Click to visit
Webline Dashboard - E-commerce admin panel
Type-Safe API
Gateway Uptime
Dev Time Saved