topcoder-consulting / topblogger Goto Github PK
View Code? Open in Web Editor NEWTopBlogger application
TopBlogger application
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?
This method will publish a unpublished blog. It can only be done by the author of blog.
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:
All results must support pagination and optional sortBy filters and sortType filters.
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.
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.
This method will update a comment. It can only be done by the author of comment.
This method will make a comment as disliked by current user. The author of comment cannot mark the his/her comment as disliked.
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.
This method will update a blog record. It can only be done by the author of blog.
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.
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?
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.
This method will get a blog by ID.
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.
This method will make a comment as liked by current user. The author of comment cannot mark the his/her comment as liked.
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.
This method will delete a comment. It can only be done by the author of comment, or the author of blog.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.