Skip to content

Repository files navigation

MessMasterApp — Backend

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.

Tech Stack

  • Framework: NestJS (Node.js)
  • Language: TypeScript
  • Database: PostgreSQL with TypeORM
  • Auth: JWT (Access + Refresh tokens) with Passport
  • Other: bcrypt, nodemailer, cookie-parser

Workflow: Onboarding & Logic

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_id to join an existing mess as a Member.

User Roles & Permissions

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

Database Architecture

ER Diagram

ER Diagram

Key Entities

  • 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.

Project Structure

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

Getting Started

Prerequisites

  • Node.js v18+
  • PostgreSQL

Installation

npm install

Environment Setup

Copy .env.example to .env and fill in your values:

cp .env.example .env

Running the App

# Development
npm run start:dev

# Production
npm run build
npm run start:prod

Running Tests

npm run test

Related

About

Backend API for MessMaster — a digital platform that helps Bangladesh mess managers and members track meals, balances and bazar costs in one dashboard.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages