This is the backend for Sociial, a social media app built with Node.js, Express.js, Socket.IO, and MongoDB. The backend handles user authentication, real-time messaging (chats, group chats, reacts), media management (posts, videos, comments, likes), audio/video calls (WebRTC) and much more.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
-
Clone the repo
git clone https://github.com/sethshivam11/social-media-backend.git
-
Install NPM packages
npm install
-
Enter your environment variables in
nodemon.json
{ "env": { "MONGODB_URI": "YOUR_MONGODB_URI", "DB_NAME": "ANY_DB_NAME", "PORT": 3000, "CLOUDINARY_CLOUD_NAME": "YOUR_CLOUD_NAME", "CLOUDINARY_API_KEY": "YOUR_API_KEY", "CLOUDINARY_API_SECRET": "YOUR_API_SECRET", "CLOUDINARY_UPLOAD_PRESET": "YOUR_CLOUDINARY_UPLOAD_PRESET", "TOKEN_SECRET": "YOUR_TOKEN_SECRET", "CORS_ORIGIN": "YOUR_CORS_ORIGIN", "MAIL_USER": "YOUR_MAIL_ID", "MAIL_PASSWORD": "YOUR_MAIL_PASSWORD", "ICON_URL": "YOUR_ICON_URL", "PUBLIC_URL": "YOUR_PUBLIC_URL", "FIREBASE_ADMIN": "YOUR_FIREBASE_ADMIN_JSON", "IMAGE_URL": "YOUR_LOGO_IMAGE_URL", "RELOAD_INTERVAL": "YOUR_RELOAD_INTERVAL", "COOKIE_EXPIRY": "ANY_COOKIE_EXPIRY", "NODE_ENV": "production", "GOOGLE_CLIENT_ID": "YOUR_GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET": "YOUR_GOOGLE_CLIENT_SECRET", "GOOGLE_CALLBACK_URL": "YOUR_GOOGLE_CALLBACK_URL", "CLIENT_SSO_REDIRECT_URL": "YOUR_CLIENT_SSO_REDIRECT_URL", } }
-
Change git remote url to avoid accidental pushes to base project
git remote set-url origin github-username/repo-url git remote -v # confirm the changes
You can get the API documentation here.
For frontend code visit https://github.com/sethshivam11/sociial
You can test them and use it in your projects as well.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'feat: Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Shivam - @sethshivam11 - [email protected]
Project Link: https://github.com/sethshivam11/social-media-backend