Skip to content

Add notification preferences for students and teachers #520

Description

@knoxiboy

Description

Let users control which in-app and email notifications they receive.

Problem

The usersTable already has emailNotificationsEnabled (line 17), notificationPreference (line 18, values: instant/daily/weekly/none), and the Inngest functions respect these preferences. However: there is no UI for users to manage these preferences; in-app notifications have no category-based filtering; /api/user/preferences/route.ts updates preferences but without Zod validation.

Proposed Solution

  1. Build a notification preferences UI in the user profile/settings area. 2. Add category-based preferences (replies, mentions, classroom activity, teacher alerts, weekly summaries). 3. Add Zod validation to the preferences route.

Files Affected

  • src/app/api/user/preferences/route.ts -- add Zod validation (line 57 uses raw req.json())
  • src/app/profile/ or settings page -- add preferences UI
  • src/configs/schema.ts -- reference usersTable fields (lines 17-18)
  • src/inngest/functions.ts -- already respects preferences (lines 105-107)

Implementation Checklist

  • Users can view and update notification preferences from their profile/settings
  • Email notification toggle (enabled/disabled) is accessible
  • Digest frequency (instant/daily/weekly/none) is selectable
  • Preferences are persisted to the database correctly
  • Notification sending respects updated preferences
  • The preferences API route has Zod validation

Additional Context

This is a GSSoC'26 contributor issue created from the DoubtDesk market-readiness roadmap.

Field Value
Level intermediate
Area notifications
Stack Next.js, TypeScript, Drizzle, Neon Postgres, Clerk, Groq, Inngest

Metadata

Metadata

Assignees

Labels

backendAPI routes, database, server logicfrontendUI components, pages, stylinggssoc'26GSSoC program issuelevel:intermediateIntermediate level tasktype:featureNew feature

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions