-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Implement squad persistence so users can save and retrieve squads across sessions.
Details
Approach (No User Auth)
There is no user authentication system and none is planned. Squads are identified by UUID and accessed via direct URL. This keeps things simple while still being functional.
Backend Persistence
- Squads stored in PostgreSQL (schema from [Backend] PostgreSQL database schema and migrations #5)
- Squad CRUD API from [Feature] Squad data model and REST API #16
- No ownership model — anyone with the squad ID/URL can view and manage it
- Consider adding an optional "edit token" returned on squad creation for basic access control
Frontend Persistence
- localStorage: Save list of squad IDs the user has created/visited
interface SavedSquad { id: string name: string memberCount: number lastVisited: string // ISO timestamp }
- On app load, hydrate squad list from localStorage
- "My Squads" section on home page showing saved squads
- "Save Squad" button when visiting a squad via shared link
Sync Strategy
- Squad data lives in PostgreSQL (source of truth)
- localStorage only stores references (IDs + metadata for display)
- On squad page load, always fetch fresh data from API
- If a squad is deleted from DB, handle 404 gracefully (remove from localStorage)
Acceptance Criteria
- Squads persist in PostgreSQL across server restarts
- User's squad list persists in localStorage across browser sessions
- "My Squads" section on home page shows saved squads
- Visiting a shared squad link offers "Save" option
- Deleted squads handled gracefully (removed from local list)
Reactions are currently unavailable