Skip to content

VSvensli/Queuecumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Queuecumber

πŸ₯’ Event-Driven Notification System with TypeScript, SQS, SNS, and Postgres

Build a simplified microservice architecture that demonstrates an event-driven pipeline:

  1. Receives events via a webhook (HTTP).
  2. Publishes those events to an SNS topic.
  3. Routes events to multiple SQS queues subscribed to the topic.
  4. Consumes those events asynchronously.
  5. Persists them into a PostgreSQL database via Amazon RDS.
  6. Optionally logs or alerts based on event type.

Project Structure

β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ consumers/
β”‚   β”‚   β”œβ”€β”€ loggerConsumer.ts       # Logs event details
β”‚   β”‚   └── databaseConsumer.ts     # Writes events to local PostgreSQL
β”‚   β”œβ”€β”€ publisher/
β”‚   β”‚   └── snsPublisher.ts         # Publishes to SNS
β”‚   β”œβ”€β”€ server/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚    └── user.ts
β”‚   β”‚   └── index.ts                # HTTP webhook for events
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── db.ts                   # Postgres client and table schema
β”‚   └── types/
β”‚       └── events.ts               # TypeScript event interfaces
β”‚
β”œβ”€β”€ docker/
β”‚   └── postgres.Dockerfile         # Optional: local Postgres setup
β”‚
β”œβ”€β”€ scripts/
β”‚   └── setupAWSResources.sh        # Bootstrap SNS & SQS
β”‚
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

βœ… To-Do List for Project Queuecumber πŸ₯’

  • πŸ”§ Setup Project Initialize TypeScript project, install dependencies, and create base folder structure.

  • 🌐 Create Webhook Receiver
    Build a Hapi server that accepts JSON events via POST, validates structure.

  • πŸ“€ Implement SNS Publisher
    Use @aws-sdk/client-sns to publish incoming events to the SNS topic.

  • πŸ“¬ Build SQS Logger Consumer Poll an SQS queue and log each event's contents to the console.

  • πŸ—ƒοΈ Build SQS Postgres Consumer Store relevant fields from incoming events into the local PostgreSQL DB.

  • πŸ›’οΈ Setup Local PostgreSQL
    Run a Postgres container via Docker and create necessary tables/schema.

  • πŸ§ͺ Define Event Types Create reusable TypeScript interfaces/types for user_signed_up, order_placed, etc.

  • πŸ§ͺ Write Unit Tests Add moccha-based tests for publisher and consumer logic.

  • 🧰 Write AWS Infra Script
    Bash or Node.js script to create SNS topic, SQS queues, and subscriptions.

  • πŸ“˜ Finalize Documentation
    Update README with setup instructions, architecture diagram (optional), and usage notes.

🧾 Supported Events

Each event is a JSON payload like:

{
  "type": "order_placed",
  "payload": {
    "order_id": "xyz789",
    "user_id": "123",
    "total": 49.99,
    "timestamp": "2025-06-25T10:25:00Z"
  }
}

About

πŸ₯’ Event-Driven Notification System with TypeScript, SQS, SNS, and RDS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors