Git Product home page Git Product logo

blog-website-backend-nodejs-rest-api's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.