This is a full-stack Social Media App built using the MERN (MongoDB, Express.js, React.js, Node.js) stack. It allows users to connect, share posts, and engage in social interactions. The application provides a seamless and responsive user interface, making it easy for users to navigate and interact with each other.
- User Authentication: Secure user authentication using JWT (JSON Web Tokens).
- User Profiles: Users can create and customize their profiles.
- Post Creation: Users can create and share posts with text, images, or links.
- Like and Comment: Users can interact with posts by liking and commenting on them.
- Friend Requests: Users can send and accept friend requests.
- Real-time Updates: Real-time updates for new posts and notifications using WebSockets.
-
Frontend:
- React.js
- Redux for state management
- React Router for navigation
- Axios for API requests
-
Backend:
- Node.js with Express.js
- MongoDB for the database
- Mongoose for ODM (Object Data Modeling)
- Passport.js for authentication
-
Real-time Updates:
- Socket.io for WebSocket communication
-
Clone the repository:
git clone https://github.com/your-username/social-media-app.git
-
Navigate to the project directory:
cd social-media-app
-
Install dependencies:
npm install
-
Set up environment variables:
-
Create a
.env
file in the root directory. -
Define the following variables:
REACT_APP_API_URL=http://localhost:5000/api REACT_APP_SOCKET_URL=http://localhost:5000 SECRET_KEY=your_secret_key MONGODB_URI=your_mongodb_connection_string
-
-
Run the application:
npm run dev
- Open your browser and navigate to
http://localhost:3000
to access the frontend. - Start exploring and using the social media app.
- GET /api/posts: Get all posts.
- GET /api/posts/:postId: Get a specific post.
- POST /api/posts: Create a new post.
- PUT /api/posts/:postId: Update a post.
- DELETE /api/posts/:postId: Delete a post.
Note: The above endpoints are just examples. You may have additional endpoints based on your app's functionality.
Contributions are welcome! If you find any issues or have suggestions, feel free to open an issue or create a pull request.
This project is licensed under the MIT License.