A MERN stack implementation of a simple Instagram clone. This project uses MongoDB, Express, React, and Node.js to create a full-stack web application.
- User authentication and authorization using JWT
- Create, read, update, and delete posts
- View posts by a specific user
- View all posts
- Delete user account and all associated posts
To get started with this project, first clone the repository:
git clone https://github.com/MukulGupta005/Instagram-Mern-Stack.git
Next, navigate to the project directory and install the dependencies:
cd Instagram-Mern-Stack
npm install
To start the development server, run the following command:
npm start
This will start the server on port 5000. You can then view the application in your web browser by visiting http://localhost:5000.
This endpoint returns a list of users in the database.
Response:
- 200 OK - Returns a list of users in JSON format.
This endpoint returns a list of posts created by the authenticated user.
Request:
- Authorization header with a valid JWT token.
Response:
- 200 OK - Returns a list of posts in JSON format.
This endpoint returns a list of all posts in the database.
Response:
- 200 OK - Returns a list of posts in JSON format.
This endpoint creates a new post in the database.
Request:
- Authorization header with a valid JWT token.
title
andbody
fields in the request body.
Response:
- 201 Created - Returns the newly created post in JSON format.
This endpoint deletes a post from the database.
Request:
- Authorization header with a valid JWT token.
- postId parameter in the URL.
Response:
- 200 OK - Returns a JSON object with a redirect property set to /posts.
This endpoint deletes the authenticated user and all associated posts from the database.
Request:
- Authorization header with a valid JWT token.
Response:
- 200 OK - Returns a JSON object with a message indicating that the user has been deleted.
- MongoDB
- Express
- React
- Node.js
- JWT
- Mongoose
Contributions are welcome! If you'd like to contribute to this project, please submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.
Mukul Gupta - @MukulGupta005 - [email protected]
Project Repository - https://github.com/MukulGupta005/Instagram-Mern-Stack