1UP : Community routes (Create Update Delete)

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@stoodkev·
0.000 HBD
1UP : Community routes (Create Update Delete)
<div><p><img src="https://steemitimages.com/0x0/https://cdn.steemitimages.com/DQmdxu3XEBifqSDbCrRqmjkVk8FaFMBRyJwv8LdiAXw7wsZ/image.png"></p>
<h4>Repository</h4>
<p><a href="https://github.com/therealFlauwy/1UP" rel="noopener" title="This link will take you away from steemit.com">https://github.com/therealFlauwy/1UP</a></p>
<p>Following this <a href="https://steemit.com/utopian-io/@flauwy/developer-wanted-for-the-1up-curation-system-with-smt-bounty">post</a> from <a href="/@flauwy">@flauwy</a>, I've been tasked to start the creation of the new 1UP.<br>
As a reminder, <a href="/@utopian-1up">@utopian-1UP</a> was an Utopian bot front-runner in which members of the community would decide which are the best posts to vote for. the <a href="/@utopian-1up">@utopian-1up</a> would then vote for the best post every 2.4 hours, followed by hundreds of curators in the trail.</p>

<h3>New Features</h3>
<h4>Create, Modify and Delete Community</h4>

These three operations can now be performed on the same `/community` route.

There won't be graphic illustrations of what I m talking about here since it mostly concerns the back end.
I modified the existing `Create` method, which is in a `Post` route, in order to let it create a new community if there is no ID passed along, and to update the community if it comes with an ID.

This was accompanied by changes on the correponding `.ejs` views, in order to send the relevant data for the community to be created or updated.

The community route also accepts a `delete` HTTP request, in which case, after checking that the user has the proper right to do so, the community is removed from the database. On the frontend, this is obviously accompanied by a confirmation button in order to make sure that the community is not deleted accidentally.

This post is pretty short as there is never that much to say about backend developement.

### Future work

- Adding the possibility to add more than one trail account
- Fetch the posts the post corresponding to the community criteria
- Display these posts and allow 1UP votes on it 
- Vote on the best post of the period

<h3>Live Demo</h3>
<p>As a demonstration speaks more than lots of words, I ve put back online the old Utopian1UP website. You can try by yourself and create a community and link a trail to it for testing purposes.<br>
No votes will be casted do not worry, but it's an offline token so, for safety reasons, I would recommend using a test account.</p>
<p><a href="https://utopian-1up.herokuapp.com" rel="noopener" title="This link will take you away from steemit.com">Live Demo</a></p>
<h4>Pull Request</h4>
<p><a href="https://github.com/therealFlauwy/1UP/pull/46" rel="noopener" title="This link will take you away from steemit.com">Create Update and Delete Communities</a></p>
<h4>GitHub Account</h4>
<p><a href="https://github.com/stoodkev" rel="noopener" title="This link will take you away from steemit.com">https://github.com/stoodkev</a></p>
</div>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,