The Social Media API is a RESTful service that allows users to perform basic operations related to users and their posts. This API provides endpoints for user management and post interactions.
- Features
- Getting Started
- Prerequisites
- Installation
- API Endpoints
- User Management
- Post Interactions
User Management:
- Create a new user
- Retrieve user information
- Update user details
- Delete a user account
Post Interactions:
- Create a new post
- Retrieve posts for a user
- Update a post
- Delete a post
Node.js MongoDB (or any other preferred database) npm or yarn Installation
- Clone the repository: git clone https://github.com/Raman-79/social-media-api.git
- Install dependencies: cd social-media-api npm install
- Configure environment variables: Create a .env file based on the provided .env.example and set your environment variables.
- Start the server: npm start
API Endpoints
- User Management
- Create a new user: POST /api/users/signup
- Retrieve user information: GET /api/users/profile/:username
- Update user details: POST /api/users/update/:id
- Login a user account: POST /api/users/login
- Logout a user account: POST /api/users/logout
- Follow/Unfollow a user account: POST /api/users/follow/:id
- Post Interactions
- Create a new post: POST /api/posts/create
- Retrieve posts for a user: GET /api/posts/:postId
- Like/Unlike a post: POST /api/posts/like/:postId
- Delete a post: DELETE /api/posts/:postId
- Reply to a post: POST /api/posts/reply/:postId
- Get Feed GET /api/posts/feed