Wi-Fi Connect Interface is a full-stack, adaptable captive portal solution for public Wi-Fi access. It features a modern Flutter web app, a Firebase backend, and integrated online payment (FedaPay) to provide a seamless, secure, and professional experience for both users and network owners.
- Captive Portal: Users are redirected to a branded login/payment page when connecting to Wi-Fi.
- Firebase Hosting: Host your Flutter web app and backend APIs securely and scalably on Firebase Hosting and Functions.
- Online Payment Integration: Supports FedaPay for secure, instant payments (can be adapted for other providers).
- Voucher & Account Login: Users can log in with purchased vouchers or pre-created accounts.
- Dynamic Receipts: Generates branded PDF receipts with all user and transaction details.
- Unlimited & Limited Vouchers: Supports both time-limited and unlimited access codes.
- Router Integration: Grants Wi-Fi access via router MAC filtering (Huawei, MikroTik, or compatible) using environment-based credentials.
- Admin Tools: Generate unlimited voucher codes and manage access securely.
- User connects to Wi-Fi and is redirected to the portal (see Captive Portal Adaptation below).
- User selects a plan and pays online (FedaPay), or enters a voucher/account.
- Backend validates payment or code and grants access on the router (via MAC filtering or API).
- User receives a receipt and is allowed online.
- Frontend: Flutter Web (hosted on Firebase Hosting)
- Backend: Firebase Functions (Node.js), Firestore
- Payments: FedaPay (can be replaced with other providers)
- Router: Huawei, MikroTik, or any router supporting MAC filtering/API
This is a Flutter-based project. The backend (Firebase Functions) is not included in this repository. You must create your own Firebase project and backend functions for production use.
To clone and start the frontend:
git clone https://github.com/soyames/wifi-connect-interface.git
cd wifi-connect-interface
flutter pub get
# To run the Flutter web app locally:
flutter run -d chrome
# To deploy the frontend:
firebase deploy --only hostingSee the Setup & Configuration section for environment variables and Firebase config. You must implement your own backend logic and deploy your own Firebase Functions (see documentation for guidance).
- Flutter SDK
- Node.js & npm (for backend, not included)
- Firebase CLI
Create a .env file in the functions directory with:
ROUTER_IP=your_router_ip
ROUTER_USERNAME=your_router_username
ROUTER_PASSWORD=your_router_password
ADMIN_SECRET=your_admin_secret
FEDAPAY_SECRET_KEY=your_fedapay_secret
FEDAPAY_PUBLIC_KEY=your_fedapay_public
Set secrets with:
firebase functions:config:set admin.secret="your_admin_secret"
firebase functions:config:set fedapay.secret_key="your_fedapay_secret"
firebase functions:config:set fedapay.public_key="your_fedapay_public"
firebase deploy --only functions
firebase deploy --only hosting
- User Portal: Access via Wi-Fi captive portal or directly at the deployed Firebase Hosting URL.
- Admin Voucher Generation:
- POST to
/generateUnlimitedAccesswith headerx-admin-secretand JSON body:{ "count": 10, "prefix": "WIFI", "length": 8 }
- POST to
The backend grants access by calling your router’s API (MAC filtering or similar). You can adapt the router logic in functions/index.js for your hardware:
- Huawei Routers: Use the provided endpoints for MAC filtering (see code comments for details).
- MikroTik Routers: Use the default logic or adapt as needed.
- Other Routers: Adapt the backend to call the appropriate API or use SSH/Telnet as supported.
Captive Portal Setup:
- If your router supports captive portal/redirect, set the portal URL to your Firebase Hosting URL.
- If not, use a dedicated access point or firewall with captive portal support (see project documentation for tips).
lib/— Main Flutter app source code (UI, screens, services, models)screens/— All user interface screens (login, portal, etc.)models/— Dart data models (e.g., plan, payment response)services/— API and business logic services (e.g., API calls)
web/— Web entrypoint and static assets for Flutter webpublic/— Static files for Firebase Hosting (if used).env— Example environment variables for backend (not included).gitignore— Files and folders excluded from version controlREADME.md— Project documentation and setup instructionspubspec.yaml— Flutter/Dart project configuration and dependencies
Note: The backend (
functions/) is not included. You must implement your own backend logic and deploy your own Firebase Functions for production use.
Pull requests and suggestions are welcome! Please open an issue for major changes.
Created and maintained by Yao Amevi A. Sossou
If you use or adapt this code, please mention the author and link to github.com/soyames.
This project is for educational and commercial Wi-Fi hotspot use. See LICENSE file for details.