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
- 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 |
- 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.
- 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)
- Basic CRUD Repository [DONE]
- Add Query Features in read operation [DONE]
- Add route Validation middlewares for check 'id' is valid/exist or not [DONE]
- Updating title will update the slug
- add validation for update blog
- 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 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 | |
POST | /comments/:blogId/comment/:id/dislike | Dislike a comment |
- 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
- 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
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