Giter Site home page Giter Site logo

readable's Introduction

Readable Porject

This simple readable app allows you to to post content to predefined categories, comment on posts and other users' posts, and vote on posts and comments. Users will also be able to edit and delete posts and comments.

Install and Run App

npm install npm start

Backend Server

ReadableAPI.js contains the methods you will need to perform necessary operations on the backend. Instrctions of installing backend server can be found at this repository.

getCategories()

  • Usage: Get all of the categories available for the app.
  • Returns a Promise which resolves to a JSON object containing all of the categories available for the app.

createPost(body)

  • Usage: Add a new post

  • body: Object containing: -id: <String> -timestamp: <Integer> -title: <String> -body: <String> -author: <String> -category: <String>

  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

readAllPosts()

  • Usage: Get all of the posts. Useful for the main page when no category is selected.
  • Returns a Promise which resolves to a JSON object containing all of the posts available for the app.

getPostsByCategories(category)

  • category: <String>
  • Returns a Promise which resolves to a JSON object containing all of the posts filtered by category.

readPost(id)

  • Usage: Get the details of a single post
  • id: <String>
  • Returns a Promise which resolves to a JSON object containing detail of a single post.

editPost(id,body)

  • Usage: Edit the details of an existing post
  • id: <String>
  • body: Object containing: -title: <String> -body: <String>
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

deletePost(id)

  • Usage: -Sets the deleted flag for a post to 'true'. -Sets the parentDeleted flag for all child comments to 'true'.
  • id: <String>

updateVote(id,body)

  • Usage: Used for voting on a post
  • id: <String>
  • body: Object containing: -option: <String> -option either "upVote" or "downVote"
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

readAllComments(id)

  • Usage: Get all the comments for a single post
  • id: <String>
  • Returns a Promise which resolves to a JSON object containing all of the comments related to the post.

createComment(body)

  • Usage: Add a comment to a post
  • body: Object containing: -id: <String> -timestamp: <Integer> -body: <String> -author: <String> -parentId: <String>
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

readComment(id)

  • Usage: Get the details for a single comment
  • -id: <String>
  • Returns a Promise which resolves to a JSON object containing all of the detail of a single comment.

editComment(id,body)

  • Usage: Edit the details of an existing comment
  • -id: <String>
  • body: Object containing: -timestamp: <Integer> -body: <String>
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

updateCommentVote(id,body)

  • Usage: Used for voting on a comment.
  • id: <String>
  • body: Object containing: -option: <String> -option either "upVote" or "downVote"
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request.

deleteComment(id)

  • Usage: Sets a comment's deleted flag to 'true'
  • id: <String>

Feel free to change your proxy to your local api server in package.json

readable's People

Contributors

jiqisun avatar

Stargazers

Любосвет Лавров avatar

Watchers

James Cloos avatar  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.