Skip to content

Simple blogging platform backend. Blog Post and Comments on blogs Creation, Reading, Updating, and Deletion (CRUD)

Notifications You must be signed in to change notification settings

Pushkraj-Space/blogosphere

Repository files navigation

BlogoSphere

Simple RESTful API's for blogging platform

Database Setup

  • Create database "blogosphere" or whaterver name you want, in Mysql
  • Import "blogosphere.sql" file in the database that you created
  • Start your Mysql server

Run Locally

Clone the project

  git clone https://github.com/Pushkraj-Space/blogosphere.git

Go to the project directory

  cd blogosphere

Install dependencies

  npm install

Important : Set up environment variables(.env) file as per your machine set up

Start the server

  npm start

API Reference

To use all below mentioned API's in postman, import "BlogoSphere.postman_collection.json" file as a new collection

Base URL = http://localhost:8081

User API's

  • Register a new user

  POST /api/user

Input Format (x-www-form-urlencoded)
  firstName:
  lastName:
  email:
  userName:
  passkey:

  • Login user

  POST /api/user/login

Input Format (x-www-form-urlencoded)
  userName:
  email:(*optional)
  passkey:

  • Get all users

  GET /api/user/
  • Get single user by user name

  GET /api/user/:userName
Parameter Type Description
userName string user name of any user
  • Delete user by user name

  DELETE /api/user/:userName
Parameter Type Description
userName string user name of logged in user
  • Update user by user name

  PUT /api/user/:userName

Input Format (x-www-form-urlencoded)
  firstName:
  lastName:
  email:

Parameter Type Description
userName string user name of logged in user

Blog API's

  • Create new blog

  POST /api/blog/

Input Format (x-www-form-urlencoded)
  blog_title:
  blog_content:

  • Update blog

  PUT /api/blog/:blog_id

Input Format (x-www-form-urlencoded)
  blog_title:
  blog_content:

Parameter Type Description
blog_id string blog_id of a blog
  • Delete blog

  DELETE /api/blog/:blog_id
Parameter Type Description
blog_id string blog_id of a blog
  • Get all blogs

  GET /api/blog/
  • Get all blogs of a user

  GET /api/blog/u/:blog_author
Parameter Type Description
blog_author string The user who posted that blog
  • Get a blog by id

  GET /api/blog/:blog_id
Parameter Type Description
blog_id string blog_id of a blog

Comment API's

  • Create new comment

  POST /api/comment/:blog_id

Input Format (x-www-form-urlencoded)
  cmt_text:

Parameter Type Description
blog_id string blog_id of a blog where user wants to comment
  • Update comment

  PUT /api/comment/:cmt_id

Input Format (x-www-form-urlencoded)
  cmt_text:

Parameter Type Description
cmt_id string id of a comment user wants to edit/update
  • Delete comment

  DELETE /api/comment/:cmt_id
Parameter Type Description
cmt_id string id of a comment user wants to delete
  • Get all comments of a particular blog

  GET /api/comment/:blog_id
Parameter Type Description
blog_id string blog id of a blog

About

Simple blogging platform backend. Blog Post and Comments on blogs Creation, Reading, Updating, and Deletion (CRUD)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published