{"id":26514812,"url":"https://github.com/mrcoder57/scalable-notifications","last_synced_at":"2025-03-21T05:29:26.730Z","repository":{"id":283486232,"uuid":"951920130","full_name":"mrcoder57/scalable-notifications","owner":"mrcoder57","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T13:54:33.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T14:26:17.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrcoder57.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T12:59:22.000Z","updated_at":"2025-03-20T13:54:37.000Z","dependencies_parsed_at":"2025-03-20T14:26:23.474Z","dependency_job_id":"cf458ef8-659b-447b-a942-a0ce890d1b50","html_url":"https://github.com/mrcoder57/scalable-notifications","commit_stats":null,"previous_names":["mrcoder57/my-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcoder57%2Fscalable-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcoder57%2Fscalable-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcoder57%2Fscalable-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcoder57%2Fscalable-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrcoder57","download_url":"https://codeload.github.com/mrcoder57/scalable-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745131,"owners_count":20503040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-21T05:29:26.158Z","updated_at":"2025-03-21T05:29:26.718Z","avatar_url":"https://github.com/mrcoder57.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔔 Notification System\n\n## 📌 Overview\nThis is a real-time notification system built using **Kafka, Hono.js, Upstash Redis, and WebSockets**. It ensures seamless communication between users by providing instant notifications. The system is designed to be scalable, efficient, and optimized for high performance.\n\n## 🛠️ Tech Stack\n- **Backend:** Hono.js (Fast Edge API framework)\n- **Message Queue:** Apache Kafka (for event-driven notifications)\n- **Cache \u0026 Pub/Sub:** Upstash Redis (for fast delivery \u0026 scalability)\n- **Database:** MongoDB (for storing notifications history)\n- **WebSockets:** For instant notification updates\n\n## 🔄 How It Works\n1. **Event Triggered:** A user action (e.g., message sent, job update) triggers a notification event.\n2. **Kafka Processing:** The event is published to a Kafka topic.\n3. **Redis Caching:** The event is temporarily stored in Upstash Redis for fast retrieval.\n4. **WebSockets:** The event is pushed to connected clients in real time.\n5. **Database Storage:** The Notification can be handle with any Databases.\n6. **User Receives Notification:** The frontend displays the notification instantly.\n\n## 🚀 Features\n✅ **Real-time Notifications** via WebSockets  \n✅ **Kafka Integration** for handling high-volume events  \n✅ **Upstash Redis** for caching and scalability  \n✅ **Efficient Message Delivery** using event-driven architecture  \n✅ **Secure Authentication** for user access control  \n\n## 📂 Project Structure\n```\n📦 scalable-notifications\n├── 📂 src\n│   ├── 📂 config\n│   │   ├── kafka.ts       # Kafka producer/consumer setup\n│   │   ├── redis.ts       # Redis connection using Upstash\n│   ├── 📂 utils\n│   │   ├── index.ts       # Helper functions\n│   ├── 📂 services\n│   │   ├── notificationService.ts # Handles notification logic\n│   ├── 📂 routes\n│   │   ├── index.ts       # API routes for notifications\n│   ├── 📂 events\n│   │   ├── kafkaConsumer.ts # Kafka consumer logic\n│   ├── index.ts           # Hono server entry point\n├── 📄 .env                # Environment variables\n├── 📄 .gitignore          # Git ignore file\n├── 📄 package.json        # Dependencies \u0026 scripts\n├── 📄 README.md           # Project documentation\n└── 📄 tsconfig.json       # TypeScript configuration\n\n## 🛠️ Setup Instructions\n### 1️⃣ Clone the Repository\n```sh\ngit clone https://github.com/mrcoder57/scalable-notifications.git\ncd notification-system\n```\n\n### 2️⃣ Install Dependencies\n```sh\ncd scalable-notifications\nnpm install\n```\n\n### 3️⃣ Configure Environment Variables\nCreate a `.env` file in the backend directory:\n```env\nKAFKA_BROKER=your-kafka-broker\nUPSTASH_REDIS_URL=Your_url\nUPSTASH_REDIS_TOKEN=your_token\nKAFKA_PASSWORD=your-password\nKAFKA_USER=your-user\n```\n\n### 4️⃣ Start the Backend Server\n```sh\nnpm run dev\n```\n\n\n### 6️⃣ Test the System\n- Open **localhost:3000** (Frontend UI) in the browser.\n- Trigger a notification event (e.g., send a message, update a job).\n- The notification should appear in real-time.\n\n\n## 🔒 Security Best Practices\n- **Do NOT push `ca.pem` or secrets to GitHub.**\n- Use **environment variables** to store sensitive data.\n- Implement **authentication \u0026 authorization** for WebSocket connections.\n- Monitor Redis and Kafka performance to handle large-scale notifications.\n\n## 📝 Future Enhancements\n- ✅ Push Notification Support (Firebase or OneSignal)\n- ✅ Mobile App Integration\n- ✅ Notification Preferences for Users\n\n## 📞 Support \u0026 Contributions\nFeel free to open issues or contribute to this repository! 😊\n\n🔗 **[GitHub Repository](https://github.com/mrcoder57/scalable-notifications)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcoder57%2Fscalable-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrcoder57%2Fscalable-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcoder57%2Fscalable-notifications/lists"}