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.
- 🔐 JWT Authentication with secure login, signup, and logout
- 🛡️ Security: Rate-limiting, CAPTCHA, and route protection
- 💬 Real-Time Chat using Socket.IO for connected users
- 🤝 Connection System: Send and accept connection requests to chat
- 📅 Daily Reminder Service using
node-cron, Redis & BullMQ to email users about pending requests - 💳 Razorpay Payment Integration with Webhook-based order handling
- ✅ API Unit Testing using Vitest with 80%+ code coverage
- 🌍 Production Deployment on AWS EC2 with:
- NGINX reverse proxy
- SSL/TLS via OpenSSL & Cloudflare
- Domain: codemate.tech
| Layer | Tech |
|---|---|
| Frontend | React.js |
| Backend | Node.js, Express.js |
| Database | MongoDB + Mongoose |
| Auth | JWT, bcrypt, cookie-parser |
| Real-time Comm. | Socket.IO |
| Job Queue | BullMQ + Redis |
| Scheduler | Node-Cron |
| Payment Gateway | Razorpay + Webhooks |
| Email Service | Nodemailer |
| Security | express-rate-limit, CAPTCHA (Cloudflare) |
| Testing | Vitest |
| Deployment | AWS EC2, NGINX, Cloudflare SSL |
- 🚀 Single EC2 Instance Deployment on AWS with both frontend and backend hosted on same machine
- 🌐 NGINX Reverse Proxy: Routes
/apito backend and serves React build for all other routes - 🔒 OpenSSL Certificates: Self-signed SSL certificates configured for HTTPS using NGINX
- 🌩️ Cloudflare Integration:
- Free SSL layer on top of server TLS
- Managed DNS and CAPTCHA protection
- 🔁 Webhook Handling:
- Razorpay webhooks for payment validation
- Secure middleware validation of webhook signatures
- 📩 Email Queue via Redis:
- Scalable queue-based email service using Redis + BullMQ
- Handles retries and failure states
- 🧪 Test Coverage + CI Ready:
- Codebase tested using Vitest
- Configured for 80%+ coverage
- Easy to plug into CI/CD pipelines
- 📆 Job Scheduling via Node-Cron:
- Sends reminder emails every day at 9:30 AM
- Runs as a background service
Codemate is designed with modular, scalable, and production-grade architecture in mind:
- Uses Redis + BullMQ for background jobs
- Prevents API blocking and ensures delivery via retry attempts
- Emails include daily reminders about connection requests
- Two-way real-time connection using WebSocket protocol
- Chat room created dynamically based on approved connection
- Enables instant dev-to-dev communication
- Backend follows controller-service-repository pattern
- Clear separation of concerns for maintainability
- Easily adaptable for microservices in future phases
- JWT tokens are stored in HTTP-only cookies
- Login endpoint rate-limited to avoid brute-force attacks
- Signup integrated with CAPTCHA challenge (via Cloudflare)
- Node-Cron used to run daily jobs
- Integrates with BullMQ queue for processing tasks
- Lightweight but production-ready scheduler
- Every core route is covered by Vitest unit tests
- Can be extended with E2E and integration tests
- Ensures regression-proof development process
POST /api/auth/login // Login (with rate-limiting)
POST /api/auth/signup // Signup (with CAPTCHA)
POST /api/auth/logout // Logout (protected route)POST /api/connection/send/:status/:toUserId // Send connection request
POST /api/connection/review/:status/:requestId // Accept/Reject connection request
GET /api/user/feed // Get developer feed
GET /api/user/chat/:targetUserId // Get chat with user
GET /api/user/requests/received // Received connection requests
GET /api/user/connections // All approved connections
GET /api/profile/view
PATCH /api/profile/edit
DELETE /api/profile/delete
POST /api/payment/create // Create Razorpay order
POST /api/payment/webhook // Razorpay webhook handler
GET /api/payment/verify // Confirm payment
-
Unit tests for backend APIs using Vitest
-
Achieves 80%+ code coverage
-
Ensures robustness and catches edge cases