{"id":27437387,"url":"https://github.com/ryomendev/round-robin-coupon-distribution","last_synced_at":"2025-04-14T20:29:02.400Z","repository":{"id":282555193,"uuid":"948966097","full_name":"RyomenDev/Round-Robin-Coupon-Distribution","owner":"RyomenDev","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-15T12:16:12.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T12:25:21.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/RyomenDev.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}},"created_at":"2025-03-15T11:20:45.000Z","updated_at":"2025-03-15T12:16:15.000Z","dependencies_parsed_at":"2025-03-15T12:36:41.860Z","dependency_job_id":null,"html_url":"https://github.com/RyomenDev/Round-Robin-Coupon-Distribution","commit_stats":null,"previous_names":["ryomendev/round-robin-coupon-distribution"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyomenDev%2FRound-Robin-Coupon-Distribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyomenDev%2FRound-Robin-Coupon-Distribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyomenDev%2FRound-Robin-Coupon-Distribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RyomenDev%2FRound-Robin-Coupon-Distribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RyomenDev","download_url":"https://codeload.github.com/RyomenDev/Round-Robin-Coupon-Distribution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248954839,"owners_count":21188872,"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-04-14T20:29:01.857Z","updated_at":"2025-04-14T20:29:02.395Z","avatar_url":"https://github.com/RyomenDev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎟️ Real-Time Coupon Management System\n\n# Round-Robin-Coupon-Distribution\n\nA real-time coupon management system built with React, Node.js, and WebSockets. Users can claim coupons, receive live updates, and track available/claimed coupons. The system ensures fair distribution, prevents duplicate claims, and automatically manages coupon expiration.\n\n## 🚀 Features\n\n- **🔄 Fair Rotation:** Coupons are assigned in a round-robin manner to ensure fair distribution.\n- **⏳ Auto De-assignment:** Coupons are automatically released after 30 seconds if unclaimed.\n- **🎟️ Instant Reassignment:** Expired coupons are immediately reassigned to the next user in line.\n- **💻 Real-Time Updates:** WebSocket integration for instant coupon status updates.\n- **🔐 Authentication:** Secure user login system with JWT authentication.\n- **📊 Live User Count:** Displays the number of active users on the platform.\n- **✅ Instant Notifications:** Users receive real-time notifications for claimed or available coupons.\n- **📡 Efficient Disconnection Handling:** Automatically releases coupons if a user disconnects.\n\n## 🛠️ Tech Stack\n\n- **Frontend:** React.js (Vite, Tailwind CSS, Axios, React Router)\n- **Backend:** Node.js (Express.js, Mongoose, JWT)\n- **Database:** MongoDB (MongoDB Atlas for cloud storage)\n- **WebSocket:** Socket.IO for real-time communication\n- **Security:** JSON Web Token (JWT) for authentication\n- **Abuse Prevention:** IP \u0026 session-based tracking to prevent multiple claims\n- **Deployment:** Vercel (Frontend), Render/Vercel (Backend)\n\n## 📌 Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/RyomenDev/Round-Robin-Coupon-Distribution\n   cd Round-Robin-Coupon-Distribution\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   cd client \u0026\u0026 npm install\n   cd ../server \u0026\u0026 npm install\n   ```\n\n3. **Start the backend server:**\n\n   ```bash\n   cd server\n   npm run dev\n   ```\n\n4. **Start the frontend:**\n\n   ```bash\n   cd client\n   npm run dev\n   ```\n\n5. **Open your browser:**\n   - Visit `http://localhost:5173` to access the application.\n\n## 📡 WebSocket Events\n\n### **Client → Server Events**\n\n| Event Name    | Description                              |\n| ------------- | ---------------------------------------- |\n| `pageReached` | Triggered when a user lands on the page. |\n| `claimCoupon` | Requests a coupon assignment.            |\n\n### **Server → Client Events**\n\n| Event Name           | Description                                  |\n| -------------------- | -------------------------------------------- |\n| `couponAssigned`     | Assigns a coupon to a user.                  |\n| `couponExpired`      | Notifies a user when their coupon expires.   |\n| `updateUserCount`    | Updates the live count of active users.      |\n| `noCouponsAvailable` | Informs users when no coupons are available. |\n\n## 🏢 Future Enhancements\n\n- 🎯 **Expiration Countdown:** Display a timer for assigned coupons.\n- 📢 **Admin Dashboard:** Manage coupons, track claims, and view analytics.\n- 💌 **Email Notifications:** Notify users via email when they claim a coupon.\n- 📊 **Detailed Analytics:** Insights into coupon claim trends and user behavior.\n\n## 📝 License\n\nThis project is licensed under the MIT License.\n\n---\n\n🚀 **Happy Coding!** 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryomendev%2Fround-robin-coupon-distribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryomendev%2Fround-robin-coupon-distribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryomendev%2Fround-robin-coupon-distribution/lists"}