Feature: first-class notifications module (in-app + email + optional push)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 15/100
Direzione di ricerca
The first read is the existing Mailer, Asynq queue, Cache, Pulse metrics, Grit UI registry and generated React Query patterns. The proposal puts the module in internal/notify with models.Notification, notify.Send, notify.Scheduler, notify.Rule and notify.Channel; API endpoints and the useNotifications()/bell component define the surface. Done means the acceptance criteria: default models, send API with pluggable channels, hook, bell badge, and an example cron reminder. Because it is design-heavy, confirm scope with maintainers first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Hand-rolled this in a Grit project and it felt like a universal pattern that belongs in the framework. Nearly every SaaS / admin app needs: in-app notification inbox (unread counter, bell icon, mark all read); email fan-out for the same event; idempotent scheduled reminders.
Grit ships the ingredients (Mailer, Asynq, Cache) but nothing that ties them together.
Proposal
Add internal/notify as a first-class battery:
notify.Send(ctx, notify.Event{
Type: "invoice.sent",
RecipientUserID: user.ID,
RecipientEmail: tenant.Email,
Title: "Invoice INV-202604-0042 issued",
Message: "Amount due: UGX 1,200,000.",
Link: "/invoices/abc",
Channels: notify.ChannelInApp | notify.ChannelEmail,
})
Built-in components
- models.Notification (user-scoped, unread/read, link)
- notify.Scheduler for delayed / recurring notifications (reminder use case)
- notify.Rule — hook points for "when X transitions to Y, send notification Z"
- notify.Channel interface — InApp, Email, Push, Slack — pluggable
- Admin dashboard (Grit UI) listing recent events, delivery status, retry failed
Endpoints scaffold
- GET /api/notifications?status=unread
- PUT /api/notifications/:id/read
- PUT /api/notifications/read-all
- WebSocket/SSE endpoint for real-time push to the admin UI
Leverages existing batteries
- Mail: existing Mailer for email channel
- Jobs: Asynq-queued deliveries with retries
- Cron: scheduled reminders pipeline
- Pulse: delivery metrics
Why this is worth doing
In my rental-manager project, the reminders system (rent due 7/0/+3 days, lease renewal 30/15/0 days, dispatch worker) ended up as ~400 lines of thoughtful code that every Grit app will rewrite. Owning this in the framework means one canonical Notification schema + a proven idempotent pattern (offset_days + entity_id dedup) + a reusable NotificationBell component.
Acceptance criteria
- Notification + Reminder models registered by default
- notify.Send(ctx, Event) API + pluggable channels
- React Query useNotifications() hook in generated frontend
- Bell component in Grit UI registry with unread badge
- Example cron-driven reminder (subscription expiring in 7 days)
Happy to port the sweep + dispatch logic from my app as a starting PR.
- Lingua principale
- Go
- Stelle
- 152
- Fork
- 20
- Merge medio
- 1g 49m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MUKE-coder/grit
-
[Plugin] calendarAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MUKE-coder/grit#228 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
MUKE-coder/grit#227 ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
MUKE-coder/grit#224 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
MUKE-coder/grit#199 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
MUKE-coder/grit#179 · 4 commenti ·
Tutte le issue di MUKE-coder/grit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
karmada-io/karmada#8101 ·
I maintainer di solito rispondono entro 1 giorno
-
product:platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Infisical/infisical#9746 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
CrossEntropyFilter raises on zero probabilities and single-class resultsForse già presa @NopeCharon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
txn2/mcp-data-platform#2728 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Windshiftapp/core#542 ·
I maintainer di solito rispondono entro 1 giorno