Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dev Tinder Backend

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

Features

  • 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

Tech Stack

  • Node.js
  • Express
  • MongoDB and Mongoose
  • Socket.IO
  • JWT
  • bcryptjs
  • node-cron

Prerequisites

  • Node.js 22.11.0 or 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

Getting Started

Clone the repository:

git clone https://github.com/YOUR_GITHUB_USERNAME/dev-tinder.git
cd dev-tinder

Install dependencies:

npm install

Create your local environment file:

cp .env.example .env

Update .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 dev

The API will run on:

http://localhost:3000

Scripts

npm run dev

Runs the server with nodemon.

npm start

Runs the server with Node.

Project Structure

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 point

API Areas

  • POST /signup - create an account
  • POST /login - login
  • POST /logout - logout
  • PATCH /forget-password - reset password
  • POST /email-exist - check whether an email exists
  • /profile/* - profile read/update/password routes
  • /request/* - send and review connection requests
  • /user/* - feed, requests, and connections routes
  • GET /chat/room - fetch or create a chat room for connected users

Running With The Mobile App

  1. Start this backend first with npm run dev.
  2. Open the mobile app repository: dev-tinder-app.
  3. Configure the mobile app SERVER_URL to 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/

Security Notes

  • Never commit .env files.
  • Use a long random value for JWT_SECRET.
  • Use production-safe MongoDB credentials in deployment.
  • Restrict CORS_ORIGIN and SOCKET_CORS_ORIGIN for production deployments.
  • Rotate any credentials that were ever committed before making the repository public.

License

ISC

About

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.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages