A full-stack hostel internet and TV subscription management platform built with Next.js 14. Residents can purchase data plans and activate TV subscriptions, while administrators manage hostels, billing splits, transactions, and subscriber accounts through a dedicated admin panel.
- Framework: Next.js 14 (App Router, TypeScript)
- Styling: Tailwind CSS
- Database: Firebase Firestore
- Auth: Firebase Authentication
- Payments: Paystack
- Email: Nodemailer (SMTP)
- Deployment: Vercel
- Browse and purchase data plans by hostel
- Paystack-powered payment checkout
- TV subscription activation and renewal
- Account login / forgot password
- Dashboard — live subscriber counts and revenue overview
- Hostels — create and manage hostels; assign plan types (daily, weekly, monthly, etc.)
- Data Codes — generate, delete, and track one-time data voucher codes
- Purchase Logs — searchable history of all data plan purchases; filterable by hostel, plan, and date
- Transactions — full transaction ledger with payment-split calculator; configurable maintenance percentage; admin and partner email fields for monthly reports
- TV Users — view, filter, and manage TV subscribers by hostel and status (Pending / Active / Expired); manual plan-update tool
- Protected routes — session-based admin authentication
app/
api/ # Next.js API routes (data plans, TV, admin, hostels)
admin/ # Admin pages (dashboard, hostels, tv-users, transactions, …)
dashboard/ # Resident dashboard
login/ # Resident auth
components/ # Shared UI (Logo, Toast, ConfirmationModal, ProtectedRoute)
lib/
firebase.ts # Firebase initialisation (reads from env)
email/ # Email service and templates
store/ # Zustand auth store
types/ # Shared TypeScript interfaces
git clone <repo-url>
cd lodge-internet
npm installCreate a .env.local file in the project root:
# Firebase
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
# Paystack
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY=
PAYSTACK_SECRET_KEY=
# Admin
ADMIN_PASSWORD_HASH= # bcrypt hash of the admin password
ADMIN_SESSION_SECRET= # random secret for session signing
# Email (SMTP)
EMAIL_HOST=
EMAIL_PORT=
EMAIL_USER=
EMAIL_PASS=
EMAIL_FROM=.env.local is never committed — it is listed in .gitignore.
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm startThis project uses Firestore as its primary database. Firebase configuration files (firebase.json, firestore.rules, firestore.indexes.json, .firebaserc) are excluded from version control via .gitignore. To set up your own Firebase project:
- Create a project at console.firebase.google.com
- Enable Firestore and Authentication (Email/Password)
- Copy your project credentials into
.env.local - Deploy Firestore security rules and indexes using the Firebase CLI:
npm install -g firebase-tools
firebase login
firebase init firestore
firebase deploy --only firestoreThe project is configured for Vercel deployment (vercel.json is included). Set all environment variables in your Vercel project settings before deploying.
vercel --prod| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Create production build |
npm start |
Start production server |
npm run lint |
Run ESLint |