Skip to content
Skills Library
Programming · Building & coding

nestjs-notification

/nestjs-notification

Build dual-write notification services with database persistence and FCM push delivery in NestJS. Use when creating notification entities, sending push via FCM, or implementing in-app notification feeds.

Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
5
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Build dual-write notification services with database persistence and FCM push delivery in NestJS. Use when creating notification entities, sending push via FCM, or implementing in-app notification feeds.

Original author description

Build dual-write notification services with database persistence and FCM push delivery in NestJS. Use when creating notification entities, sending push via FCM, or implementing in-app notification feeds.

How it works

  1. Priority: P0 (CRITICAL)
  2. Workflow: Send Notification
  3. Dual-Write Service Example
  4. Structure
  5. Implementation Guidelines
  6. Anti-Patterns
  7. References
Original SKILL.md headings · 39 lines, 225 words
SKILL.md preview
---
name: nestjs-notification
description: Build dual-write notification services with database persistence and FCM push delivery in NestJS. Use when creating notification entities, sending push via FCM, or implementing in-app notification feeds.
metadata:
  triggers:
    files:
    - 'notification.service.ts'
    - 'notification.entity.ts'
    keywords:
    - notification
    - push
    - fcm
    - alert
    - reminder
---
# NestJS Notification Architecture

## **Priority: P0 (CRITICAL)**

Implement "Dual-Write" notification system: persist to Database (In-App) and send via FCM (Push).

## Workflow: Send Notification

1. **Save to database** — Persist notification entity with type enum and metadata.
2. **Check FCM token** — Verify recipient valid `fcmToken`; skip push if missing.
3. **Send push** — Call FCM inside `try/catch`; never let FCM failure block request.
4. **Serialize data** — Convert Dates to ISO strings; keep FCM `data` payload flat (IDs only).

## Dual-Write Service Example

See [implementation examples](references/implementation.md)

## Structure

See [implementation examples](references/implementation.md)

## Implementation Guidelines

- **Use Dual-Write**: Save to DB _first_, then attempt FCM. Catch FCM errors so they don't block logic.
- **Define Granular Types**: Use `NotificationType` Enum (e.g., `APPOINTMENT_REMINDER`) for frontend icon/color logic.
- **Stringify Metadata**: Store routing data (IDs) as JSON string in DB, but Map to string-only Key-Values for FCM `data`.
- **Handle Tokens**: Check for `fcmToken` existence before sending. Fail gracefully if missing.
- **Serialize Dates**: Convert Dates to ISO strings before sending to FCM.

## Anti-Patterns

- **No Generic Types**: Avoid `type: string`. Always use Enum.
- **No Blocking FCM**: Never `await` FCM without `try/catch`. It shouldn't crash request.
- **No Complex Data in Push**: Keep FCM `data` payload flat and minimal (IDs only). Fetch details on open.

## References

- [Service Pattern (Dual-Write)](references/service.md)
- [Type Definitions](references/types.md)
Files in this package (5)
  • SKILL.md 2 KB
  • evals/evals.json 2 KB
  • references/implementation.md 1 KB
  • references/service.md 2 KB
  • references/types.md 1 KB

Versions

The database has no other skills named nestjs-notification.

Database snapshot: 13.11.2026 · package version 6b7281367009 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100push-notifications-apns-fcm-architecture
    Use this skill when configuring remote push notification payloads, background triggers, and device token registration with APNs and FCM.
  • 100push-notification-test-author
    Use for any question or task about testing push notifications, including iOS and Android pushes and one FCM or APNs sender: Firebase FCM, Apple APNs and Web Push with VAPID, payload encryption, badge, sound and click actions, expired or unregistered tokens, silent vs alert…
  • 100expo-notifications
    expo-notifications setup, push tokens, FCM + APNs credentials, categories, scheduled notifications, channels, and the permission flow. Triggers on expo-notifications, push notification, fcm, apns, push token, notification permission, notification channel, notification category,…
  • 100push-notification-test-author
    Build-an-X for push notification tests (push notifications, web push, FCM / APNs push messages) across Web Push (RFC 8030 / VAPID), Apple Push Notification Service (APNs), and Firebase Cloud Messaging (FCM) - covers subscription handshake, payload encryption, badge / sound /…
  • 100push-notification-wirer
    Wires native mobile push end to end on APNs and FCM - device-token lifecycle, permission priming and prompt timing, alert and silent payloads, the server send path, and tap routing in all app states. Use when someone says "add push to our app", "the notification never arrives",…
  • 100push-notifications
    Push notifications for web and mobile. Firebase Cloud Messaging (FCM), Apple Push Notification Service (APNs), Web Push API, Expo Notifications, and notification service architecture. USE WHEN: user mentions "push notification", "FCM", "Firebase messaging", "APNs", "web push",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.