Professional backend for DevTinder: a developer-focused matchmaking and discovery service.
This repository contains the server-side implementation (APIs, realtime sockets, background jobs, and integrations) powering DevTinder's mobile and web clients.
- Language & runtime: Node.js (ES modules)
- Entry point:
server.js - Framework: Express
- Realtime:
socket.io(chat & call namespaces) - Database: MongoDB (Mongoose)
- Cache / coordination: Redis (ioredis)
- Push & messaging: Firebase Admin + Web Push
- File storage: AWS S3 (optional)
- Payments: Cashfree / Razorpay integrations
- Handles user onboarding, authentication, profile management, matching logic, and subscriptions.
- Exposes REST endpoints for client operations and
socket.ionamespaces for realtime chat and calls. - Runs scheduled background jobs (subscription management, cleanup, notifications).
- Integrates with third-party services: S3 for files, Firebase for push, Cashfree/Razorpay for payments.
- Requests hit the Express app (
src/app.js) and are routed to feature controllers undersrc/api/controllers/. - Controllers delegate to services in
src/services/which implement business logic and interact with Mongoose models insrc/models/. - Authentication issues tokens and secures HTTP + socket endpoints; sockets use middleware and shared services for state and authorization.
- Background tasks in
cron/andjobs/run on schedule (vianode-cron) to handle subscriptions, notifications, and maintenance.
npm install— install dependenciesnpm run dev— start withnodemon server.js(development)npm start— start withnode server.js(production)
Quick start:
npm install
npm run devSet required variables in your environment or a .env file (do not commit .env):
MONGO_URL— MongoDB connection string (production must provide a real URI)PORT— HTTP server port (defaults to3000if unset)NODE_ENV—developmentorproduction
Optional integration variables:
REDIS_URI— Redis connection stringAWS_REGION,AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY— S3 credentials
Sensitive files:
- Place Firebase service account and RSA keys in the
env/folder for local dev or mount them via secrets in production. Seeenv/help.md.
- See
API_USAGE.mdfor endpoint examples and client-handling guidance (response shape, example flows). - Client behavior on successful responses: persist tokens, initialize socket connections, and navigate to authenticated views.
- On failures: surface
messageto users and use HTTP status codes to categorize errors (401, 400, 5xx).
server.js— bootstraps the HTTP server, sockets, DB, and services.src/app.js— Express application and middleware.src/config/— configuration and third-party initializers (Mongo, Redis, Firebase, S3, web-push).src/api/routes/— route definitions.src/api/controllers/— controllers that handle requests.src/services/— business logic and orchestration.src/models/— Mongoose models and schema definitions.src/helpers/,src/middlewares/,cron/,jobs/— utilities, middleware, and scheduled tasks.
- The project uses
logs/printLogs.jsfor colored console output during boot and runtime. For production, consider structured logging (e.g.,pino,winston) and integration with a log/metrics system.
- Use
npm run devfor iterative development with automatic restarts. - For production use a process manager (PM2, systemd) or run inside Docker.
- Keep secrets out of VCS; use environment-based secret management in CI/CD or your cloud provider.
- No build step is required; ensure Node.js version supports ES modules (Node 16+ recommended).
- Ensure secrets (Mongo, Redis, S3, Firebase) are available to the runtime before starting.
- Never commit the
env/folder or key files. - Rotate credentials regularly and enforce least-privilege on service accounts.
- App entry:
server.js - Express bootstrap:
src/app.js - Config:
src/config/ - Routes:
src/api/routes/ - Controllers:
src/api/controllers/ - Services:
src/services/ - Models:
src/models/ - Socket handlers:
src/api/socket/
- Ayush Shrivastava — Principal author and lead maintainer. Responsible for architecture, core development, and guiding contributions. Please open issues for bugs or feature requests; contributions are welcome via pull requests.
- ISC (as declared in
package.json)
If you'd like, I can now:
- add a
.env.examplefile - scaffold unit tests for core services
- create a
Dockerfileanddocker-compose.ymlfor local development
Tell me which you'd prefer next.