House rent management app for tenant and owners. Runs on web, android, iOS, etc.
It supports admin and tenant workflows for:
- property management
- tenant management
- monthly billing and payment tracking
- complaints
- web push notifications
- Next.js (App Router)
- TypeScript
- Firebase (Firestore, Auth, FCM)
- Tailwind CSS
- Vercel (deployment and cron)
- Admin dashboard for properties, tenants, complaints, notifications, and settings
- Tenant dashboard for payment status, history, and account info
- Billing ledger tracking per property
- Meter-based unit consumption calculation
- Web push notifications (FCM)
- Month-end and month-start reminder automation using Vercel cron
Key directories:
app/- pages, API routes, UI components, and hookslib/- reusable server/client utilitiesscripts/- migration and seed scriptstypes/- shared TypeScript typespublic/- static assets and service worker
- Node.js 20+ (or Bun)
- Firebase project (Firestore + FCM enabled)
- Service account credentials for server-side Firebase Admin actions
- Install dependencies:
npm install- Copy environment template and fill values:
cp .env.example .env.local- Start development server:
npm run dev- Open:
http://localhost:3000
Use .env.example as your source of truth. Important variables include:
NEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_STORAGE_BUCKETNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_IDNEXT_PUBLIC_FIREBASE_APP_IDNEXT_PUBLIC_FIREBASE_VAPID_KEYFIREBASE_SERVICE_ACCOUNT_JSONorFIREBASE_SERVICE_ACCOUNT_PATHADMIN_API_SECRETNOTIFICATION_INTERNAL_API_KEY(optional)CRON_SECRETBLOB_READ_WRITE_TOKEN
npm run dev- Start local dev servernpm run build- Create production buildnpm run start- Run production build locallynpm run lint- Run ESLintnpm run migrate- Migrate Firestore datanpm run migrate:fresh- Fresh migration flownpm run seed:firestore- Seed Firestore with demo data
- In Firebase Console, open Cloud Messaging.
- Create a Web Push certificate and copy VAPID public key.
- Set
NEXT_PUBLIC_FIREBASE_VAPID_KEYin.env.local. - Sign in to the app and enable notifications from the UI.
Token sync writes fcmToken and device metadata to the user profile for easier device identification.
curl -X POST http://localhost:3000/api/notifications/send \
-H "Content-Type: application/json" \
-H "x-notification-key: YOUR_NOTIFICATION_INTERNAL_API_KEY" \
-d '{
"targetRole": "tenant",
"title": "Meter reading reminder",
"body": "Please check your updated electricity units.",
"data": { "click_action": "/tenant" }
}'- Ledger entries are created when admin updates meter readings for a property.
- Current meter reading and previous reading are used to calculate consumed units and electricity totals.
- Payment status is tracked in
billing_ledger.
Configured in vercel.json for /api/cron/monthly-reminders:
30 4 1-3 * *(first 3 days of month)30 4 25-31 * *(last week window, with in-route date checks)
The route sends:
- tenant reminders for pending rent
- admin reminders to enter meter readings where required
Set CRON_SECRET in Vercel and send it as Bearer token when invoking manually.
Recommended: Vercel.
- Import repo in Vercel.
- Add all required environment variables.
- Deploy.
- Verify cron jobs are active.
- Never commit real service account JSON files.
- Use environment variables for secrets.
- Rotate
ADMIN_API_SECRET,NOTIFICATION_INTERNAL_API_KEY, andCRON_SECRETregularly.
- Project Author: Mr. Anbuselvan Annamalai
License: MIT
- Create a feature branch.
- Make focused changes.
- Run lint and local checks.
- Open a pull request with clear description.
For setup and deployment issues, create an issue in this repository with:
- expected behavior
- actual behavior
- steps to reproduce
- environment details
