Hysen Labs
Open-source project
mwakidenis/miktrotik-hotspot-billing avatar
mwakidenis

miktrotik-hotspot-billing

Connect. Pay. Browse — Seamlessly. This is a comprehensive WiFi billing system designed specifically for Kenya, featuring M-Pesa integration, MikroTik router control, and a modern web-based admin dashboard.

36 stars5 forksTypeScriptLicense varies
DEEP OPEN-SOURCE ANALYSIS

Mikrotik hotspot billing: a WiFi billing system for Kenya

A TypeScript based captive portal and admin platform that combines M-Pesa payments with MikroTik router control.

What the system does

Mikrotik hotspot billing, presented in the README as DenisTec Smart WiFi Billing System, is a comprehensive WiFi billing platform built for the Kenyan market. The problem it solves is concrete: a venue or provider wants to let customers connect, pay, and browse without manual intervention. The system ties three pieces together. M-Pesa integration through the Daraja API handles payments with STK push and Paybill, MikroTik router control manages bandwidth and access at the network level, and a web based admin dashboard gives operators a view of usage and revenue. The README notes the slogan Connect, Pay, Browse, and the whole flow is meant to be automatic after a payment succeeds. Because it targets Kenya, the payment rail is local and the interface supports both English and Swahili. The system is described as cloud ready with Docker support, which lets a provider run it on a small VPS or on premises, and SMS alerts extend notifications beyond the web interface through Africa's Talking. The multi language support matters in a market where a customer may prefer Swahili at the captive portal, while the operator may work in English on the admin side. The multi language support matters in a market where a customer may prefer Swahili at the captive portal, while the operator may work in English on the admin side of the same system.

Customer and admin features

On the customer side, the system presents a custom branded captive portal with a mobile first design. A user picks from multiple plan types, including time based, data based, and subscription packages, then pays through M-Pesa and gets automatic internet access once the transaction clears. Real time status shows connection state and usage. On the admin side, a dashboard displays live analytics and system monitoring, user management tracks accounts and activity, and plan management creates the internet packages on offer. Session control lets an operator monitor and terminate active connections, and payment tracking keeps a complete history. Router integration uses the MikroTik API for bandwidth and access control, so the same place that shows money also shows the network state. SMS alerts through Africa's Talking add another channel for notifications. The README also lists the public customer API endpoints for plans, registration, login, payment, payment status, and connect, plus admin endpoints for dashboard, users, plans, sessions, and payments, which makes the system scriptable. The responsive admin layout adapts from phone sized cards to full desktop tables, so an operator can watch the network from a phone. The responsive admin layout adapts from phone sized cards to full desktop tables, so an operator can watch the network from a phone as easily as from a workstation during a busy period.

Tech stack and setup

The technical foundation is a modern web stack: React 18 with TypeScript on the front end, Node.js on the back end, and PostgreSQL as the database, with Prisma as the ORM. Security measures include JWT authentication, HTTPS enforcement, and rate limiting, and the schema covers User, Plan, Session, Payment, and optional Voucher models. The README provides a Docker Compose command for a quick start, and a manual deploy path uses Nginx in front of the built front end and the Node backend. Preconfigured plans show the pricing model in Kenyan shillings: a one hour Basic plan at KES 20 with 500 MB, a six hour Standard at KES 100 with 2 GB, a twenty four hour Premium at KES 300 with 10 GB, a weekly package at KES 1,500, and a monthly unlimited plan at KES 5,000. The README also lists default admin credentials and a set of environment variables for the database, JWT secret, M-Pesa keys, MikroTik host, and SMS API. The repository does not declare a license file in the metadata provided. The Prisma schema keeps the payment and session models linked, so an operator can trace a paid plan to the active connection that it unlocked. The Prisma schema keeps the payment and session models linked, so an operator can trace a paid plan to the active connection it unlocked, and the Docker Compose path means the stack can run on premises.

Editorial conclusion

The system is built with React 18, TypeScript, Node.js, and PostgreSQL, and ships preconfigured plans such as a KES 20 one hour Basic tier and a KES 5,000 monthly unlimited tier.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes