{"id":25761990,"url":"https://github.com/likhithkp/realtime-notifications-service","last_synced_at":"2026-04-18T02:32:34.558Z","repository":{"id":279205263,"uuid":"938034650","full_name":"likhithkp/realtime-notifications-service","owner":"likhithkp","description":"A real-time notification service using Go, Kafka, PostgreSQL, Redis, and WebSockets. It stores notifications in PostgreSQL, caches unread IDs in Redis, and delivers notifications instantly via WebSockets if the user is live.","archived":false,"fork":false,"pushed_at":"2025-02-26T05:17:08.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T14:00:46.360Z","etag":null,"topics":["go","golang","kafka","notification-service","notification-system","postgresql","real-time-notification","redis","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/likhithkp.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,"zenodo":null}},"created_at":"2025-02-24T10:14:35.000Z","updated_at":"2025-04-03T15:11:02.000Z","dependencies_parsed_at":"2025-06-14T06:03:40.483Z","dependency_job_id":"116b9f58-d0f3-4080-9d50-e91b6fe3e8ce","html_url":"https://github.com/likhithkp/realtime-notifications-service","commit_stats":null,"previous_names":["likhithkp/realtime-notifications-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/likhithkp/realtime-notifications-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Frealtime-notifications-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Frealtime-notifications-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Frealtime-notifications-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Frealtime-notifications-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likhithkp","download_url":"https://codeload.github.com/likhithkp/realtime-notifications-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likhithkp%2Frealtime-notifications-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["go","golang","kafka","notification-service","notification-system","postgresql","real-time-notification","redis","websocket"],"created_at":"2025-02-26T19:27:22.262Z","updated_at":"2026-04-18T02:32:34.541Z","avatar_url":"https://github.com/likhithkp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time Notification System\n\n## Overview\n\nA real-time notification system built using Kafka, Redis, PostgreSQL, and WebSockets. This backend service ensures instant event-driven notifications with efficient storage and retrieval.\n\n## Features\n\n- **Kafka Producer \u0026 Consumer**: Events are produced and consumed asynchronously.\n- **PostgreSQL Storage**: Notifications are stored for persistence.\n- **Redis Caching**: Unread notifications are cached for quick access.\n- **WebSockets**: Real-time push notifications to users.\n- **REST API**: Fetch notifications via user ID.\n\n## Tech Stack\n\n- **Go**: Backend service.\n- **Kafka**: Message broker for event-driven processing.\n- **PostgreSQL**: Persistent storage.\n- **Redis**: Fast in-memory cache.\n- **WebSockets**: Real-time communication.\n\n\n## Architecture Flow\n\n1️⃣ **Notification Event Ingestion**  \n   - The API receives notification data and **publishes it to Kafka** for reliable message handling.\n\n2️⃣ **Event Processing \u0026 Storage**  \n   - A Kafka Consumer **processes the event**, storing full notification details in **PostgreSQL**.  \n   - The notification **ID is cached in Redis** for quick access to unread notifications.\n\n3️⃣ **Fetching Notifications**  \n   - When users fetch notifications, the API retrieves **IDs from Redis** first (low-latency response).  \n   - If needed, full details are fetched from **PostgreSQL**.\n\n4️⃣ **Real-time Notification Delivery**  \n   - WebSockets **push real-time notifications** to actively connected clients.  \n   - If a user **views a notification live**, it is marked as **read** immediately in Redis and PostgreSQL.\n\n5️⃣ **Manual Read Acknowledgment**  \n   - Users can manually mark notifications as **read** via an API.  \n   - The system **removes the notification from Redis** and updates PostgreSQL.\n\n\n\n## Installation\n\n1. Clone the repo:\n   ```sh\n   git clone https://github.com/likhithkp/realtime-notifications-service.git\n   ```\n2. Set up Kafka, Redis, and PostgreSQL.\n3. Configure `.env` with necessary environment variables.\n4. Run the service:\n   ```sh\n   go run main.go\n   ```\n\n## API Endpoints\n\n- `POST /createUser` - Create a user first.\n- `POST /createNotification` - Publish a notification.\n- `GET /notifications/{user_id}` - Fetch notifications for a user.\n- `GET /ws/{user_id}` - Listen to live notifications.\n\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikhithkp%2Frealtime-notifications-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikhithkp%2Frealtime-notifications-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikhithkp%2Frealtime-notifications-service/lists"}