Code Monkey home page Code Monkey logo

topblogger's People

Contributors

ashishgoyal21 avatar asifmohd avatar jeffdonthemic avatar jiangzhihui avatar lanchongyizu avatar mhikeo avatar panoptimum avatar sgodwin424 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topblogger's Issues

Implement authentication & security with OAuth2 - $250

Implement OAuth2 authentication and security for the api so that it can be used eventually by the web app and by developers adding routes to the API. Make sure you include documentation so that other developers can implement your security with their routes. The explanation should be clear and easy with sample code.

We will eventually have a web UI for this API and some routes will require public access. For instance, users should not be required to login to view the list of blog, search blogs, filter blogs (trending, etc) read blogs. Some functions like upvote, downvote and commenting will require the user to be logged in.

However, if you need to perform any admin functions (create new blog, edit your blog, etc.) that will require a login.

What's the best way to accomplish this functionality with the API?

GET /blogs - $300

This method returns the blogs that matches any number of filters.

Submission must include mocha test to ensure at least (if not more) the following are returned by:

  1. handle
  2. handle & slug
  3. two or more tags
  4. title
  5. keyword
  6. published date range (e.g., all blogs published from 2/1 - 4/1 with an optional author handle)

All results must support pagination and optional sortBy filters and sortType filters.

POST /blogs - $50

Creates a new blog record with the blog info submitted. This method should create a new slug based upon the title and default appropriate numeric fields (numOfUpVotes, etc) to 0.

POST /blogs/{id}/comments - $25

This method will add a comment for the blog. Comments do not have any sort of hierarchy and can simply be pushed onto the array of comments.

POST /blogs/{id}/view - $25

This method will mark a blog as viewed by current user. A blog can be marked as viewed by the same user for at most once. The current user should not be the author of blog.

PUT /blogs/{id} - $75

This method will update a blog record. It can only be done by the author of blog.

DELETE /blogs/{id} - $50

This method will delete a blog by ID. It can only be done by the author of blog. Both of published or unpublished blogs can be deleted.

Add 200 mocha test for /api/secret

Thanks for adding all of the test for you api routes! Awesome!! Can you add a quick test that other users can follow that shows how to return a 200 for /api/secret?

POST /blogs/{id}/upvote - $25

This method will up-vote a blog by current user. A blog can be up-voted by the same user for at most once. The author of blog cannot vote for the his/her blog.

POST /blogs/{id}/votes/downvote - $25

This method will down-vote a blog by current user. A blog can be up-voted by the same user for at most once. The author of blog cannot vote for the his/her blog.

$150 - Define Object Model

Create all of the models as specified in the Swagger file. There is a placeholder model to get you started in /models/Blog.js. Make sure you use embedded documents where appropriate like comments, etc.

One thing to note and might need to be fixed (not sure if it is important), the Swagger API uses "id" while MongoDB uses "_id".

For the Blog model, when a new record is created, it should automatically slugify the title and save it as the slug.

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.