A mini social networking backend built with Node.js, Express, MongoDB, and JWT Auth. Features include user authentication, sending/accepting connection requests, managing profiles, and a personalized user feed with pagination.
π€ User Signup & Login (JWT + Cookies)
π‘οΈ Protected routes with middleware
π Send/Accept/Reject Connection Requests
π§βπ€βπ§ View list of accepted connections
π‘ User Feed showing non-connected users (with pagination)
βοΈ Edit user profile and update password securely
π§ͺ Validations using validator & custom Mongoose validations
Backend: Node.js, Express.js
Database: MongoDB (Mongoose)
Auth: JWT (stored in HTTP-only cookies)
Validation: validator, bcrypt
Environment: dotenv
βββ config/ β βββ database.js βββ modals/ β βββ userSchema.js β βββ connectionReq.js βββ routes/ β βββ auth.js β βββ profile.js β βββ request.js β βββ connections.js βββ middlewares/ β βββ auth.js βββ utils/ β βββ validation.js βββ .env βββ app.js βββ README.md
Create a .env file in the root directory: PORT=3000 MONGODB_URL=your_mongodb_connection_string JWT_SECRET_KEY=your_jwt_secret
#
git clone https://github.com/Dipika-Gandash/Connectify_API cd Connectify_API
npm install
npm start Server will start on: http://localhost:3000
Passwords are hashed using bcrypt
Strong password rules enforced (min 8 chars, 1 upper, 1 lower, 1 symbol, 1 number)
Token is verified in userAuth middleware before protected routes
Input data is validated using validator.js and Mongoose rules
Users can't send duplicate or self-requests