{"id":27455587,"url":"https://github.com/jayakrishnan-mk/real-time-notification-system","last_synced_at":"2025-07-29T15:34:55.545Z","repository":{"id":285594545,"uuid":"958663026","full_name":"Jayakrishnan-mk/Real-Time-Notification-System","owner":"Jayakrishnan-mk","description":"Real-Time-Chat-Application - built on Redis, which internally works on a Queue model for rate limiting. This system handles 500+ plus notifications per second.","archived":false,"fork":false,"pushed_at":"2025-07-22T07:05:30.000Z","size":8819,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T08:48:39.370Z","etag":null,"topics":["authentication-middleware","bullmq","clean-architecture","docker","hashmap","heartbeat","microservice","prisma","pubsub","queue-workers","rate-limiting","receipts","reconnection","redis","retry-strategies","rooms","swagger","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jayakrishnan-mk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-04-01T15:01:56.000Z","updated_at":"2025-07-22T07:05:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"becade2f-7c24-4aa4-8a46-a450fe7b350c","html_url":"https://github.com/Jayakrishnan-mk/Real-Time-Notification-System","commit_stats":null,"previous_names":["jayakrishnan-mk/real-time-notification-system"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Jayakrishnan-mk/Real-Time-Notification-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayakrishnan-mk%2FReal-Time-Notification-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayakrishnan-mk%2FReal-Time-Notification-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayakrishnan-mk%2FReal-Time-Notification-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayakrishnan-mk%2FReal-Time-Notification-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jayakrishnan-mk","download_url":"https://codeload.github.com/Jayakrishnan-mk/Real-Time-Notification-System/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jayakrishnan-mk%2FReal-Time-Notification-System/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267709625,"owners_count":24131925,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["authentication-middleware","bullmq","clean-architecture","docker","hashmap","heartbeat","microservice","prisma","pubsub","queue-workers","rate-limiting","receipts","reconnection","redis","retry-strategies","rooms","swagger","websocket"],"created_at":"2025-04-15T16:44:12.295Z","updated_at":"2025-07-29T15:34:55.537Z","avatar_url":"https://github.com/Jayakrishnan-mk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🔔 Real-Time Notification System.\n\nA production-ready backend system to send real-time push notifications using **Node.js**, **Socket.IO**, **Redis**, **BullMQ**, and **PostgreSQL**. It supports JWT-based authentication, device-wise refresh token management, and secure token rotation.\n\n---\n\n## 📦 Tech Stack-\n\n- **Node.js** (Express)\n- **TypeScript**\n- **Socket.IO** for real-time communication\n- **Redis** for Pub/Sub\n- **BullMQ** for job queues\n- **MySQL** with Prisma ORM\n- **Swagger** for API docs\n- **JWT** with Refresh Token Rotation\n- **Docker** for containerization\n\n---\n\n## 🧠 Features\n\n- ✅ Real-time notification delivery using WebSocket\n- ✅ BullMQ + Redis for background job processing\n- ✅ Refresh token rotation with device session tracking\n- ✅ Secure and scalable architecture\n- ✅ Swagger UI for API testing\n- ✅ PostgreSQL-based DB design\n- ✅ Admin queue dashboard with authentication\n- ✅ Socket room-based architecture for user isolation\n\n---\n\n\n## 📂 Project structure\n\n- dist\n- node_modules\n- prisma\n- src\n- -\u003e      assets\n- -\u003e      config\n- -\u003e      controllers\n- -\u003e      dtos\n- -\u003e      middleware\n- -\u003e      public\n- -\u003e      queues\n- -\u003e      routes\n- -\u003e      scripts\n- -\u003e      services\n- -\u003e      types\n- -\u003e      utils\n- -\u003e      workers\n- -\u003e      ws\n- -\u003e      index.ts\n- -\u003e      loadEnv.ts\n- .dockerignore\n- .env\n- .env.development\n- .env.production\n- .gitignore\n- Dockerfile\n- package-lock.json\n- package.json\n- readme.md\n- tsconfig.json\n\n---\n\n## 🖼️ High-Level Architecture\n\n![HLD Diagram](./src/assets/HLD-noti.png)\n\n---\n\n## 🖼️ HLD - 2\n\n![HLD Diagram](./src/assets/HLD-2-notification-system.png)\n\n---\n\n## 🧱 Database Schema\n\n![DB Diagram](./src/assets/db_diagram-realtime-chatApp.png)\n\n---\n\n## 🔐 Token Lifecycle Flow (JWT + Refresh Token)\n\n![Token Flow](./src/assets/flowchart_diagram_illustrates_the_JSON_Web_Token.png.png)\n\n---\n\n## 🔌 API Documentation\n\nSwagger UI available at:\n\n```\nhttps://real-time-notification-system-production.up.railway.app/api-docs/\n```\n\n![Swagger](./src/assets/openApi-SWAGGER.png)\n\n---\n\n## 🔐 Bull Dashboard (For analyzing message queue)\n\nDashboard available at:\n\n```\nhttps://real-time-notification-system-production.up.railway.app/admin/queues/\n```\n\n![Queue](./src/assets/bullMQ-Dashboard.png)\n\n---\n\n## 🚀 Local Development Setup\n\n```bash\n# 1. Clone repo\ngit clone https://github.com/Jayakrishnan-mk/real-time-notification-system\n\n# 2. Install dependencies\nnpm install\n\n# 3. Start Redis \u0026 Postgres via Docker (if not already running)\n\n# 4. Setup env\ncp .env.development .env\n\n# 5. Run migrations\nnpx prisma migrate dev\n\n# 6. Start dev server\nnpm run dev\n```\n\n---\n\n## 🐳 Running with Docker (Production Build)\n\nBuild and run using Docker:\n\n```bash\n# 1. Build Docker image\ndocker build -t realtime-notify .\n\n# 2. Run container\ndocker run -d -p 3000:3000 --env-file .env.production realtime-notify\nOr if you're using Docker Compose:\n\nbash\nCopy\nEdit\ndocker-compose up --build\nMake sure your .env.production is properly set up with:\n\nDATABASE_URL\n\nREDIS_URL\n\nJWT_SECRET\n\nother required variables...\n```\n\n---\n\n## 🧪 Testing the Notification Flow\n\n```bash\n# You can test real-time notifications by:\n- Logging in to get access/refresh tokens\n- Opening WebSocket connection with userId\n- Hitting /api/notifications to simulate push\n```\n\n---\n\n## 🌐 Deployment\n\nDeployed on:\n- Railway (Production)\n\n---\n\n## 🤝 Contributing\n\nPRs and suggestions welcome! 🙌\n\n---\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayakrishnan-mk%2Freal-time-notification-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayakrishnan-mk%2Freal-time-notification-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayakrishnan-mk%2Freal-time-notification-system/lists"}