UtangPH now supports multiple groups with password protection. Each group maintains its own separate set of members and expenses, providing a decentralized data structure where groups are independent of each other.
- Multiple Groups: Create and manage multiple expense tracking groups
- Password Protected: Each group requires a password to access
- Isolated Data: Each group has its own members and expenses
- Group Selection UI: Initial landing page shows all available groups
- Easy Switching: Switch between groups without losing data
First, install the new dependency (bcryptjs) for password hashing:
cd backend
npm installIf you have existing data, run the migration script to associate it with the EOG CONDO group:
npm run migrate:groupsThis will:
- Create the "EOG CONDO" group with password "password"
- Associate all existing members and expenses with this group
- Display a summary of the migration
Note: If you're starting fresh with no existing data, you can skip the migration and just run the seed script.
If you don't have existing data or want to manually create the EOG CONDO group:
npm run seed:groupsnpm run devIn a new terminal:
cd ../frontend
npm run dev- Open the application in your browser
- You'll see the Group Selection page
- Click on "EOG CONDO" (or any available group)
- Enter the password:
password - You'll be taken to the main application with that group's data
- On the Group Selection page, click "Create New Group"
- Enter a group name (e.g., "Family Expenses", "Office Bills")
- Set a password for the group
- Confirm the password
- Click "Create Group"
- You'll be automatically logged into the new group
- Click the "Switch Group" button in the sidebar (bottom)
- You'll be taken back to the Group Selection page
- Select a different group and enter its password
{
name: String, // Group name (e.g., "EOG CONDO")
password: String, // Hashed password
createdBy: String, // Creator identifier
createdAt: Date,
updatedAt: Date
}{
name: String,
groupId: ObjectId, // Reference to Group - NEW
qrCodes: Array,
createdAt: Date,
updatedAt: Date
}{
description: String,
amount: Number,
groupId: ObjectId, // Reference to Group - NEW
paidBy: ObjectId,
splitWith: [ObjectId],
date: Date,
payments: Array,
createdAt: Date,
updatedAt: Date
}GET /api/groups- Get all groups (without passwords)GET /api/groups/:id- Get single group detailsPOST /api/groups- Create new groupPOST /api/groups/:id/verify- Verify group passwordPUT /api/groups/:id- Update groupDELETE /api/groups/:id- Delete group (only if no members)
All member and expense endpoints now support filtering by groupId:
GET /api/members?groupId=xxx- Get members for specific groupGET /api/expenses?groupId=xxx- Get expenses for specific groupPOST /api/members- Now requiresgroupIdin bodyPOST /api/expenses- Now requiresgroupIdin body
- Passwords are hashed using bcryptjs before storage
- Group passwords are never returned in API responses
- Each group's data is isolated from other groups
- The
groupIdquery parameter ensures data segregation
Group Name: EOG CONDO
Password: password
Note: Change this password in production!
Make sure you've run the migration script if you have existing data:
npm run migrate:groupsEnsure:
- You're logged into a group
- The groupId is being sent with the request
- The backend server is running
If you need to reset a group password:
- Use MongoDB Compass or mongosh
- Delete the group and recreate it using the seed script
- Or update the password field (it will be auto-hashed on save)
Edit seedGroups.js or migrateToGroups.js to add more groups:
const newGroup = new Group({
name: 'Your Group Name',
password: 'your-password',
createdBy: 'System'
})
await newGroup.save()- Create multiple groups via the UI
- Add different members to each group
- Switch between groups to verify data isolation
- Check that members and expenses don't leak between groups
Potential improvements:
- Group admin/member roles
- Invitation system with tokens
- Group settings and customization
- Export/import group data
- Group statistics and analytics
- Email notifications for group activities