{"id":28246550,"url":"https://github.com/kanishk1420/notification-service","last_synced_at":"2026-05-06T03:31:40.120Z","repository":{"id":293831702,"uuid":"985252564","full_name":"Kanishk1420/Notification-Service","owner":"Kanishk1420","description":"A robust, scalable notification service for sending emails, SMS, and push notifications to users through a unified API.","archived":false,"fork":false,"pushed_at":"2025-05-17T11:37:55.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T12:31:45.052Z","etag":null,"topics":["backend","expressjs","node-express","nodemon","notifications","sendgrid","sms","twillo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Kanishk1420.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-05-17T11:28:56.000Z","updated_at":"2025-05-17T11:37:58.000Z","dependencies_parsed_at":"2025-05-17T12:42:08.640Z","dependency_job_id":null,"html_url":"https://github.com/Kanishk1420/Notification-Service","commit_stats":null,"previous_names":["kanishk1420/notification-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kanishk1420/Notification-Service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanishk1420%2FNotification-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanishk1420%2FNotification-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanishk1420%2FNotification-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanishk1420%2FNotification-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kanishk1420","download_url":"https://codeload.github.com/Kanishk1420/Notification-Service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kanishk1420%2FNotification-Service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["backend","expressjs","node-express","nodemon","notifications","sendgrid","sms","twillo"],"created_at":"2025-05-19T10:07:35.421Z","updated_at":"2026-05-06T03:31:40.113Z","avatar_url":"https://github.com/Kanishk1420.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notification Service\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA robust, scalable notification service for sending emails, SMS, and push notifications to users through a unified API.\r\n\r\n## Overview\r\nThis notification service provides a reliable way to send different types of notifications to your users. It uses a queuing system to ensure notifications are delivered even during high traffic periods, and includes features like notification history tracking and failed notification retry.\r\n\r\n## Features\r\n- Multi-channel notification support:\r\n  - Email notifications (via SendGrid)\r\n  - SMS notifications (via Twilio)\r\n  - Push notifications\r\n- Robust architecture:\r\n  - Queue-based processing for scalability\r\n  - Automatic retries for failed notifications\r\n  - Persistent storage of notification history\r\n- Developer-friendly features:\r\n  - RESTful API endpoints\r\n  - Detailed notification logs\r\n  - Paginated user notification history\r\n\r\n## Installation\r\n\r\n### Prerequisites\r\n- Node.js (v14+)\r\n- MongoDB\r\n- Redis (for queue management)\r\n\r\n### Setup\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/yourusername/notification-service.git\r\n\r\n# Install dependencies\r\ncd notification-service\r\nnpm install\r\n\r\n# Configure environment variables\r\ncp .env.example .env\r\n# Edit .env with your configuration\r\n\r\n# Start the service\r\nnpm start\r\n```\r\n\r\n### Update the .env file with your credentials\r\nOpen `.env` in your text editor and replace the placeholder values with your actual credentials:\r\n\r\n- MongoDB connection string\r\n- SendGrid API key\r\n- Twilio credentials\r\n- Redis configuration (if not using default)\r\n\r\n```env\r\nPORT=3000\r\nMONGODB_URI=mongodb://localhost:27017/notification-service\r\nREDIS_URL=redis://localhost:6379\r\nEMAIL_SERVICE=smtp.example.com\r\nEMAIL_USER=user@example.com\r\nEMAIL_PASSWORD=yourpassword\r\nSENDGRID_API_KEY=your-sendgrid-key\r\nTWILIO_ACCOUNT_SID=your-twilio-sid\r\nTWILIO_AUTH_TOKEN=your-twilio-token\r\n```\r\n\r\n### Start the service\r\n```bash\r\n# Start both the API server and workers\r\nnpm run start:all\r\n\r\n# Or start them separately for development\r\nnpm run dev          # API server\r\nnpm run start:workers # Workers\r\n```\r\n\r\n## Configuration\r\nRequired Environment Variables\r\n```env\r\n# Server Configuration\r\nPORT=3001\r\nNODE_ENV=development\r\n\r\n# Database Configuration\r\nMONGODB_URI=mongodb://localhost:27017/notification-service\r\n\r\n# Email Configuration\r\nSMTP_HOST=smtp.sendgrid.net\r\nSMTP_PORT=587\r\nSMTP_USER=apikey\r\nSMTP_PASS=your_sendgrid_api_key_here\r\nEMAIL_FROM=your_verified_email@example.com\r\n\r\n# SMS Configuration\r\nTWILIO_ACCOUNT_SID=your_twilio_account_sid\r\nTWILIO_AUTH_TOKEN=your_twilio_auth_token\r\nTWILIO_PHONE_NUMBER=+1234567890\r\n\r\n# Redis Configuration\r\nREDIS_HOST=localhost\r\nREDIS_PORT=6379\r\nREDIS_PASSWORD=\r\n```\r\n\r\n## API Usage\r\n\r\n### Send Email Notification\r\n```http\r\nPOST /api/notifications/email\r\nContent-Type: application/json\r\n\r\n{\r\n  \"to\": \"recipient@example.com\",\r\n  \"subject\": \"Your Subject\",\r\n  \"body\": \"Email content with HTML support\",\r\n  \"userId\": \"user123\"\r\n}\r\n```\r\n\r\n### Send SMS Notification\r\n```http\r\nPOST /api/notifications/sms\r\nContent-Type: application/json\r\n\r\n{\r\n  \"to\": \"+1234567890\",\r\n  \"message\": \"Your SMS message here\",\r\n  \"userId\": \"user123\"\r\n}\r\n```\r\n\r\n### Get User Notifications\r\n```http\r\nGET /api/notifications/user/:userId?page=1\u0026limit=10\r\n```\r\n\r\nRetrieves paginated notification history for a specific user.\r\n- `userId`: ID of the user whose notifications to retrieve\r\n- `page`: Page number (default: 1)\r\n- `limit`: Number of notifications per page (default: 10)\r\n\r\n## Architecture\r\nThe service follows a modular architecture with:\r\n1. API Layer: Receives notification requests and queues them\r\n2. Queue: Managed by BullMQ and Redis for reliable job processing\r\n3. Workers: Process queued notifications in the background\r\n4. Storage: MongoDB stores notification records and statuses\r\n\r\n## Troubleshooting\r\n- Redis connection issues: Verify Redis is running on the specified host and port\r\n- Email not being sent: Check your SendGrid API key and sender verification status\r\n- SMS not being sent: Verify your Twilio credentials and check if the recipient number is verified (required for trial accounts)\r\n\r\n## Acknowledgments\r\n- SendGrid for email delivery\r\n- Twilio for SMS services\r\n- BullMQ for the queue implementation\r\n\r\n## License\r\nThis project is licensed under the MIT License - see the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanishk1420%2Fnotification-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanishk1420%2Fnotification-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanishk1420%2Fnotification-service/lists"}