Giter Club home page Giter Club logo

blog_api's Introduction

BLOGGING API

This is an API for a blogging app


Requirements

  1. Users should have a first_name, last_name, email, password
  2. A user should be able to sign up and sign in into the blog app
  3. Use JWT as authentication strategy and expire the token after 1 hour
  4. A blog can be in two states; draft and published
  5. Logged in and not logged in users should be able to get a list of published blogs created
  6. Logged in and not logged in users should be able to to get a published blog
  7. Logged in users should be able to create a blog.
  8. When a blog is created, it is in draft state
  9. The owner of the blog should be able to update the state of the blog to published
  10. The owner of a blog should be able to edit the blog in draft or published state
  11. The owner of the blog should be able to delete the blog in draft or published state
  12. 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
  13. Blogs created should have title, description, tags, author, timestamp, state, read_count, reading_time and body.
  14. 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
  15. 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
  16. Come up with any algorithm for calculating the reading_time of the blog.
  17. Write tests for all endpoints

Setup

  • Install NodeJS, mongodb
  • pull this repo
  • run npm install to install all dependencies
  • update environment variables with example.env file
  • run npm run start

Base URL

Models


User

field data_type constraints
first_name string required
last_name string required
email string required, unique
password string required

Article

field data_type constraints
title string required, unique
description string
state string enum: ['draft', 'published']
tags [string]
body string required

APIs


You can view the Postman API documentation HERE

Contributor

  • Kehinde Adedokun

blog_api's People

Contributors

hi-heavens avatar

Watchers

 avatar

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.