screen-capture.mp4
A modern, full-stack social media application built with the MERN stack featuring real-time messaging, stories, and more.
Socially is a feature-rich social media platform that enables users to connect, share moments, and communicate in real-time. Built with modern web technologies, it offers a seamless Instagram-like experience with posts, stories, direct messaging, and more.
- Authentication - Secure signup, login, logout with JWT tokens
- Password Recovery - Forgot password and reset password via email
- Profile Customization - Update avatar, bio, website, and personal details
- Follow System - Follow/unfollow other users
- Block Users - Block/unblock functionality for user privacy
- Create Posts - Share images with captions
- Interactions - Like, comment, and save posts
- Post Management - Edit captions and delete posts
- Feed - View posts from followed users
- Explore - Discover all posts from the community
- Create Stories - Share temporary content (24-hour visibility)
- Story Views - See who viewed your stories
- Story Reactions - Like and interact with stories
- Archive - Archive stories for later
- Highlights - Save stories to profile highlights permanently
- Direct Messages - Private one-on-one conversations
- Real-time Updates - Instant message delivery with Socket.io
- Media Sharing - Send images in chats
- Post Sharing - Share posts directly in messages
- Message Reactions - React to messages with emojis
- Message Management - Edit, delete for me, delete for everyone
- Read Receipts - Know when messages are read
- Search Messages - Find messages within conversations
- Search Users - Find users by name or username
- Suggested Users - Discover new people to follow
- Responsive Design - Optimized for all devices
- Lazy Loading - Performance-optimized component loading
- Infinite Scroll - Seamless content browsing
| Technology | Purpose |
|---|---|
| React 17 | UI Library |
| Redux | State Management |
| Redux Thunk | Async Actions |
| React Router v6 | Navigation |
| Material UI | UI Components |
| TailwindCSS | Styling |
| Socket.io Client | Real-time Communication |
| Axios | HTTP Requests |
| React Toastify | Notifications |
| Emoji Mart | Emoji Picker |
| Technology | Purpose |
|---|---|
| Node.js | Runtime Environment |
| Express.js | Web Framework |
| MongoDB | Database |
| Mongoose | ODM |
| Socket.io | WebSocket Server |
| JWT | Authentication |
| Bcrypt.js | Password Hashing |
| Cloudinary | Media Storage |
| Nodemailer | Email Service |
| Multer | File Uploads |
| Service | Purpose |
|---|---|
| Vercel | Hosting |
| MongoDB Atlas | Cloud Database |
| Cloudinary | Media CDN |
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local or Atlas)
- Cloudinary account
- Gmail account (for email service)
-
Clone the repository
git clone https://github.com/yourusername/socially.git cd socially -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Set up environment variables (see below)
-
Run the development servers
Backend:
cd backend npm run devFrontend:
cd frontend npm start -
Open the app
Navigate to
http://localhost:3000in your browser
Create a .env file in the backend directory with the following variables:
PORT=4000
MONGO_URI="Your MongoDB URL"
JWT_SECRET="Your secret key"
JWT_EXPIRE="7d"
COOKIE_EXPIRE=5
CLOUDINARY_NAME="your cloudinary account name"
CLOUDINARY_API_KEY="your cloudinary api key"
CLOUDINARY_API_SECRET="take it from the account"
NODE_ENV="production"
SMTP_EMAIL="your email id"
SMTP_PASSWORD="16 digit email account security key"socially/
βββ backend/
β βββ controllers/ # Request handlers
β β βββ chatController.js
β β βββ messageController.js
β β βββ postController.js
β β βββ storyController.js
β β βββ userController.js
β βββ middlewares/ # Custom middleware
β β βββ auth.js # JWT authentication
β β βββ catchAsync.js # Async error wrapper
β β βββ error.js # Error handler
β β βββ upload.js # File upload config
β βββ models/ # Mongoose schemas
β β βββ chatModel.js
β β βββ messageModel.js
β β βββ postModel.js
β β βββ storyModel.js
β β βββ userModel.js
β βββ routes/ # API routes
β β βββ chatRoute.js
β β βββ messageRoute.js
β β βββ postRoute.js
β β βββ storyRoute.js
β β βββ userRoute.js
β βββ utils/ # Utility functions
β β βββ connectDB.js
β β βββ errorHandler.js
β β βββ sendCookie.js
β β βββ sendEmail.js
β βββ app.js # Express app setup
β βββ server.js # Server entry point
β
βββ frontend/
β βββ public/ # Static files
β βββ src/
β β βββ actions/ # Redux actions
β β βββ components/ # React components
β β β βββ Chats/ # Messaging components
β β β βββ Home/ # Home feed components
β β β βββ Layouts/ # Layout components
β β β βββ Navbar/ # Navigation components
β β β βββ Stories/ # Story components
β β β βββ User/ # User profile components
β β βββ constants/ # Redux action types
β β βββ reducers/ # Redux reducers
β β βββ Routes/ # Route components
β β βββ utils/ # Utility functions
β β βββ App.js # Root component
β β βββ index.js # Entry point
β β βββ store.js # Redux store
β βββ package.json
β
βββ vercel.json # Vercel deployment config
βββ README.md
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/signup |
Register new user |
| POST | /api/v1/login |
User login |
| GET | /api/v1/logout |
User logout |
| POST | /api/v1/password/forgot |
Request password reset |
| PUT | /api/v1/password/reset/:token |
Reset password |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/me |
Get logged-in user details |
| DELETE | /api/v1/me |
Delete account |
| GET | /api/v1/user/:username |
Get user by username |
| PUT | /api/v1/update/profile |
Update profile |
| PUT | /api/v1/update/password |
Update password |
| GET | /api/v1/follow/:id |
Follow/unfollow user |
| GET | /api/v1/block/:id |
Block user |
| GET | /api/v1/unblock/:id |
Unblock user |
| GET | /api/v1/users |
Search users |
| GET | /api/v1/users/suggested |
Get suggested users |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/post/new |
Create new post |
| GET | /api/v1/posts |
Get feed posts |
| GET | /api/v1/posts/all |
Get all posts |
| GET | /api/v1/post/detail/:id |
Get post details |
| GET | /api/v1/post/:id |
Like/unlike post |
| POST | /api/v1/post/:id |
Save/unsave post |
| PUT | /api/v1/post/:id |
Update caption |
| DELETE | /api/v1/post/:id |
Delete post |
| POST | /api/v1/post/comment/:id |
Add comment |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/story/new |
Create new story |
| GET | /api/v1/stories/feed |
Get stories feed |
| GET | /api/v1/stories/user/:userId |
Get user stories |
| GET | /api/v1/stories/archived |
Get archived stories |
| POST | /api/v1/story/view/:storyId |
View story |
| POST | /api/v1/story/like/:storyId |
Like/unlike story |
| POST | /api/v1/story/archive/:storyId |
Archive story |
| DELETE | /api/v1/story/:storyId |
Delete story |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/highlight/new |
Create highlight |
| GET | /api/v1/highlights/:userId |
Get user highlights |
| PUT | /api/v1/highlight/:highlightId |
Update highlight |
| DELETE | /api/v1/highlight/:highlightId |
Delete highlight |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/newChat |
Create new chat |
| GET | /api/v1/chats |
Get all chats |
| GET | /api/v1/chats/unread |
Get unread count |
| DELETE | /api/v1/chat/:chatId |
Delete chat |
| POST | /api/v1/newMessage |
Send message |
| GET | /api/v1/messages/:chatId |
Get messages |
| PUT | /api/v1/messages/read/:chatId |
Mark as read |
| PUT | /api/v1/message/edit |
Edit message |
| DELETE | /api/v1/message/deleteForMe/:messageId |
Delete for me |
| DELETE | /api/v1/message/deleteForEveryone/:messageId |
Delete for everyone |
| POST | /api/v1/message/react |
Add reaction |
| DELETE | /api/v1/message/react/:messageId |
Remove reaction |
| POST | /api/v1/sharePost |
Share post in chat |
Pawan
- GitHub: @yourusername
Made with β€οΈ by Pawan
β Star this repository if you found it helpful!