A small Firebase-powered web app for managing shared-house meals, deposits, bazaar costs, and monthly balances.
Pakhir Basar Meal Tracker keeps everyday mess accounting simple for a shared home. It helps everyone see who ate, how many meals were ordered, who deposited money, and what each person currently owes or has in balance.
Shared meal systems get messy fast when people do not eat every meal, meal boxes are split between multiple people, weekend meals cost more, or multiple admins enter data. This app gives the house one shared place to track meals and money without relying on manual spreadsheets or chat messages.
The original use case is a house where lunch and dinner boxes are delivered daily, usually at a fixed rate, but members share those boxes differently each day. Sometimes someone eats half, someone is unavailable, someone pays a deposit, and sometimes the month uses bazaar expenses instead of a fixed meal rate. The app was built to make those calculations visible and less error-prone.
- Google/Gmail login with Firebase Auth.
- Anyone can create a mess and become its first admin.
- Members can join a mess through one-time invite links.
- Multiple mess support with a mess switcher.
- Admin and member roles.
- Monthly cycles with selected members for each month.
- Static meal rate months for simple fixed-rate tracking.
- Calculated meal rate months for bazaar/expense-based tracking.
- One daily meal sheet per date with lunch and dinner.
- Per-session meal entry with ordered meal count, rate, portions, and skip meal support.
- Temporary remove member from lunch or dinner before using split evenly.
- Submitted-by tracking so multiple admins can see who last saved a meal sheet.
- Member dashboard cards for personal meal count and balance.
- Shared member summary table with meals, deposits, costs, and balance.
- Meal calendar with date details modal.
- Deposits for mess cash fund tracking.
- Bazaar/expense tracking for calculated months.
- Admin member management, role changes, activation, and deletion safeguards.
- Month close flow with confirmation phrase.
- PWA support for Android and iOS home screen install.
- Offline read-only mode with last cached data.
- Sign in with Google.
- Create a new mess, or join one using a one-time invite link.
- If you created the mess, you become the first admin.
- Add members or create invite links from the People area.
- Create a new month and choose:
Staticif every meal uses a fixed meal rate.Calculatedif bazaar/expenses should decide the running meal rate.
- Select which members should count for that month.
- Add daily meals from the Meal page.
- Use Lunch and Dinner sections to set ordered meals, rate, and each member's portion.
- If someone is not eating that session, remove them temporarily with the cross button, then use split evenly.
- Add deposits when members put money into the mess fund.
- For calculated months, add bazaar expenses.
- Check Home for personal metrics, member summary, and meal calendar.
- Admins can close the month when the final balances are ready.
Install dependencies:
npm installCreate a local environment file:
cp .env.example .envFill in the Firebase web app values in .env:
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
VITE_FIREBASE_APP_ID=your-app-id
VITE_FIREBASE_MEASUREMENT_ID=your-ga4-measurement-id
VITE_ENABLE_ANALYTICS=true
VITE_USE_FIRESTORE_EMULATOR=falseStart the app:
npm run devVite will print a local URL, usually:
http://localhost:5173Local development is configured to use the Firestore Emulator through .env.development.local:
VITE_USE_FIRESTORE_EMULATOR=true
VITE_FIREBASE_FIRESTORE_EMULATOR_HOST=127.0.0.1
VITE_FIREBASE_FIRESTORE_EMULATOR_PORT=8080This file is ignored by git and only applies to npm run dev. Production builds still use the normal Firebase project from .env.
Start the local Firestore database in one terminal:
npm run emulatorsThen start the app in another terminal:
npm run devThe emulator UI runs at:
http://127.0.0.1:4000Google sign-in still uses Firebase Auth, but all Firestore reads/writes from localhost go to the local emulator while it is running.
Create a Firebase project and enable:
- Authentication
- Google sign-in provider
- Firestore Database
- Firebase Hosting, if deploying with Firebase
Then add a Firebase web app and copy its config values into .env.
Deploy Firestore rules:
firebase deploy --only firestore:rulesTo test with the local Firestore emulator, keep these values in .env.development.local:
VITE_USE_FIRESTORE_EMULATOR=true
VITE_FIREBASE_FIRESTORE_EMULATOR_HOST=127.0.0.1
VITE_FIREBASE_FIRESTORE_EMULATOR_PORT=8080Then run:
npm run emulatorsKeep VITE_USE_FIRESTORE_EMULATOR=false for production.
The app uses Firebase Analytics / GA4 when analytics is enabled and a Firebase measurement id is present.
Add these values to .env:
VITE_FIREBASE_MEASUREMENT_ID=your-ga4-measurement-id
VITE_ENABLE_ANALYTICS=trueTo disable analytics locally or in any environment:
VITE_ENABLE_ANALYTICS=falseTracked events include page views, sign in, mess creation/joining, invite creation, month creation/closing, meal sheet actions, deposits, expenses, member management, offline/read-only mode, service worker registration, and PWA install events. The app does not send Gmail addresses or meal/member names to Analytics.
Create a production build:
npm run buildPreview the production build locally:
npm run previewBuild first:
npm run buildDeploy to Firebase Hosting:
firebase deployRun unit tests:
npm testRun tests in watch mode:
npm run test:watchmesses: mess/workspace records.members: users scoped to a mess, with role and active status.invites: one-time invite links for joining a mess.cycles: monthly open/closed cycles and closing snapshots.dailyMeals: one date-level meal sheet with lunch and dinner data.expenses: bazaar or other mess-fund costs for calculated months.deposits: member deposits into the shared mess fund.
- Offline mode is read-only by design.
- Offline editing and pending sync queues are intentionally not implemented.
- Email notifications are not included yet.
- The app currently focuses on one mess at a time, but one user can belong to multiple messes and switch between them.