Skip to content

This project is a blog website & it's backend is a REST API developed using nodejs. This is one of my personal projects. This repo holds the backend code of the project.

Notifications You must be signed in to change notification settings

amitshuklabag/blog-website-backend-nodejs-REST-API

 
 

Repository files navigation

blog-website-backend-nodejs-REST-API

blog-website is one of my personal projects where registered bloggers write blogs. Bloggers can also comment or react to blogs. This repository holds the code of it's backend which is a RESTful API.

The frontend of this project can be found here (Angular)

Visit complete live project lets-blog.netlify.app/all_blogs

Features:

  • bloggers can create their profiles (token-based authentication)
  • bloggers can edit their profile
  • bloggers can write blogs. They can set the category of their blog (i.e. travel, medical, tech etc)
  • registered bloggers can comment on their own or others blog
  • registered bloggers can also react on others blog. They can react like, love, sad, haha, informative to blogs
  • unregistered public users can read blogs but can't comment or react n blogs
  • Blogs of a particular category can be viewed

Tech used:

Runtime environment

  • Node.js

API for movies & their metadata

  • OMDB API

Database

  • MongoDB

Dependencies

  • bcrypt: ^5.0.1,
  • cors: ^2.8.5,
  • dotenv: ^8.2.0,
  • express: ^4.17.1,
  • http-errors: ^1.8.0,
  • joi: ^17.4.0,
  • jsonwebtoken: ^8.5.1,
  • mongoose: ^5.12.2

How to install & run:

Using Git (recommended)

  1. Navigate & open CLI into the directory where you want to put this project & Clone this project (will be cloned inside myProject folder) using this command.
git clone https://github.com/tazbin/blog-website-backend-nodejs-REST-API.git ./myProject

Using manual download ZIP

  1. Download repository
  2. Extract the zip file, navigate into it & copy the folder to your desired directory

Install npm dependencies after cloning or downloading

npm install

Setting up environments

  1. There is a file named .env.example on the root directory of the project
  2. Create a new file by copying & pasting the file on the root directory & rename it to just .env
  3. The .env file is already ignored, so your credentials inside it won't be committed
  4. Change the values of the file. Make changes of comment to the .env.example file while adding new constants to the .env file.

Run the project

npm start

You can be sure that the server is running by checking this output in the command window

server running at port 3000...
mongodb successfully connected...
mongodb connected...

Press CTRL + C to stop the server.

API endpoints:

Indication

  • Authentication required
  • Authentication not required

User related

Category related

Blog related

About

This project is a blog website & it's backend is a REST API developed using nodejs. This is one of my personal projects. This repo holds the backend code of the project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.2%
  • Shell 0.8%