A comprehensive Virtual Top-Up (VTU) platform for purchasing airtime, data bundles, cable TV subscriptions, electricity tokens, and recharge pins.
- π Authentication - Secure user registration and login with Supabase
- π° Wallet System - Manage your wallet balance and transactions
- π± Airtime Purchase - Buy airtime for all Nigerian networks
- πΆ Data Bundles - Purchase data plans from MTN, Airtel, Glo, and 9mobile
- πΊ Cable TV - Subscribe to DSTV, GOTV, and Startimes
- β‘ Electricity - Buy prepaid and postpaid electricity tokens
- π« Recharge Pins - Generate recharge pins for printing
- π Transaction History - Track all your transactions
- Framework: Next.js 16 with App Router
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Styling: Tailwind CSS v4
- UI Components: shadcn/ui
- API Integration: GSUBZ API (with Mozosubz branding)
Create a .env.local file with the following variables:
```env
GSUBZ_API_KEY=your_gsubz_api_key
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key NEXT_PUBLIC_DEV_SUPABASE_REDIRECT_URL=http://localhost:3000 ```
-
Install dependencies: ```bash npm install ```
-
Set up Supabase:
- Run the SQL script in
scripts/001_create_profiles_and_wallets.sqlin your Supabase SQL editor - This creates the necessary tables and triggers
- Run the SQL script in
-
Configure environment variables:
- Add your GSUBZ API key from GSUBZ Dashboard
- Add your Supabase credentials
-
Run the development server: ```bash npm run dev ```
-
Open your browser: Navigate to http://localhost:3000
- GET
https://api.gsubz.com/api/plans?service={serviceID} - Services:
mtn_sme,mtn_datashare,mtn_gifting,airtel_gifting,airtel_sme,glo_data,glo_sme,etisalat_data
- POST
https://gsubz.com/api/pay/ - Body:
serviceID,plan,api,amount(empty),phone,requestID(optional)
- POST
https://gsubz.com/api/pay/ - Body:
serviceID(mtn, airtel, glo, etisalat),api,amount,phone
- GET
https://api.gsubz.com/api/plans?service={service} - Services:
gotv,dstv,startimes
- POST
https://gsubz.com/api/pay/ - Body:
serviceID,api,plan,phone,amount(empty),customerID
- POST
https://gsubz.com/api/pay/ - Body:
serviceID,api,phone,amount,customerID,variation_code(prepaid/postpaid) - Services:
abuja-electric,eko-electric,ibadan-electric,ikeja-electric,jos-electic,kaduna-electric,kano-electric,portharcourt-electric,aba-electric,yola-electric,benin-electric,enugu-electric
- POST
https://gsubz.com/apiV2/generate/ - Body:
network(mtn, airtel, glo, 9mobile),value(100, 200, 400, 500),number(quantity)
- POST
https://gsubz.com/api/balance/ - Body:
api
- POST
https://gsubz.com/api/verify/ - Body:
api,requestID
200- TRANSACTION_SUCCESSFUL204- REQUIRED_CONTENT_NOT_SENT206- INVALID_CONTENT401- INVALID_PLAN402- INSUFFICIENT_BALANCE404- CONTENT_NOT_FOUND405- REQUEST_METHOD_NOT_IN_POST406- SERVICE_DISABLED502- GATEWAY_ERROR
id(uuid, primary key)email(text)full_name(text)created_at(timestamp)updated_at(timestamp)
id(uuid, primary key)user_id(uuid, foreign key)balance(numeric)created_at(timestamp)updated_at(timestamp)
id(uuid, primary key)user_id(uuid, foreign key)reference(text)amount(numeric)service_type(text)description(text)status(text: pending, completed, failed)api_response(jsonb)created_at(timestamp)
``` βββ app/ β βββ dashboard/ # Dashboard pages β β βββ data/ # Data purchase page β β βββ airtime/ # Airtime purchase page β β βββ cable/ # Cable TV subscription page β β βββ electricity/ # Electricity payment page β β βββ recharge-pins/ # Recharge pins generation page β β βββ transactions/ # Transaction history β βββ login/ # Login page β βββ register/ # Registration page β βββ forgot-password/ # Password reset page βββ lib/ β βββ api/ β β βββ gsubz.ts # GSUBZ API client β βββ actions/ # Server actions β β βββ data.ts β β βββ airtime.ts β β βββ cable.ts β β βββ electricity.ts β β βββ recharge-pins.ts β β βββ wallet.ts β βββ supabase/ # Supabase client utilities β βββ client.ts β βββ server.ts β βββ middleware.ts βββ components/ # Reusable UI components βββ proxy.ts # Next.js 16 request middleware (replaces middleware.ts) βββ scripts/ # Database migration scripts ```
MIT