We want to build a blogging application for topcoder members and need you to do it for us. We are going to start with the API first and then add the UI. The builing of the API will loosely follow the concepts outlined in this blog post. You may also want to check out this Apigee blog post for more background on the process we will be following for the challenges.
Our first challenge in this series is to design the API with the Swagger Editor using the following narrative guidelines. Interput as best you can and feel free to add or modify the API design whereever you feel it is needed. The best designs submitted wins.
Swagger is code agnostic but if it helps, we'll be using NodeJS and MongoDB later on in the challegnes.
The "Blog" will be our only stand-alone model. It should have the following properties:
- slug (so if the title is "My First Java Post", the slug would be "my-first-java-post")
- date published
- author's topcoder handle
- tags (array of strings)
- content (the actual content of the blog)
- comments (this will eventually be an embedded array to comment objects)
- views (the number of times the blog post has been views)
- votes (the total number of votes received)
Everything is centered around blogs. Any one can view a blog. Once logged in via Oauth, a user can create new blogs, edit their existing authored blogs, comment on blogs and vote on blogs.
Users should be able to mark a blog as inappropriate and vote it up or down (only once). If logged in, they can add a comment and like a comment that is not their own. Comments are not threaded so there is not functionality to comment on a comment. Only comment on the blog.
The API should include but is not limited to the following functionality:
- creating a new blog
- update a blog where the user is the author
- delete an unpublished blog where the user is the author
- get a blog by handle and slug
- get a blogs with pagination
- get newest blogs by published date with pagination
- get trending blogs (most frequently commented on) with pagination
- get most popular blogs (by number times viewed) with pagination
- get blogs by tag with pagination
- add a comment
- like a comment