The backend API for MessMasterApp, an Android application designed to help bachelors manage shared meal systems. Built with NestJS and PostgreSQL, it handles meal tracking, shared expenses, utility costs, and mess-wide communication.
- Framework: NestJS (Node.js)
- Language: TypeScript
- Database: PostgreSQL with TypeORM
- Auth: JWT (Access + Refresh tokens) with Passport
- Other: bcrypt, nodemailer, cookie-parser
When a user logs in, the following logic applies:
- Membership Check: The system verifies if the user is already part of a mess.
- New Users: If not a member, the user can either Create a Mess or Join a Mess.
- Creating a Mess: The user provides mess details and is automatically assigned the role of Manager.
- Joining a Mess: The user enters a
mess_idto join an existing mess as a Member.
| Feature | Manager 👑 | Member 👤 |
|---|---|---|
| Insert/Update Meals | ✅ | ❌ |
| Manage Meal Expenses | ✅ | ❌ |
| Manage Utility Costs | ✅ | ❌ |
| Post Announcements | ✅ | ❌ |
| Post Shopping Requests | ✅ | ✅ |
| View Mess Notices | ✅ | ✅ |
| Change Mess Password | ✅ | ❌ |
| View Member Dashboard | ✅ | ✅ |
- Users & Members: Links individual profiles to mess groups with role assignments.
- Meals & Expenses: Tracks daily meal counts and individual dietary spending.
- Utility Costs: Covers rent, internet, electricity, maid, and gas.
- Notices: Communication hub for announcements and shopping requests.
src/
├── auth/ # JWT authentication & refresh token logic
├── mess/ # Mess creation, joining, and management
├── meals/ # Daily meal tracking
├── meal-expenses/ # Individual meal expense management
├── utility/ # Shared utility cost tracking
├── notices/ # Announcements and shopping requests
├── entities/ # TypeORM database entities
├── dtos/ # Data transfer objects & validation
└── shared/ # Shared utilities and guards
- Node.js v18+
- PostgreSQL
npm installCopy .env.example to .env and fill in your values:
cp .env.example .env# Development
npm run start:dev
# Production
npm run build
npm run start:prodnpm run test- Android App: MessMasterApp