You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my goasl is not just create a fully functional API, but also to write it in a way that is easy to understand and maintain and to be more reusable and loss-coupled. so if you have any suggestions to improve my code quality please don't hesitate to issue or PR me
Authentication
Sign up
Login
Guard Middleware
Guest Middleware
Protected Routes
Logout
Change Password
Forgot Password
Reset Password
Method
Endpoint
Description
DONE
POST
/auth/sign-up
Register a new user
YES
POST
/auth/sign-in
Login a user
YES
POST
/auth/google-auth
Login with Google
YES
GET
/auth/profile
Get user profile
YES
POST
/blogs
Create a new blog
YES
GET
/blogs/latest
Get latest blogs
YES
GET
/blogs/trending
Get trending blogs
YES
AWS S3 Setup
We created a new account and login to the AWS Management Console.
We choosed the S3 service.
We created a new bucket.
We choosed a unique name for the bucket.
We choosed the region.
We diabled check of "Block all public access".
We enabled check of message "Turning off block all public access might result in this bucket and the objects within becoming public
We clicked on "Create bucket".
We created a policy for the bucket.
We alloed only two actions for the bucket.
s3:PutObject
s3:GetObject
We created a Policy JSON Document.
after that we created a CORS configuration for the bucket. (What is Domain can access the bucket)
created a new policy for the user.
We created a new user. (to get the access key and secret key)
attached the policy to the user.
Feature/ Blog
Create a new blog
Upload a blog image
Get all blogs
Get a single blog
Update a blog
Delete a blog
Implement Query Features (Filter, Search, Sort, Pagination, Limit, Fields)
Today - CRUD Repository [13/8]
Basic CRUD Repository [DONE]
Add Query Features in read operation [DONE]
Generic Validations [13/8]
Add route Validation middlewares for check 'id' is valid/exist or not [DONE]
Update Blog [14/8]
Updating title will update the slug
add validation for update blog
Like/Dislike Blog [20/8] - DONE
Like a blog
Dislike a blog
Method
Endpoint
Description
DONE
POST
/blogs/like/:id
Like a blog
YES
POST
/blogs/dislike/:id
Dislike a blog
YES
Comment Blog [20/8] - DONE
Comment a blog
Get all comments of a blog
Update a comment
Delete a comment
Like/Dislike a comment
Reply to a comment
Get replies of a comment
Method
Endpoint
Description
DONE
POST
/comments/:blogId
Comment a blog
YES
GET
/comments/:blogId
Get all comments
YES
PUT
/comments/:blogId/comment/:id
Update a comment
NO
DELETE
/comments/:blogId/comment/:id
Delete a comment
YES
POST
/comments/:blogId/comment/:id/like
Like a comment
NO
POST
/comments/:blogId/comment/:id/dislike
Dislike a comment
NO
TODO
Get nested replies of a comment has intensive populate code, need to be refactored
Get comments should be returned as a paginated response as well as replies
WORKING & Upcoming
Not returning all eager loading(population) data in get comments, instead, return only the comments, and when user load replies of comment, then we fetch the replies of that comment with pagination as well.
Refactor the code
Add like/dislike feature for comments/replies
DONE
UPDATED - Returning single comment which is created or replied
Response of Create Comment and Reply shouldn't be the whole list comments i think.
Get Comments with Pagination
Deployed on Render.com
About
Build a Fully Functional REST API for blogging system, with clean code and easy to maintain and to compose. the goal is the quality code.