Skip to content

Latest commit

 

History

History
155 lines (97 loc) · 7.24 KB

README.md

File metadata and controls

155 lines (97 loc) · 7.24 KB

AltSchool Badge

Welcome to naija-diary 👋

Version Twitter: jhhornn

A mini blog api that allows you post and follow hot gists going on in the country.

Built with

Javascript Node.js Express.js MongoDB

Clone this repo

git clone https://github.com/jhhornn/naija-diary.git

Install

npm install

Usage

npm run dev

Run tests

npm run test

Run prettier format

npm run format

Requirements

Requirements for the examination project
  • Users should have a first_name, last_name, email, password,

  • A user should be able to sign up and sign in into the blog app

  • Use JWT as authentication strategy and expire the token after 1 hour

  • A blog can be in two states; draft and published

  • Logged in and not logged in users should be able to get a list of published blogs created

  • Logged in and not logged in users should be able to to get a published blog

  • Logged in users should be able to create a blog.

  • When a blog is created, it is in draft state

  • The owner of the blog should be able to update the state of the blog to published

  • The owner of a blog should be able to edit the blog in draft or published state

  • The owner of the blog should be able to delete the blog in draft or published state

  • The owner of the blog should be able to get a list of their blogs.

  • The endpoint should be paginated

  • It should be filterable by state

  • Blogs created should have title, description, tags, author, timestamp, state, read_count, reading_time and body.

  • The list of blogs endpoint that can be accessed by both logged in and not logged in users should be paginated:

    • default it to 20 blogs per page.

    • It should also be searchable by author, title and tags.

    • It should also be orderable by read_count, reading_time and timestamp

  • When a single blog is requested, the api should return the user information (the author) with the blog. The read_count of the blog too should be updated by 1

  • Come up with any algorithm for calculating the reading_time of the blog.

  • Write tests for all endpoints


Setup

  • Install Node.js, MongoDB
  • pull this repo
  • Create a .env file in the config folder and add and update all variabes present in the example.env file.

Base URL

https://naija-diary.cyclic.app


Readme Guides

This project was made possible by:

Author

👤 Awosise Oluwaseun