Welcome to our Social Media Web Application! This project is built using the MERN stack - MongoDB, Express.js, React.js, and Node.js.
Our Social Media Web Application provides a platform for users to connect, share posts, comment, and interact with others. Users can create accounts, post updates, like and comment on posts, and follow other users to see their posts in their feed.
- User Authentication: Secure user authentication and authorization system.
- User Profiles: Users can create and customize their profiles.
- Posts: Users can create, edit, delete, and like posts.
- Comments: Users can comment on posts.
- Follow System: Users can follow/unfollow other users.
- Feed: Users can view posts from users they follow.
- Real-time Updates: Real-time notifications for new posts and comments.
- Frontend:
- React.js
- Redux (or Context API for state management)
- Axios (for making API requests)
- Bootstrap (or any other CSS framework for styling)
- Backend:
- Node.js with Express.js
- MongoDB (mongoose ODM for database interactions)
- Authentication:
- JSON Web Tokens (JWT) for secure authentication
- bcrypt.js for password hashing
- Real-time Updates:
- Socket.io (for real-time notifications)
- Node.js and npm installed on your machine
- MongoDB database (either locally or using a cloud service like MongoDB Atlas)
-
Clone the repository:
git clone https://github.com/yourusername/social-media-app.git cd social-media-app
-
Install dependencies:
cd client npm install cd ../server npm install
-
Set up environment variables:
- Create a
.env
file in theserver
directory and configure MongoDB connection URI, JWT secret, and other necessary variables.
- Create a
-
Start the development server:
- In the
server
directory:
npm start
- In the
client
directory:
npm start
- In the
- Visit
http://localhost:3000
in your browser to access the web application. - Sign up for an account, create posts, comment, and interact with other users.
- Explore different features and functionalities of the application.
- GET /api/posts: Get all posts.
- POST /api/posts: Create a new post.
- GET /api/posts/:postId: Get a specific post by ID.
- PUT /api/posts/:postId: Update a post.
- DELETE /api/posts/:postId: Delete a post.
- POST /api/posts/:postId/comment: Add a comment to a post.
- POST /api/users/register: Register a new user.
- POST /api/users/login: User login and authentication.
- GET /api/users/profile/:userId: Get user profile by ID.
- PUT /api/users/profile/:userId: Update user profile.
- POST /api/users/follow/:userId: Follow a user.
- POST /api/users/unfollow/:userId: Unfollow a user.
Note: These are example endpoints. You can customize them according to your application's requirements.
Feel free to contribute to this project. Pull requests and issue reports are welcomed!
This project is licensed under the MIT License.
Feel free to enhance this README file further with detailed instructions, screenshots, or any additional features specific to your social media application. Good luck with your project!