# rajasatyam/dev-tinder-backend architecture

> Architecture diagram of the GitHub repository rajasatyam/dev-tinder-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajasatyam/dev-tinder-backend
- Repository: https://github.com/rajasatyam/dev-tinder-backend

## Overview

Dev-Tinder-Backend is an Express API for developer profiles and connection matching. Clients sign up or log in, then use cookie-authenticated profile and discovery endpoints or send and review connection requests; accepted requests appear in a connections listing. The app mounts the route modules and connects to MongoDB before listening. The graph reflects sampled route and model behavior; the README names no further capabilities, and some details of database wiring beyond the shown connector are inferred only as model persistence.

Main entry points: [`src/models/user.model.js`](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/models/user.model.js) (User model), [`src/app.js`](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/app.js) (Express app), [`src/routes/auth.routes.js`](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/auth.routes.js) (Auth routes), [`src/routes/profile.routes.js`](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/profile.routes.js) (Profile routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_app["Express app<br/>[app.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Auth routes<br/>[auth.routes.js]"]
  node_middleware["User auth<br/>[auth.middleware.js]"]
  node_validation["Input validation"]
  node_profile["Profile routes<br/>[profile.routes.js]"]
end

subgraph group_connections["Connection workflow"]
  node_user_routes["User routes<br/>[user.routes.js]"]
  node_request_routes["Request routes<br/>[request.routes.js]"]
end

subgraph group_persistence["Data persistence"]
  node_user_model["User model<br/>[user.model.js]"]
  node_connection_model["Connection model"]
  node_db_connector["DB connector<br/>[connectDB.js]"]
end

node_client(("API client"))
node_mongodb[("MongoDB")]
node_jwt["JWT signing"]
node_bcrypt["Password hashing"]

node_client -->|"HTTP requests"| node_app
node_app -->|"dispatches"| node_auth
node_app -->|"dispatches"| node_profile
node_app -->|"dispatches"| node_request_routes
node_app -->|"dispatches"| node_user_routes
node_app -->|"connects through"| node_db_connector
node_db_connector -->|"connects"| node_mongodb
node_auth -->|"validates input"| node_validation
node_auth -->|"reads and saves"| node_user_model
node_auth -->|"hashes and compares"| node_bcrypt
node_auth -->|"sets auth cookie"| node_client
node_user_model -->|"signs tokens"| node_jwt
node_middleware -->|"verifies token"| node_jwt
node_middleware -->|"loads user"| node_user_model
node_profile -->|"authenticates via"| node_middleware
node_profile -->|"validates updates"| node_validation
node_profile -->|"reads and saves"| node_user_model
node_profile -->|"checks and hashes password"| node_bcrypt
node_request_routes -->|"authenticates via"| node_middleware
node_request_routes -->|"finds recipient"| node_user_model
node_request_routes -->|"checks and saves requests"| node_connection_model
node_user_routes -->|"authenticates via"| node_middleware
node_user_routes -->|"queries connections"| node_connection_model
node_user_routes -->|"queries users"| node_user_model
node_user_model -->|"persists user data"| node_mongodb
node_connection_model -->|"persists requests"| node_mongodb

click node_app "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/app.js"
click node_auth "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/auth.routes.js"
click node_middleware "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/middlewares/auth.middleware.js"
click node_validation "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/utils/validation.utils.js"
click node_profile "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/profile.routes.js"
click node_user_routes "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/user.routes.js"
click node_request_routes "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/request.routes.js"
click node_user_model "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/models/user.model.js"
click node_connection_model "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/models/connection.model.js"
click node_db_connector "https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/config/connectDB.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_client toneBlue
class node_auth,node_middleware,node_validation,node_profile,node_mongodb toneAmber
class node_user_routes,node_request_routes toneMint
class node_user_model,node_connection_model,node_db_connector toneRose
class node_jwt,node_bcrypt toneIndigo
```

## Components

### API entry

- [Express app](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/app.js): `src/app.js`

### Identity and profiles

- [Auth routes](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/auth.routes.js): `src/routes/auth.routes.js`
- [User auth](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/middlewares/auth.middleware.js): `src/middlewares/auth.middleware.js`
- [Input validation](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/utils/validation.utils.js): `src/utils/validation.utils.js`
- [Profile routes](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/profile.routes.js): `src/routes/profile.routes.js`

### Connection workflow

- [User routes](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/user.routes.js): `src/routes/user.routes.js`
- [Request routes](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/routes/request.routes.js): `src/routes/request.routes.js`

### Data persistence

- [User model](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/models/user.model.js): `src/models/user.model.js`
- [Connection model](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/models/connection.model.js): `src/models/connection.model.js`
- [DB connector](https://github.com/rajasatyam/dev-tinder-backend/blob/main/src/config/connectDB.js): `src/config/connectDB.js`

### Other components

- **API client**
- **MongoDB**
- **JWT signing**
- **Password hashing**

## Connections

- API client → Express app: HTTP requests
- Express app → Auth routes: dispatches
- Express app → Profile routes: dispatches
- Express app → Request routes: dispatches
- Express app → User routes: dispatches
- Express app → DB connector: connects through
- DB connector → MongoDB: connects
- Auth routes → Input validation: validates input
- Auth routes → User model: reads and saves
- Auth routes → Password hashing: hashes and compares
- Auth routes → API client: sets auth cookie
- User model → JWT signing: signs tokens
- User auth → JWT signing: verifies token
- User auth → User model: loads user
- Profile routes → User auth: authenticates via
- Profile routes → Input validation: validates updates
- Profile routes → User model: reads and saves
- Profile routes → Password hashing: checks and hashes password
- Request routes → User auth: authenticates via
- Request routes → User model: finds recipient
- Request routes → Connection model: checks and saves requests
- User routes → User auth: authenticates via
- User routes → Connection model: queries connections
- User routes → User model: queries users
- User model → MongoDB: persists user data
- Connection model → MongoDB: persists requests
