Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Backend] Build Enterprise Webhook System (Discord Integration, Events, Security, Retries, Idempotency)

Aperta
#4 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
express, github, mongodb, node.js, react, redis, typescript

Direzione di ricerca

Start by reviewing the prerequisite Webhook Setup System, then map the listed API entry points, emitEvent flow, GitHub endpoint, queue, worker, and React dashboard requirements. Done means all acceptance criteria are met, including delivery, Discord and GitHub integrations, retries, duplicate handling, security, tests, and visible logs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We are building a complete webhook + event-driven system in MERN stack:

Events happen (member join / repo push / event created)
→ backend captures event
→ event pushed to queue
→ processed asynchronously
→ webhook triggered
→ Discord / external systems notified
→ UI shows logs & status

🔗 Related Issues (IMPORTANT)

This issue depends on:

👉 Webhook Setup System (Configuration Layer)

  • Create webhook
  • Select events
  • Store secrets
  • Enable/disable

👉 Use that issue as foundation before delivery system.


🎯 Goals

System must be:

  • Real-time (event-driven)
  • Secure (signed webhooks + GitHub verification)
  • Scalable (queue-based workers)
  • Observable (logs + dashboard)
  • Full-stack (backend + React UI)

🧱 SYSTEM ARCHITECTURE


Tech Stack

Frontend → React (Dashboard)
Backend → Node.js + Express
Database → MongoDB
Queue → Redis + BullMQ

High-Level Flow

Event occurs
→ Event Bus (emitEvent)
→ Queue (BullMQ)
→ Worker processes job
→ Webhook delivery
→ Discord / external system notified
→ Store delivery logs
→ Display in dashboard

🧠 CORE MODULES


1️⃣ EVENT SYSTEM (CORE)


Events

member.created
member.activated
event.created
hackathon.created
community.approved
github.push
github.pr.opened

Event Bus

emitEvent(type, payload)

Requirements

  • decoupled system
  • async event publishing
  • multiple consumers


2️⃣ WEBHOOK SETUP SYSTEM (FROM PREVIOUS ISSUE)


APIs

POST /api/v1/webhooks
GET /api/v1/webhooks
PATCH /api/v1/webhooks/:id
DELETE /api/v1/webhooks/:id
POST /api/v1/webhooks/:id/test

Features

  • event selection
  • secret config
  • URL validation (SSRF protected)
  • enable/disable toggle
  • RBAC protected

👉 This must be implemented first (dependency)



3️⃣ WEBHOOK DELIVERY SYSTEM


Flow

event triggered
→ find matching webhooks
→ push job to queue
→ worker sends HTTP POST
→ store result

Payload

{
  "event": "member.created",
  "timestamp": "ISO_DATE",
  "eventId": "unique-id",
  "data": {}
}

Headers

X-Webhook-Event
X-Webhook-Id
X-Webhook-Signature


4️⃣ DISCORD INTEGRATION


Use Cases

  • new member joined
  • new event created
  • hackathon launched
  • GitHub PR opened

Payload

{
  "content": "🚀 New event created!"
}

Features

  • message templates
  • per-event formatting
  • emoji support
  • multiple channels/webhooks


5️⃣ GITHUB WEBHOOK INTEGRATION


Endpoint

POST /api/v1/webhooks/github

Verify Signature

X-Hub-Signature-256

Flow

receive webhook
→ verify signature
→ parse event
→ emitEvent()
→ process internally

Supported Events

push
pull_request
issues
release


6️⃣ SECURITY 🔐


Signature

HMAC-SHA256(secret, payload)

SSRF Protection

  • block localhost
  • block private IP ranges
  • allow HTTPS only

Rate Limiting

Webhook receive → 100/min
Webhook delivery → 10/sec/community

Secret Storage

  • hash + encrypt
  • never return in API


7️⃣ RETRY SYSTEM


Strategy

1 → immediate
2 → 1 min
3 → 5 min
4 → 15 min
5 → fail

Features

  • exponential backoff
  • dead letter queue
  • manual retry support


8️⃣ IDEMPOTENCY


Problem

  • GitHub duplicate events
  • retry duplicates

Solution

eventId
deliveryId

DB Check

  • ignore already processed events


9️⃣ DATABASE DESIGN


Webhook

communityId
url
events
secretHash
active

WebhookDelivery

webhookId
event
payload
status
attempts
responseCode
responseBody

EventStore

eventId
type
payload
processed


🔟 FRONTEND (REACT DASHBOARD)


Pages


Webhook List
  • list all webhooks
  • status (active/inactive)

Create Webhook
  • URL input
  • event selector
  • secret field

Delivery Logs
  • show logs

  • filter:

    • success/failed
    • event type


🎨 UI FEATURES


  • toggle enable/disable
  • retry delivery button
  • view payload
  • error logs display
  • test webhook button


🧪 TESTING


Backend

  • webhook delivery
  • retry logic
  • signature validation

Frontend

  • form validation
  • API calls

Security

  • SSRF
  • invalid signature
  • replay attack


📊 OBSERVABILITY


Logs

  • event triggered
  • delivery status

Metrics

success rate
failure rate
retry count
queue size

Alerts

  • high failure rate
  • queue backlog


🧨 EDGE CASES


duplicate GitHub events
invalid webhook URL
Discord downtime
queue crash
timeout
retry storm


⚙️ PERFORMANCE


  • async processing
  • queue workers scaling
  • batch job handling


🌍 ENVIRONMENT


DEV
STAGING
PROD


✅ ACCEPTANCE CRITERIA


✔ Webhook setup works
✔ Event system works
✔ Delivery system works
✔ GitHub integration works
✔ Discord notifications work
✔ Retry system works
✔ Duplicate handling works
✔ Logs visible in UI
✔ Secure system
✔ Scalable architecture


🔥 FINAL SUMMARY

This system is:

Stripe + GitHub + Slack webhook system (MERN implementation)
Lingua principale
TypeScript
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NexGenStudioDev/CommDesk-Backend

Tutte le issue di NexGenStudioDev/CommDesk-Backend

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.