🚀 Welcome to Anshul's Social Media Backend API
A fully featured social media backend developed using Node.js, Express.js, and MongoDB. This RESTful API provides core social functionalities including user authentication, post management, comments, likes, friendship handling, and OTP-based password reset. The application is production-ready and deployed on AWS EC2, secured with an Nginx reverse proxy and Let's Encrypt SSL for HTTPS support.
🌟 Key Features
- 🔐 User Registration & Authentication: Users can sign up, log in, and log out from one or all devices (JWT authentication with TTL-based storage)
- 🖼️ Avatar & Post Image Upload: Users can upload a profile picture during signup and attach images to posts (handled via Multer)
- 📝 Post Management (CRUD): Create, update, and delete posts with automatic file cleanup
- 💬 Comment System: Add, edit, or delete comments; only the commenter or the post owner can delete
- ❤️ Like Functionality: Like/unlike both posts and comments; view like count and details
- 🤝 Friendship Management: Send/accept/reject friend requests; toggle friendships; retrieve friends and pending requests
- 🔁 Password Reset via OTP: Secure OTP-based password reset via email, including OTP generation, verification, and expiry handling
- 🛠️ Custom Middleware: JWT authentication, file upload handling, and centralized error management
- 🧩 Modular Architecture: Follows MVC and repository pattern using ES6 modules for clean, scalable code
- ☁️ Deployment: Fully deployed on AWS EC2 (Ubuntu) with Nginx reverse proxy and HTTPS via Certbot (Let's Encrypt)
🔗 API Testing & Docs
Postman Collection: Test the API via Postman
📘 For complete details, setup guide, and route descriptions, refer to the README.
GitHub: Source Code
Developed by: Anshul Mahor