Getting Started
- Fork the repository: https://github.com/JointSave-org/Joint_Save
- Clone your fork:
git clone https://github.com/<your-username>/Joint_Save.git
cd Joint_Save
- Create a new branch:
git checkout -b feat/pool-event-notifications
Overview
Users currently have no way to know when it's their turn to deposit, when a payout was triggered, or when a group reaches its target — unless they actively check the app. No Supabase Edge Function or any notification-related code exists in the repo yet.
Requirements
Supabase Edge Function: notify-pool-event
Create supabase/functions/notify-pool-event/index.ts:
- Triggered by a database webhook on
pool_activity INSERT
- Based on
activity_type:
payout: Email the beneficiary "You received X XLM from [pool name]"
deposit: Email all other members "[Member] deposited to [pool name]"
round_advance: Email all members "Round N complete. [Next member] is the next beneficiary."
target_reached: Email all members "[Pool name] reached its target! You can now withdraw."
- Use Resend or SendGrid for email delivery (configurable via env var)
User Preferences
- Add a
notification_preferences JSONB column to a user_profiles table in Supabase:
{ "email_on_payout": true, "email_on_deposit": false, "email_on_round": true }
- Add a "Notifications" section in
profile.tsx with toggle switches for each preference
Frontend
- Show an in-app notification bell icon in
dashboard-header.tsx
- Unread count badge on the bell
- Dropdown showing the last 10 activity events across all of the user's pools
Acceptance Criteria
Getting Started
Overview
Users currently have no way to know when it's their turn to deposit, when a payout was triggered, or when a group reaches its target — unless they actively check the app. No Supabase Edge Function or any notification-related code exists in the repo yet.
Requirements
Supabase Edge Function:
notify-pool-eventCreate
supabase/functions/notify-pool-event/index.ts:pool_activityINSERTactivity_type:payout: Email the beneficiary "You received X XLM from [pool name]"deposit: Email all other members "[Member] deposited to [pool name]"round_advance: Email all members "Round N complete. [Next member] is the next beneficiary."target_reached: Email all members "[Pool name] reached its target! You can now withdraw."User Preferences
notification_preferencesJSONB column to auser_profilestable in Supabase:{ "email_on_payout": true, "email_on_deposit": false, "email_on_round": true }profile.tsxwith toggle switches for each preferenceFrontend
dashboard-header.tsxAcceptance Criteria
pool_activityINSERT