Skip to content

[FEAT] Streak freeze — allow users to protect a streak day #37

@Priyanshu-byte-coder

Description

@Priyanshu-byte-coder

Summary

GitHub/Duolingo-style streak freeze: let users protect their streak for one day (e.g. weekends, sick days) without breaking it.

What to build

  • New Supabase table: streak_freezes(id, user_id, freeze_date, used_at)
  • New API:
    • POST /api/streak/freeze — inserts a freeze for today; user can only hold 1 unused freeze at a time
    • GET /api/streak/freeze — returns whether user has a freeze available
  • Update GET /api/metrics/streak to treat a freeze date as an "active day" when computing streak
  • Update StreakTracker.tsx:
    • Show "Freeze available" or "No freeze" status
    • Button to "Use freeze" (calls POST /api/streak/freeze)

Supabase migration needed

CREATE TABLE streak_freezes (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  user_id uuid REFERENCES users(id),
  freeze_date date NOT NULL,
  used_at timestamptz
);

Acceptance criteria

  • Migration file in supabase/migrations/
  • POST and GET endpoints working
  • Streak API respects freeze dates
  • StreakTracker shows freeze status and button

Difficulty

Advanced — requires DB, multiple API changes, and component update.

Metadata

Metadata

Labels

advancedAdvanced implementation taskenhancementNew feature or requestgssoc26GSSoC 2026 contributionlevel3GSSoC Level 3 - Advanced (45 points)~8hEstimated 8 hours

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions