Loading repository data…
Loading repository data…
mwakidenis / repository
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.
"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.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Customer │ │ Admin │ │ MikroTik │
│ Portal │ │ Dashboard │ │ Router │
│ (React) │ │ (React) │ │ (API) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
│
┌─────────────────┐
│ Backend API │
│ (Node.js) │
└─────────────────┘
│
┌─────────────────┐
│ PostgreSQL │
│ Database │
└─────────────────┘
git clone <repository-url>
cd wifi-billing-system
cd backend
npm install
cp .env.example .env
# Edit .env with your configuration
npm run db:generate
npm run db:push
npm run db:seed
npm run dev
cd frontend
npm install
npm run dev
The admin dashboard is fully responsive and optimized for:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/collospot_db"
# JWT
JWT_SECRET="your-super-secret-jwt-key-here"
# M-Pesa Daraja API
MPESA_CONSUMER_KEY="your-mpesa-consumer-key"
MPESA_CONSUMER_SECRET="your-mpesa-consumer-secret"
MPESA_SHORTCODE="174379"
MPESA_PASSKEY="your-mpesa-passkey"
MPESA_CALLBACK_URL="https://yourdomain.com/api/payments/mpesa/callback"
# MikroTik Router
MIKROTIK_HOST="192.168.1.1"
MIKROTIK_USERNAME="admin"
MIKROTIK_PASSWORD="your-router-password"
# SMS (Africa's Talking)
AFRICASTALKING_USERNAME="sandbox"
AFRICASTALKING_API_KEY="your-africastalking-api-key"
The system comes with pre-configured plans:
| Plan | Duration | Price | Data Limit | Speed |
|---|---|---|---|---|
| Basic 1 Hour | 1 hour | KES 20 | 500MB | 5Mbps |
| Standard 6 Hours | 6 hours | KES 100 | 2GB | 10Mbps |
| Premium 24 Hours | 24 hours | KES 300 | 10GB | 20Mbps |
| Weekly Package | 7 days | KES 1,500 | 50GB | 25Mbps |
| Monthly Unlimited | 30 days | KES 5,000 | Unlimited | 50Mbps |
GET /api/public/plans - Get available plansPOST /api/public/register - Register new userPOST /api/public/login - User loginPOST /api/public/payment - Initiate M-Pesa paymentGET /api/public/payment/status/:id - Check payment statusPOST /api/public/connect - Connect to internetGET /api/admin/dashboard - Dashboard statisticsGET /api/admin/users - Get all usersGET /api/admin/plans - Manage plansGET /api/admin/sessions - Monitor sessionsGET /api/admin/payments - Payment historyThe system uses Prisma ORM with the following main models:
< 640px - Card layouts, stacked navigationsm: ≥ 640px - Improved spacing, inline elementslg: ≥ 1024px - Table views, sidebar navigationxl: ≥ 1280px - Multi-column layoutsbackend/prisma/schema.prismanpm run db:generate and npm run db:pushbackend/src/routes/frontend/src/# Build and run with Docker Compose
docker-compose up -d
npm run buildnpm startThe system is designed to support a mobile app using the same API:
M-Pesa payments failing
Router connection issues
Database connection errors
backend/logs/This project is licensed under the MIT License - see the LICENSE file for details.
For support or inquiries:
Made with ❤️ by Mwaki Denis