Skip to content

[Feature] Squad persistence — local storage and database #19

@grovecj

Description

@grovecj

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

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions