Skip to content

This api is for blogs website. To build this api used Node js, express, PostgreSQL, JWT, bcrypt

Notifications You must be signed in to change notification settings

shawon-talukder/blogs_api

Repository files navigation



Technologies:

Node Js Express Js PostgreSQL Json-Web-Tokens Nodemailer

Table of Contents

About Project


Database Schema Diagrams

Screenshot 2023-07-06 211806

Users

    base url: https://blogs-api-brainiac5l0th.vercel.app/api/v1/users

Here is the list of all endpoints and method for the users:

Method endpoint logInRequired purpose
GET / false READ all users
GET /:id false READ specific user by id
POST / false CREATE a user
PATCH /:id true UPDATE user information
DELETE /:id true DELETE user from database

Blogs

    base url: https://blogs-api-brainiac5l0th.vercel.app/api/v1/blogs

Here is the list of all endpoints and method for the blogs:

Method endpoint logInRequired purpose
GET / false READ all blogs
GET /:id false READ specific blog by id
GET /user/:userId false READ blogs by specific user
POST / true CREATE a blog
PATCH /:id true UPDATE blog informations
PATCH /report/:id true (admin) UPDATE blog status
DELETE /:id true DELETE blog from database

Note: patch method on '/report/:id' is for admin only. It will send a mail to the author of the blog and will change blog status to draft automatically.


Tags

    base url: https://blogs-api-brainiac5l0th.vercel.app/api/v1/tags

Here is the list of all endpoints and method for the tags:

Method endpoint logInRequired purpose
GET / false READ all tags
POST / true (anyone) CREATE a blog
PATCH /:tagTitle true (admin) UPDATE tag title
DELETE /:tagTitle true (admin) DELETE tag by it's title

Likes

    base url: https://blogs-api-brainiac5l0th.vercel.app/api/v1/likes

Here is the list of all endpoints and method for the likes:

Method endpoint logInRequired purpose
GET /:blogId true READ all persons who liked blog
POST /:blogId/:status true CREATE either like or remove like

Comments

    base url: https://blogs-api-brainiac5l0th.vercel.app/api/v1/comments

Here is the list of all endpoints and method for the comments:

Method endpoint logInRequired purpose
GET /:blogId false READ all comments against blog id
POST /:blogId true CREATE a comment
PATCH /:blogId/:commentId true UPDATE comment
DELETE /:blogId/:commentId true DELETE comment

Diagram Relations


Social Links

facebook linkedIn


About

This api is for blogs website. To build this api used Node js, express, PostgreSQL, JWT, bcrypt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published