Development Update #4: Write New Post, Trending Posts and Upvote Post
Repository
https://github.com/jrawsthorne/review.app
New Features
#1 Write new post 1 2
Once a user is logged in they can now write a new post and it will be broadcast to the blockchain. It will also be indexed in the database.
On the new post page a preview is shown which live updates with what the post will look like. It supports HTML tags and markdown.
This is the data that is added to the JSON metadata of the post. The id and type are used by the backend to determine what images to show and what show or movie the post is associated with.
When a user adds a new post the author and permlink are sent to the backend API. Here the post is retrieved from the Steemit API and the JSON metadata that was added above is parsed.
Once the post has been added to the blockchain and database the user is redirected to the new post they just wrote.
#2 Trending, hot and active posts with infinite load 1 2 3
The home page now has a selector for the sorting (trending, hot, created, active) and filter (movies, shows, episodes, all).
The main thing that had to be changed was the API. It had to accept the last post that had loaded so it could only search for more posts after that. If the feed is sorted by date the API queries the database directly. The front end sends the creation date of the latest loaded post. The API then searches for all posts matching the criteria created on or before that date and removes the first one as it's the post that was sent to the API and is already loaded on the front end.
If the sort is by trending, for example, the Steemit API has to be queried. It accepts a start_permlink and start_author. This is sent by the front end and added directly to the API call. Again the first post is removed as it's already loaded on the front end.
#3 Upvote a post
If a user is logged in they can now upvote a post from a feed or post page directly. If a post is already upvoted, clicking the upvote button will remove the upvote.
Voting for a post is really easy using the SteemConnect API as can be seen below. Once a new vote has been made the post is fetched again from the steemit API to get the updated information.
Roadmap
- Comments
- Follow users
- Re-brand with dmtv name, logo and colours
Leave Development Update #4: Write New Post, Trending Posts and Upvote Post to:
Read more #utopian-io posts
Best Posts From Jake Rawsthorne
We have not curated any of jrawsthorne's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Jake Rawsthorne
- Introducing a new STEEM frontend: LiveSteem
- Would you use a frontend that functioned like a live chat?
- Something I've been testing out recently
- Querying Hivemind with GraphQL
- Busy 2.5.1 Bug: Duplicate comment when showing more replies from a nested comment page
- Busy 2.5.1 Bug: Edit post button doesn't show the post data in the editor initially
- Development Update #5: Comments, Loading States and Refresh Feeds
- Busy.org Bug: Post with no json_metadata crashes the whole page
- Development Update #4: Write New Post, Trending Posts and Upvote Post
- Test
- Brooklyn Nine-Nine review test
- Deadpool 2 test
- Deadpool test
- test
- Game of thrones test review
- Development Update #3: Updated Design, Recommended, Actors Page and New Post Page
- Carbon - Create and share beautiful images of your source code
- Busy.org: Going back in history takes you to the same post page if you got there from a modal
- Busy.org: Reblogged username disappears when you like a post
- Development Update #2: Ratings, Subscriptions and Profiles