DevBond Tailwind Templates

Devbond

Social Networking Platform - A full-stack social networking solution built with the MERN stack, DaisyUI, and Tailwind CSS, featuring real-time communication using WebSockets and seamless payment processing with Razorpay. Deployed on AWS EC2, this app provides a scalable and interactive platform for users to connect and engage.

๐Ÿš€ DevBond - Social Networking Platform

DevBond is a full-stack social networking platform built with the MERN stack, Tailwind CSS, and DaisyUI, featuring:

  • ๐Ÿ’ฌ Real-time communication using WebSockets
  • ๐Ÿ’ธ Seamless payment integration with Razorpay
  • โ˜๏ธ Cloud deployment on AWS EC2 for scalability
  • ๐Ÿ” Robust authentication and validation
  • ๐Ÿ“ก Dynamic user feed, connection requests, and profile management

๐Ÿงฉ Tech Stack

  • Frontend: React, Tailwind CSS, DaisyUI
  • Backend: Node.js, Express.js, MongoDB (Mongoose)
  • Authentication: JWT, bcrypt, cookie-parser
  • Real-time: Socket.IO
  • Payments: Razorpay
  • Deployment: AWS EC2

๐Ÿ“ API Endpoints

Auth Routes

Method Endpoint Description
POST /signup Register a new user
POST /login Login existing user
POST /logout Logout current user

Profile Routes

Method Endpoint Description
GET /profile/view View profile
PATCH /profile/edit Edit profile
PATCH /profile/password Forgot password handler

Connection Request Routes

Method Endpoint Description
POST /request/send/:status/:userId Send request (interested/ignored)
POST /request/review/:status/:requestId Accept or reject a connection

User Routes

Method Endpoint Description
GET /user/connections Get all accepted connections
GET /user/requests/received Get all received requests
GET /user/feed View feed of other users

๐Ÿ”น Status types: interested, ignored, accepted, rejected


โš™๏ธ Setup & Installation

# 1. Clone the repository
git clone https://github.com/pavansingh888/DevBond.git
cd devbond

# 2. Initialize Git
git init

# 3. Install dependencies
npm install express mongoose bcrypt cookie-parser jsonwebtoken validator razorpay dotenv socket.io cron-scheduler cors

# 4. Install dev dependencies
npm install --save-dev nodemon

# 5. Set environment variables in a `.env` file

Sample .env file

PORT=
JWT_SECRET=
DB_CONNECTION_STRING=
AWS_ACCESS_KEY=
AWS_SECRET_KEY=
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
RAZORPAY_WEBHOOK_SECRET=

Run the server

npm run dev   # uses nodemon

๐Ÿ“ฌ API Testing

  • Use Postman to test all routes
  • Create workspace, save collections, and add auth headers if required

๐Ÿง  Development Journey Highlights

๐Ÿ—ƒ๏ธ MongoDB Integration

  • Connected MongoDB Atlas using mongoose
  • Created UserSchema and RequestSchema
  • Used validations: required, unique, minLength, validate, timestamps
  • Applied $or, $and, $nin, $ne queries
  • Pagination using .skip() and .limit()

๐Ÿ”’ Auth and Security

  • Encrypted passwords using bcrypt
  • Generated and verified JWTs with jsonwebtoken
  • Used cookies for maintaining user sessions
  • Created getJWT() and comparePassword() schema methods

๐Ÿ’Œ Connection System

  • Sent, reviewed (accept/reject), and viewed connection requests
  • Designed schema and API validation
  • Implemented logic to ensure data consistency and prevent duplicates

๐Ÿ’ธ Razorpay Integration

  • Integrated payment system using Razorpay SDK
  • Setup webhook for payment status
  • Managed environment secrets securely

๐Ÿ“ฆ Deployment

  • Deployed on AWS EC2
  • Used PM2 for background process management
  • Setup nginx reverse proxy and SSL if needed

๐Ÿงช Tips & Lessons

  • Always validate incoming data - NEVER TRUST req.body
  • Structure routers in folders and group them logically
  • Understand middleware flow and express internals
  • Index DB fields that are frequently queried
  • Use schema .pre() for pre-save logic
  • Always consider corner cases before finalizing API logic

๐Ÿ“„ License

This project is open source and available under the MIT License.

Top categories

Loading Svelte Themes