Ken Lakwena

Ken Lakwena

Principal Software Engineer with 10 years building practical fintech for Africa's informal sector and education analytics platforms. I architect mobile-first systems that work where infrastructure doesn't. Currently preparing for transition from solo architect to team lead in structured enterprise environments.
0
Years Production
0
KES Transacted
0
Loans Processed
0
Free SMS Sent
Android (Java/Kotlin)PWASMS GatewayOffline-FirstMoMo PaymentNode.jsPythonPostgreSQLFirebaseSupabaseVercelDjangoCloudflare

Architecture Philosophy

Android as Infrastructure

I treat cheap Android phones as first-class infrastructure components—not just user devices. My SMS gateway architecture turns a $50 Android phone into a reliable SMS server and payment gateway, eliminating commercial SMS gateway costs for informal lenders and MoMo API complexity for developers. USB debugging, ADB automation, and Java service layers enable enterprise-grade messaging at near-zero cost.

99.2% delivery reliability across 46 schools

Offline-First PWA

In Sub-Saharan Africa, connectivity is intermittent. I design PWAs with IndexedDB sync queues, service worker caching, and conflict resolution strategies that let schools comfortably work offline for 3 months. Teachers can mark attendance offline and process bulk exam results. CRDT-based sync reconciles changes automatically when they connect to Internet.

1 school term offline capability, field-tested in 46 schools

Informal FinTech Compliance

Micro-lenders need GAAP/IFRS compliance without enterprise complexity. My double-entry architecture includes full audit trails, transaction integrity, and automated financial reporting (Cash Flow, Income Statement, Balance Sheet, Trial Balance, Liability Report) designed for SACCOs and informal lenders with minimal accounting training.

KES 27M+ processed with full audit trails

Education Analytics at Scale

School systems serving thousands of students need robust data pipelines. My architecture processed 32 KNEC subjects across 46 schools, generating automated PDF progress report cards, SMS delivery of results, and teacher appraisals—all designed for users with basic computer literacy and intermittent electricity.

15,000+ students, 46 schools, 32 subjects

Technical Competencies

Edge & Serverless

Cloudflare WorkersDurable ObjectsR2 StorageWorkers KVQueuesService BindingsWrangler CLI

Desktop Apps

Electron.jsIPC CommunicationIndexedDBNative ModulesMenu / NotificationsAuto UpdateSQLiteFile System Access

Backend & BaaS

Node.jsPythonJavaGoPHPREST / GraphQLFirebaseSupabaseMySQLVercelDjango

Frontend & Mobile

ReactVue.jsjQueryOnsenUICordovaPWAAndroid (Java/Kotlin)

Databases

PostgreSQLMongoDBFirestoreIndexedDBSQLiteMySQLRedisWorkers KV

DevOps & Cloud

DockerKubernetesAWS (EC2/S3/Lambda)Google CloudCloudflareCI/CD (GitHub Actions)Terraform

Architectural Patterns

Distributed SystemsEvent-DrivenCQRSEvent SourcingMicroservicesOffline-FirstReal-time Sync

Leadership

Technical StrategySystem DesignMentorshipCode ReviewsDocumentationArchitectural Decisions

Domain Expertise

Informal Lending Systems

Built production platforms for Kenyan micro-lenders (SACCOs, table banking, ROSCAs). Features include:

  • Double-entry accounting with full audit trails
  • Automated loan disbursement and repayment tracking
  • Member management with group guarantor structures
  • Regulatory reporting for SASRA compliance

Loan TrackingFinancial ReportingTrial BalanceBalance SheetSASRAIncome StatementCash FlowsLiability ReportAI In FinanceSACCOTable BankingROSCAMoneypoolSavingBorrowingDouble Entry

Bulk SMS Gateway

Programmed Android phones as low-cost bulk SMS and mobile money payment gateway infrastructure.

Replaced paid APIs with physical devices and saved a lot of time and money:

  • Java service layer for SMS sending/receiving
  • USB/ADB integration with Windows/Odoo
  • Wireless backend integration (online version)
  • Bulk scheduling with delivery confirmation
  • Works with all Kenyan networks (Safaricom, Airtel, Telkom)
  • 94% cost reduction (1,000 personalized SMS at KES 30 on Safaricom network instead of KES 500 premium SMS cost)

Bulk SMSMoMoSMS GatewaySafaricomAirtelTelkomAndroidWindowsOdooPayment Gateway

School Systems

ExamWorker platform served 46 secondary schools across Kenya before curriculum change. Built for schools with limited IT resources:

  • All 32 examinable KNEC subjects
  • 45 scales for fair and balanced grading
  • Process multiple exams together for better analysis
  • Automated PDF reports generation
  • Free result SMS delivery to parents (via Android gateway)
  • Teacher appraisal and performance tracking
  • County-level analytics for education officers
  • Process any exam including joint mocks & KCSE

46 Schools15,000+ StudentsTeacher AppraisalExam AnalyticsStudent Progress ReportKNECKCSESMS ReportPDF Generation

Offline-First Architecture

Designed for environments with 2G connectivity and power interruptions:

  • IndexedDB with sync queues and conflict resolution
  • Service worker caching for instant load times
  • CRDT-based reconciliation for multi-device sync
  • Fallback to SMS for critical transactions

Offline App2G NetworkCRDTService WorkerIndexedDBWeb

Featured Projects

Saccobot

Android

2023 – Present

  • Full double-entry accounting engine (GAAP/IFRS compliant)
  • Android app with offline transaction recording
  • Java service layer for SMS sending/receiving
  • Financial AI analyst for tailor-made business advise
  • PostgreSQL with materialized views for real-time reporting
  • Edge API Gateway as supporting infrastructure
  • JWT validation at edge for Saccobot API
  • Workers KV for session management
  • Geographic routing to reduce latency
JavaAndroid SDKSMS ManagerPostgreSQLCloudflare WorkersTypeScriptFirebaseSACCOROSCATable BankingSASRAGAAPIFRSAPIAI In Finance
View Sample Report →

examWorker

Windows

2020 – 2024

  • Electron wrapper for PWA with offline SQLite
  • Auto-update and native notifications
  • Bulk exam data entry and PDF generation
  • Uses Excel as exam score database
  • Android companion app for attendance register with SMS notifications
  • Automated KCSE/internal exam analysis with 45 grading scales
  • Send personalized individual result to parent as free multipart SMS
ElectronNode.jsAndroidPDF GenerationSQLiteHybridCordovaPWAExcel
View Sample Reports →

Saccobot API

Security Notice: The encryption tool below is for testing compatibility only. In production, never hardcode encryption keys. Use environment variables or a secure key management service. All code is MIT licensed.

AES-256-CBC Encryption Tool

Live DemoSHA-256Base64

Get more out of Saccobot by syncing with your own ERP. Every transaction is automatically copied to your server to be consumed as you wish. Use the tool below to generate server-compatible encrypted messages.

Test if your server can read messages from Saccobot. This tool uses the same SHA-256 key derivation with random 16-byte IV per message implemented in Saccobot.

OutputReady for Postman
Click generate to create encrypted message
How it works
  1. SHA-256: Key is hashed to create 256-bit AES key
  2. Random IV: 16-byte cryptographically secure random IV generated per message
  3. AES-256-CBC: Message encrypted with PKCS5Padding
  4. Combine: IV (first 16 bytes) + ciphertext concatenated
  5. Base64: Combined bytes encoded for transmission

Server extracts first 16 bytes as IV, decrypts remainder with same key.

Postman API Request

HTTPJSONREST
Postman RequestHTTP
1
2
3
4
5
6
7
8
9
POST /api/v1/sms/send HTTP/1.1 Host: api.your-server.com Content-Type: application/json Authorization: Bearer {your_api_key} { "phoneNumber": "+254714044466", "message": "{base64_encrypted_message}" }

Server Implementation

Node.jsPythonPHPJavaGo

Server code that receives encrypted SMS, decrypts with matching key, and logs transactions. All implementations use the same encryption standard (AES-256-CBC with SHA-256 key).

server.jsNode.js + Express
const express = require('express'); const crypto = require('crypto'); const app = express(); app.use(express.json()); // WARNING: Hardcoded encryption key - should be moved to environment variables in production const ENCRYPTION_KEY = 'saccobot-encryption-key'; /** * POST /api/v1/sms/send * Accepts encrypted SMS data, decrypts it, and logs the result * Request body: { phoneNumber: string, message: string (encrypted) } */ app.post('/api/v1/sms/send', (req, res) => { try { const { phoneNumber, message } = req.body; if (!message) { return res.status(400).json({ status: 'error', message: 'No message provided' }); } // Decrypt the incoming message const decryptedMessage = decrypt(message); const timestamp = new Date().toISOString(); // Create structured log entry const logEntry = { phoneNumber, message: decryptedMessage, timestamp }; // Log to console (in production, this would go to a file or database) console.log('Received:', logEntry); res.json({ status: 'success', message: 'Data logged' }); } catch (error) { console.error('Decryption error:', error); res.status(400).json({ status: 'error', message: 'Decryption failed' }); } }); /** * Decrypts AES-256-CBC encrypted data * @param {string} encryptedData - Base64 encoded string containing IV (first 16 bytes) + ciphertext * @returns {string} Decrypted plaintext */ function decrypt(encryptedData) { // Decode from base64 const combined = Buffer.from(encryptedData, 'base64'); // Extract IV (first 16 bytes) and ciphertext const iv = combined.slice(0, 16); const encrypted = combined.slice(16); // Generate AES-256 key by hashing the encryption key const key = crypto.createHash('sha256').update(ENCRYPTION_KEY).digest(); // Create and use decipher const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv); let decrypted = decipher.update(encrypted); decrypted = Buffer.concat([decrypted, decipher.final()]); return decrypted.toString('utf8'); } // Start server on port 3000 app.listen(3000);

Technical Leadership

SMS Gateway Innovation

Built hardware-integrated SMS module for Odoo 16 using Android phones as physical gateways, eliminating third-party messaging costs.

Real-Time Infrastructure

Architected real-time sync using Firebase & Supabase for live financial data across branches in low-connectivity regions.

Offline-First Architecture

Designed offline-capable PWAs with IndexedDB conflict resolution, ensuring functionality even without internet connectivity.

Financial Reporting Suite

Comprehensive PDF reporting: Cash Flow, Income Statement, Balance Sheet, Trial Balance and Liability Report with GAAP/IFRS compliance.

Compliance Systems

Built double-entry accounting engine for regulated financial institutions with full audit trails and transaction integrity.

System Evolution

Led architectural migration from JavaScript to Java while maintaining production uptime and data integrity.

Publications

Android as SMS Infrastructure

5 years field research · Unpublished

How to achieve 99.2% SMS delivery reliability using cheap Android phones. Topics: USB debugging persistence, power management, SIM card handling, and message queuing strategies for high-volume financial notifications.

Coming Q3 2026

Offline-First Financial Systems

3 years field research · Unpublished

Design patterns for financial data integrity when users are offline for weeks. Topics: conflict resolution strategies, audit trails in disconnected environments, and hybrid sync protocols for low-bandwidth scenarios.

Coming Q4 2026

GAAP for Informal Lenders

3 years research · Unpublished

Simplifying double-entry accounting for SACCOs and table banking groups. How to maintain IFRS compliance while making interfaces accessible to users with limited formal accounting training.

Draft Complete

EdTech in Low-Resource Schools

5 years field research · Unpublished

Lessons from deploying examWorker across 46 Kenyan schools. Topics: teacher adoption patterns, solar-powered computer labs, and transitioning between curriculum systems (8-4-4 to CBE).

Case Study Available

Education & Background

Moi University

Bachelor of Science, Communication & Journalism (2009–2010)

Left university in 2010 to pursue full-time software development. Self-taught through real-world product shipping, sustained system maintenance, and enterprise-grade architectural problem-solving. 10 years of production experience is my credential.

What Clients Say

"Ken built our lending platform using Android phones as bulk SMS servers and mobile money payment gateways. We now have absolute control of our IT infrastructure and peace of mind. The system handles 2,000+ transactions daily with no issues."

Michael Mwangi

CEO, SaccoTech Kenya

"examWorker transformed my school. Teachers could work offline for weeks, then sync when academic office is ready to process and officially release results. You could mark attendance and a parent would instantly know their child is not in class."

Rael Simiyu

Teacher, Kimaeti Sub County

"When we needed to scale our API to handle 2 million requests monthly, Ken proposed Cloudflare Workers. The migration was seamless, latency dropped by 75%, and our infrastructure costs actually decreased. That's the kind of principal engineer you want."

Sarah Akinyi

CTO, FinServe Africa

"We needed to add secure SMS notifications to our in-house ERP. Ken's AES-256 encryption implementation across Android as SMS gateway and our Node.js server was flawless. The documentation with working code examples saved us weeks of debugging."

David Mwenda

CEO, Sendy Logistics