NodeJs, ExpressJS, MongoDB
- Authentication & Authorization
- Post CRUD operations
- Comment functionality
- System blocking user if inactive for 30 days
- A user can block different users
- A user who block another user cannot see his/her posts
- Last date a post was created
- Check if a user is active or not
- Check last date a user was active
- Changing user award based on number of posts created by the user
- A user can follow and unfollow another user
- Get following and followers count
- Get total profile viewers count
- Get posts created count
- Get count of number of users you blocked
- Get all users who views someone's profile
- Admin can block and unblock a user
- Update password
- Profile photo upload
- A user can close his/her account permanently
Welcome to Authentication Section where you can register for a new account and as well as login with your existing account.
The request body needs to be in JSON Format
POST /api/v1/users/register
{
"firsname": "your first name",
"lastname": "your last name",
"email": "your email address",
"password": "your password"
}
POST /api/v1/users/login
{
"email": "your email address",
"password": "your password"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | no |
email |
string |
Your email | yes |
password |
string |
Your password | yes |
Welcome to the User section where you can perform all the functionalities as an authenticated user.
The request body needs to be in JSON Format
GET /api/v1/users
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
GET /api/v1/users/profile
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
GET /api/v1/users/following/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user you want to follow | yes |
GET /api/v1/users/un-follow/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user you want to unfollow | yes |
GET /api/v1/users/blocked/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user you want to block | yes |
GET /api/v1/users/un-blocked/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user you want to unblock | yes |
PUT /api/v1/users
{
"firsname": "your first name",
"lastname": "your last name",
"email": "your email address",
"password": "your password"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | Yes |
firstname |
string |
Your firstname | optional |
lastname |
string |
Your lastname | optional |
email |
string |
Your email | optional |
password |
string |
Your password | optional |
GET /api/v1/users/profile-viewers/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user you want to view his profile | yes |
PUT /api/v1/users/update-password
{
"password": "your password"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
POST /api/v1/users/profile-photo-upload
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
profile |
string |
Your profile photo | yes |
DELETE /api/v1/users
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
PUT /api/v1/users/admin-block/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user admin want to block | yes |
PUT /api/v1/users/admin-unblock/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the user admin want to unblock | yes |
Welcome to the Post section where you can perform all the necessary functions related to Post.
The request body needs to be in Form-Data
POST /api/v1/posts
{
"title": "title of the post",
"description": "description of the post",
"category": "id of the category you want your post to be the part of",
"postImage": "upload photo"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
title |
string |
title of the post | yes |
description |
string |
description of the post | yes |
category |
string |
ID of the category | yes |
postImage |
string |
image of the post | yes |
GET /api/v1/posts
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
GET /api/v1/posts/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the post you want to view | yes |
GET /api/v1/posts/likes/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the post you want to like | yes |
GET /api/v1/posts/dislikes/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the post you want to dislike | yes |
PUT /api/v1/posts/:id
{
"title": "title of the post",
"description": "description of the post",
"category": "id of the category you want your post to be the part of",
"postImage": "upload photo"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the post you want to update | yes |
title |
string |
title of the post | optional |
description |
string |
description of the post | optional |
category |
string |
ID of the category | optional |
postImage |
string |
image of the post | optional |
DELETE /api/v1/posts/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the post you want to delete | yes |
Welcome to the Cateogry section where you can perform all the necessary functions related to Cateogry.
POST /api/v1/categories
{
"title": "category title"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
title |
string |
title of the category | yes |
GET /api/v1/categories
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
GET /api/v1/categories/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the category you want to get | yes |
PUT /api/v1/categories/:id
{
"title": "category title"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the category you want to edit | yes |
title |
string |
title of the category | yes |
DELETE /api/v1/categories/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
ID of the category you want to edit | yes |
Welcome to the Comments section where you can perform all the functionalities related to comments.
POST /api/v1/comments/:id
{
"description": "your comment"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
PUT /api/v1/comments/:id
{
"description": "your comment"
}
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
id of the comment you want to edit | yes |
description |
string |
description of the comment | yes |
DELETE /api/v1/comments/:id
Parameter | Type | Description | Required |
---|---|---|---|
authentication |
string |
Your token | yes |
id |
string |
id of the comment you want to edit | yes |
If you want to contribute in this project, then, feel free to reach me at somenathchoudhury35@gmail.com