Skip to content

Implement roommate management application with expense splitting and auto-task assignment - #1

Draft
mohdrazakhan with Copilot wants to merge 8 commits into
mainfrom
copilot/add-roommate-management-features
Draft

Implement roommate management application with expense splitting and auto-task assignment#1
mohdrazakhan with Copilot wants to merge 8 commits into
mainfrom
copilot/add-roommate-management-features

Conversation

Copilot AI commented Dec 31, 2025

Copy link
Copy Markdown

Built a full-stack web application for managing shared living expenses and household tasks with automatic fair distribution among roommates.

Core Implementation

Expense Management

  • Equal and custom percentage-based splitting with optimized settlement algorithm (minimizes transaction count)
  • Real-time balance calculations across all expenses
  • Per-user settlement tracking

Task Auto-Assignment

  • Fair rotation algorithm with deterministic tie-breaking via assignment history
  • Recurring tasks (daily/weekly/monthly) with automatic reassignment on completion
  • Edge case handling for month-end date calculations

Example: Settlement Algorithm

// Calculates minimum transactions to settle all debts
function calculateBalances(expenses, members) {
  const balances = {};
  
  expenses.forEach(expense => {
    balances[expense.paidBy] += expense.amount;
    expense.splitBetween.forEach(split => {
      if (!split.settled) balances[split.user] -= split.amount;
    });
  });
  
  // Greedy matching of debtors to creditors
  const settlements = [];
  // ... returns optimized settlement plan
}

Technical Stack

Backend (Node.js/Express/MongoDB)

  • JWT authentication with bcrypt (12 rounds)
  • Three-tier rate limiting: auth (5/15min), create (30/15min), general (100/15min)
  • Mongoose models: User, Room, Expense, Task

Frontend (React 18)

  • Single-page application with React Router v6
  • Responsive design with mobile-first approach
  • Tabbed room interface (Overview, Expenses, Tasks, Members)

Security

  • 0 CodeQL vulnerabilities
  • Environment validation (fails on production startup if JWT_SECRET unset)
  • Rate limiting applied before authentication middleware
  • Protected routes with bearer token auth

API Surface

POST   /api/users/register, /api/users/login
GET    /api/rooms, /api/expenses/room/:id/balances, /api/tasks/my-tasks
POST   /api/rooms, /api/expenses, /api/tasks
PUT    /api/expenses/:id/settle/:userId, /api/tasks/:id/status
DELETE /api/expenses/:id, /api/tasks/:id

Multi-room support via 8-character invite codes. Room admins can manage members; all members can add expenses/tasks.

Original prompt

this is website of my application that is roommate management application that help in split and manage expanse between roommates & help in auto assign daily tasks between all members also give more attractive and helpfull feature that make roommates life ease


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 7 commits December 31, 2025 21:16
…d auto-task assignment

Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
…logic

Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Co-authored-by: mohdrazakhan <115514669+mohdrazakhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add roommate management features for expense splitting and tasks Implement roommate management application with expense splitting and auto-task assignment Dec 31, 2025
Copilot AI requested a review from mohdrazakhan December 31, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants