Build a Blog API that can be used to manage posts and comments as well as go through the registration and logging user process using a JWT token
Server: Node, Express, MongoDB, Mongoose, JWT
- ✅ Authentication using JSON Web tokens (JWT) & Authorization
- ✅ Post CRUD operations
- ✅ Category CRUD operations
- ✅ Comment functionality
- ✅ Profile photo uploaded
- ✅ Update password
- ✅ System blocking user if inactive for 30 days
- ✅ Admin can block a user
- ✅ A user can block different users
- ✅ A user who block another user cannot see his/her posts
- ✅ Check if a user is active or not
- ✅ Check last date a user was active
- ✅ Changing user award base on number of posts created by the user
- ✅ A user can follow and unfollow another user
- ✅ Get all users who views someone's profile
- ✅ Admin can unblock a blocked user
- ✅ A user can close his/her account
Clone the project
git clone https://link-to-project
Go to the project directory
cd my-project
Install dependencies
npm install
Start the server
npm run server
To run this project, you will need to add the following environment variables to your .env file
MONGODB_URL
, JWT_SECRET
, CLOUDINARY_CLOUD_NAME
, CLOUDINARY_API_KEY
, CLOUDINARY_API_KEY
, CLOUDINARY_API_SECRET_KEY
Some endpoints may require authentication for example. To create a create/delete/update post, you need to register your API client and obtain an access token.
The endpoints that require authentication expect a bearer token sent in the Authorization header
.
Example:
Authorization: Bearer YOUR TOKEN