Skip to content

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.

Notifications You must be signed in to change notification settings

soyames/Wi-Fi_Connect_Interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wi-Fi Connect Interface

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.

Features

  • 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.

How It Works

  1. User connects to Wi-Fi and is redirected to the portal (see Captive Portal Adaptation below).
  2. User selects a plan and pays online (FedaPay), or enters a voucher/account.
  3. Backend validates payment or code and grants access on the router (via MAC filtering or API).
  4. User receives a receipt and is allowed online.

Tech Stack

  • 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

Getting Started

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 hosting

See 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).

Setup & Configuration

Prerequisites

  • Flutter SDK
  • Node.js & npm (for backend, not included)
  • Firebase CLI

Environment Variables

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

Firebase Functions Config (for cloud deploys)

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"

Deploy

firebase deploy --only functions
firebase deploy --only hosting

Usage

  • User Portal: Access via Wi-Fi captive portal or directly at the deployed Firebase Hosting URL.
  • Admin Voucher Generation:
    • POST to /generateUnlimitedAccess with header x-admin-secret and JSON body:
       { "count": 10, "prefix": "WIFI", "length": 8 }

Router Integration & Captive Portal Adaptation

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).

Project Structure

  • 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 web
  • public/ — Static files for Firebase Hosting (if used)
  • .env — Example environment variables for backend (not included)
  • .gitignore — Files and folders excluded from version control
  • README.md — Project documentation and setup instructions
  • pubspec.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.

Contributing

Pull requests and suggestions are welcome! Please open an issue for major changes.

Credits

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.

License

This project is for educational and commercial Wi-Fi hotspot use. See LICENSE file for details.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published