Skip to content

This is a minimal blog api with some advance features developed using NodeJS, ExpressJS and MongoDB. If you are looking for a free RESTful API to interact with feel free to use this. It's open source.

Notifications You must be signed in to change notification settings

techreagan/blog-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog RESTful API

This is a minimal blog api with some advance features developed using NodeJS, ExpressJS and MongoDB. If you are looking for a free RESTful API to interact with feel free to use this. It's open source.

Features

  • Authentication with JWT (Reset Password with email)
  • User Create, Read, Update and Delete (CRUD) operations
  • CRUD operations for blog post including uploading banner image for post
  • Visitors can leave a comment
  • Pagination and search where necessary
  • API Security (NoSQL Injections, XSS Attacks, http param pollution etc)

API Documentation

Hosted on netlify: Blog API

Extensive and testing documentation with postman: Blog API

Database Model

Though the diagram uses sql data type, this diagram is to show you the various collections in the mongo database.

Screenshot

Requirement

  • NodeJS
  • MongoDB

Configuration File

Modify the config/.env file to your environment variables, set your JWT_SECRET and SMTP variables

NODE_ENV=development
PORT=3001

MONGO_URI=YOUR_URL

JWT_SECRET=YOUR_SECRET
JWT_EXPIRE=30d
JWT_COOKIE_EXPIRE=30

SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=2525
SMTP_EMAIL=
SMTP_PASSWORD=
FROM_EMAIL=[email protected]
FROM_NAME=Boilerplate

Email testing: use mailtrap for email testing, it's easy no stress.

Installation

Install all npm dependecies

npm install

Install nodemon globally

npm install -g nodemon

Run database seeder

  • Seeder folder is _data/
  • Edit the seeder file if you want to
node seeder -i

Delete all data

node seeder -d

Start web server

node run dev

License

This project is licensed under the MIT License

Developed by Reagan Ekhameye (Tech Reagan)

Reach me on twitter @techreagan

About

This is a minimal blog api with some advance features developed using NodeJS, ExpressJS and MongoDB. If you are looking for a free RESTful API to interact with feel free to use this. It's open source.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published