← work

04 - Case Study

Parky

94% parking detection accuracy - M-Pesa payments at the end

Parky
Timeline2023
RoleFull-Stack Engineer
StackReact Native, Flask, TensorFlow, PostgreSQL, M-Pesa API
StatusIn development

The Problem

Parking in Nairobi is a manual process - you drive until you find a space. No system surfaced real-time availability before you arrived, and payment required cash or a physical attendant. The gap between what computer vision could do and what actually existed on the ground was wide open.

What I Built

Trained a TensorFlow model to detect occupied vs empty spaces from a live camera feed. Built a Flask backend serving inference results in real time, connected to a React Native app where users see available spaces on a map and pay via M-Pesa STK push before arriving.

01 - Computer Vision

Trained a TensorFlow model on a labelled parking lot dataset - the hard part was inconsistent lighting and camera angle variation. Deployed the inference server in Flask on a Raspberry Pi connected to a camera feed.

02 - Backend + Data Pipeline

Flask API stores space state history in Postgres and serves availability to the mobile app via polling. WebSockets were out of scope for the hardware budget - polling at 2s intervals was good enough for the use case.

03 - Mobile App

React Native app shows a live map of available spaces. Users select a space, reserve it, and trigger an M-Pesa STK push - the payment confirmation message from Safaricom unlocks the reservation in the backend.

04 - Operator Dashboard

Separate React web dashboard for parking lot operators: live occupancy view, revenue per session, and entry/exit logs. Built to show the system could serve both sides of the market - users and operators.

What Happened

01

94% accuracy on live parking space detection using TensorFlow + OpenCV

02

M-Pesa STK push payment flow working end-to-end in the demo environment

03

Full ML-to-transaction pipeline: camera → inference → reservation → payment → confirmation

04

Graded distinction as JKUAT final year project

In the Wild

In Hindsight

Polling worked fine in the demo but would break down quickly in production with concurrent users. WebSockets or server-sent events are the right answer for real-time space state - the polling approach was a pragmatic shortcut given the hardware constraints.