{"id":30324102,"url":"https://github.com/chiragsdev/codemate-backend","last_synced_at":"2026-04-14T05:32:19.618Z","repository":{"id":290493404,"uuid":"971291914","full_name":"chiragsdev/CodeMate-Backend","owner":"chiragsdev","description":"Codemate is a production-grade social media platform built using the MERN stack, designed to help developers connect, collaborate, and communicate. It includes authentication, real-time chat, reminders, notifications, and payment integration — all deployed securely using cloud infrastructure and modern DevOps practices.","archived":false,"fork":false,"pushed_at":"2025-07-18T11:12:47.000Z","size":222,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T12:52:38.480Z","etag":null,"topics":["aws","bullmq","continuous-deployment","continuous-integration","express","mongodb","nginx","node-cron","nodejs","notifications","pm2","razorpay","redis","websocket"],"latest_commit_sha":null,"homepage":"https://codemate.tech","language":"JavaScript","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/chiragsdev.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-04-23T09:50:33.000Z","updated_at":"2025-07-20T16:48:54.000Z","dependencies_parsed_at":"2025-04-29T05:30:02.520Z","dependency_job_id":"233b34ef-d566-4b89-802a-cd9f2006cbfe","html_url":"https://github.com/chiragsdev/CodeMate-Backend","commit_stats":null,"previous_names":["chiragaug6/devmate","chiragsdev/codemate-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chiragsdev/CodeMate-Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiragsdev%2FCodeMate-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiragsdev%2FCodeMate-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiragsdev%2FCodeMate-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiragsdev%2FCodeMate-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chiragsdev","download_url":"https://codeload.github.com/chiragsdev/CodeMate-Backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chiragsdev%2FCodeMate-Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["aws","bullmq","continuous-deployment","continuous-integration","express","mongodb","nginx","node-cron","nodejs","notifications","pm2","razorpay","redis","websocket"],"created_at":"2025-08-17T22:30:27.953Z","updated_at":"2026-04-14T05:32:19.600Z","avatar_url":"https://github.com/chiragsdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 👨‍💻 Codemate - Connect with Coders\n\nCodemate is a production-grade social media platform built using the MERN stack, designed to help developers connect, collaborate, and communicate. It includes authentication, real-time chat, reminders, notifications, and payment integration — all deployed securely using cloud infrastructure and modern DevOps practices.\n\n---\n\n## 🌐 Live Site\n\n🔗 [https://codemate.tech](https://codemate.tech)\n\n---\n\n## 📌 Features\n\n- 🔐 **JWT Authentication** with secure login, signup, and logout\n- 🛡️ **Security**: Rate-limiting, CAPTCHA, and route protection\n- 💬 **Real-Time Chat** using Socket.IO for connected users\n- 🤝 **Connection System**: Send and accept connection requests to chat\n- 📅 **Daily Reminder Service** using `node-cron`, Redis \u0026 BullMQ to email users about pending requests\n- 💳 **Razorpay Payment Integration** with Webhook-based order handling\n- ✅ **API Unit Testing** using Vitest with 80%+ code coverage\n- 🌍 **Production Deployment** on AWS EC2 with:\n  - NGINX reverse proxy\n  - SSL/TLS via OpenSSL \u0026 Cloudflare\n  - Domain: [codemate.tech](https://codemate.tech)\n\n---\n\n## 🛠️ Tech Stack\n\n| Layer           | Tech                                     |\n| --------------- | ---------------------------------------- |\n| Frontend        | React.js                                 |\n| Backend         | Node.js, Express.js                      |\n| Database        | MongoDB + Mongoose                       |\n| Auth            | JWT, bcrypt, cookie-parser               |\n| Real-time Comm. | Socket.IO                                |\n| Job Queue       | BullMQ + Redis                           |\n| Scheduler       | Node-Cron                                |\n| Payment Gateway | Razorpay + Webhooks                      |\n| Email Service   | Nodemailer                               |\n| Security        | express-rate-limit, CAPTCHA (Cloudflare) |\n| Testing         | Vitest                                   |\n| Deployment      | AWS EC2, NGINX, Cloudflare SSL           |\n\n---\n\n## 📤 Hosting \u0026 DevOps Deployment\n\n- 🚀 **Single EC2 Instance Deployment** on AWS with both frontend and backend hosted on same machine\n- 🌐 **NGINX Reverse Proxy**: Routes `/api` to backend and serves React build for all other routes\n- 🔒 **OpenSSL Certificates**: Self-signed SSL certificates configured for HTTPS using NGINX\n- 🌩️ **Cloudflare Integration**:\n  - Free SSL layer on top of server TLS\n  - Managed DNS and CAPTCHA protection\n- 🔁 **Webhook Handling**:\n  - Razorpay webhooks for payment validation\n  - Secure middleware validation of webhook signatures\n- 📩 **Email Queue via Redis**:\n  - Scalable queue-based email service using Redis + BullMQ\n  - Handles retries and failure states\n- 🧪 **Test Coverage + CI Ready**:\n  - Codebase tested using Vitest\n  - Configured for 80%+ coverage\n  - Easy to plug into CI/CD pipelines\n- 📆 **Job Scheduling via Node-Cron**:\n  - Sends reminder emails every day at 9:30 AM\n  - Runs as a background service\n\n---\n\n## 🔁 System Design Highlights\n\nCodemate is designed with **modular, scalable, and production-grade architecture** in mind:\n\n### 🔄 1. Queue-Based Email Notification System\n\n- Uses **Redis + BullMQ** for background jobs\n- Prevents API blocking and ensures delivery via retry attempts\n- Emails include daily reminders about connection requests\n\n### 💬 2. Real-Time Messaging with Socket.IO\n\n- Two-way real-time connection using **WebSocket protocol**\n- Chat room created dynamically based on approved connection\n- Enables instant dev-to-dev communication\n\n### 🧱 3. Scalable Architecture\n\n- Backend follows **controller-service-repository pattern**\n- Clear separation of concerns for maintainability\n- Easily adaptable for microservices in future phases\n\n### 🔐 4. Secure Authentication Flow\n\n- JWT tokens are stored in **HTTP-only cookies**\n- Login endpoint rate-limited to avoid brute-force attacks\n- Signup integrated with CAPTCHA challenge (via Cloudflare)\n\n### ⚙️ 5. Background Job Scheduling\n\n- **Node-Cron** used to run daily jobs\n- Integrates with BullMQ queue for processing tasks\n- Lightweight but production-ready scheduler\n\n### 🧪 6. API Testing \u0026 Coverage\n\n- Every core route is covered by **Vitest unit tests**\n- Can be extended with E2E and integration tests\n- Ensures regression-proof development process\n\n---\n\n## 📃 API Endpoints\n\n### 🔐 Auth Routes\n\n```http\nPOST   /api/auth/login       // Login (with rate-limiting)\nPOST   /api/auth/signup      // Signup (with CAPTCHA)\nPOST   /api/auth/logout      // Logout (protected route)\n```\n\n### 🤝 Connection Routes\n\n```\nPOST   /api/connection/send/:status/:toUserId       // Send connection request\nPOST   /api/connection/review/:status/:requestId    // Accept/Reject connection request\n```\n\n### 🧑‍🤝‍🧑 User Routes\n\n```\nGET    /api/user/feed                  // Get developer feed\nGET    /api/user/chat/:targetUserId   // Get chat with user\nGET    /api/user/requests/received    // Received connection requests\nGET    /api/user/connections          // All approved connections\n```\n\n### 👤 Profile Routes\n\n```\nGET    /api/profile/view\nPATCH  /api/profile/edit\nDELETE /api/profile/delete\n```\n\n### 💰 Payment Routes\n\n```\nPOST   /api/payment/create     // Create Razorpay order\nPOST   /api/payment/webhook    // Razorpay webhook handler\nGET    /api/payment/verify     // Confirm payment\n```\n\n### ✅ Testing\n\n- Unit tests for backend APIs using Vitest\n\n- Achieves 80%+ code coverage\n\n- Ensures robustness and catches edge cases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiragsdev%2Fcodemate-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchiragsdev%2Fcodemate-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchiragsdev%2Fcodemate-backend/lists"}