Backend API and realtime chat server for Dev Tinder, a developer networking app inspired by swipe-based connection flows. This service handles authentication, profiles, connection requests, user feeds, chat rooms, and Socket.IO messaging.
Related repository: dev-tinder-app
- Email/password authentication with JWT cookies
- Profile creation, profile updates, and password updates
- Developer feed with ignored/interested request actions
- Connection request review flow
- Connections list API
- Chat room creation/fetching for connected users
- Realtime messaging with Socket.IO
- MongoDB persistence with Mongoose models
- Environment-based CORS and socket origin configuration
- Node.js
- Express
- MongoDB and Mongoose
- Socket.IO
- JWT
- bcryptjs
- node-cron
- Node.js
22.11.0or later recommended - npm
- MongoDB running locally or a MongoDB Atlas connection string
- The mobile app repository if you want to run the full product: dev-tinder-app
Clone the repository:
git clone https://github.com/YOUR_GITHUB_USERNAME/dev-tinder.git
cd dev-tinderInstall dependencies:
npm installCreate your local environment file:
cp .env.example .envUpdate .env with your own values:
ENVIRONMENT="dev"
PORT="3000"
CONNECTION_STRING_DEV="mongodb://127.0.0.1:27017/dev-tinder"
CONNECTION_STRING_PROD=""
JWT_SECRET="replace-with-a-long-random-secret"
CORS_ORIGIN="http://localhost:3000,http://localhost:3001"
SOCKET_CORS_ORIGIN="*"Start the development server:
npm run devThe API will run on:
http://localhost:3000npm run devRuns the server with nodemon.
npm startRuns the server with Node.
src/
config/ Database connection setup
middlewares/ Auth middleware
models/ Mongoose schemas
routes/ API route handlers
utils/ Validation, cron jobs, socket helpers
index.js Express and Socket.IO entry pointPOST /signup- create an accountPOST /login- loginPOST /logout- logoutPATCH /forget-password- reset passwordPOST /email-exist- check whether an email exists/profile/*- profile read/update/password routes/request/*- send and review connection requests/user/*- feed, requests, and connections routesGET /chat/room- fetch or create a chat room for connected users
- Start this backend first with
npm run dev. - Open the mobile app repository: dev-tinder-app.
- Configure the mobile app
SERVER_URLto point to this backend.
Common mobile app backend URLs:
Android emulator: http://10.0.2.2:3000/
iOS simulator: http://localhost:3000/
Physical device: http://YOUR_MACHINE_LAN_IP:3000/- Never commit
.envfiles. - Use a long random value for
JWT_SECRET. - Use production-safe MongoDB credentials in deployment.
- Restrict
CORS_ORIGINandSOCKET_CORS_ORIGINfor production deployments. - Rotate any credentials that were ever committed before making the repository public.
ISC