create account

Introducing Utopian.rocks by amosbastian

View this thread on: hive.blogpeakd.comecency.com
· @amosbastian · (edited)
$72.30
Introducing Utopian.rocks
The last few days I have been working on a web application for some additional information about Utopian.io. If it wasn't obvious from the name, I was inspired by @emrebeyler and his many amazing projects (go check them out!) to create something that actually uses Flask *and* MongoDB!

I'm currently hosting it on a droplet with 500MB RAM, so I'm not sure how robust it is, but you should be able to access it by going to [utopian.rocks](http://utopian.rocks/).

### What is it about?
The project is mainly about providing some useful information that isn't (currently) readily available on Utopian.io. I already created [a CLI](https://utopian.io/utopian-io/@amosbastian/new-release-utopian-cli-0-5-2) that could do a few of these things, but I realised that not a lot of people like using CLIs like I do, so creating a web application would be way more useful. Currently it shows an overview of all Utopian.io supervisors, with a button that takes you to a page with their team's performance in the last 7 days. I created this because I thought it would be useful for Utopian.io supervisors to quickly see an overview of how their team is doing - especially during the supervisors weekly. In the GIF below you can see it in action, but you can obviously also check it out yourself by going to [utopian.rocks](http://utopian.rocks/)!

<center>![utopian.rocks.overview.gif](https://res.cloudinary.com/hpiynhbhq/image/upload/v1520168095/igeoks5fcanynqnwo3rb.gif)
</center>

### How was it implemented?
It was implemented using

* Python3.6 (Flask, Gunicorn, PyMongo and more)
* MongoDB
* NGINX
* Bootstrap

The first thing I did was figure out how to use MongoDB. Since I had never used it before, I checked out @emrebeyler's [utopian_data](https://github.com/emre/utopian_data) to see how an example of how it would be implemented. Unfortunately I know nothing about Go either, but after checking it out for a while and following [this tutorial](http://api.mongodb.com/python/current/tutorial.html) I (sort of) understood how to use PyMongo to do something similar. If you have a MongoDB instance running, then you can simply run `update_database.py`, which (by using `utopian_client.py`) should create a database called `utopian` with the collections `moderators` and `posts`. If you run `update_database.py` after this, then it should only update the posts that could've changed (created < 7 days ago). This can probably be done better, but as I said, I'm completely new to this, so I will learn and improve this along the way.

<center>![update_database.gif](https://res.cloudinary.com/hpiynhbhq/image/upload/v1520084981/cfkgqis2c4ymmqs3wleg.gif)
</center>

After figuring this out, I started creating the web application using Flask. Currently `app.py` creates a dictionary with information retrieved from the database that contains a team's overall performance and each moderator's performance per category respectively, and passes this to the template. This is then used to create the tables that you see on `/<supervisor>/team`. The `/` route currently shows an overview of all Utopian.io supervisors, with a button to their team's performance. The supervisors are sorted by the size of their team (the number on the button), and this also implemented in `app.py` and `index.html`.

Of course the templates themselves were created using Jinja2, HTML, CSS and Bootstrap. Honestly this took way longer than it should have, as I am very bad at everything CSS related.

After implementing everything I added it to a droplet, where it is running as a service using Gunicorn and NGINX. I also have a crontab set up that currently updates the database every 30 minutes (at the bottom of the page it shows the most recent time (CET) a post in the database was reviewed). Finally I bought the domain name utopian.rocks, and after a few hours of tinkering, managed to finally get it linked to my droplet (this has been causing me a lot of trouble, so I don't know if it will be up 100% of the time). Of course you can also run it locally (see the [README](https://github.com/amosbastian/utopian/blob/master/README.md) for more information about this).

### What are my plans?
I have so many plans for this, but I'm not sure how feasible many of them are. I'm also sure stuff like this will be implemented (much better than I ever could) by @wehmoen and his team on Utopian.io itself eventually, so I will see how everything goes in the future. Anyway, currently this is what I can think of (let's be a tiny bit ambitious, shall we?):

* Add a way to change the static time frame of 7 days to e.g. 1 day, 12 hours etc.
* Add a page that shows some statistics about the total number of submitted contributions (overall and per category) for a given time frame
* Add a page for each moderator showing their individual performance, a feed of their most recently reviewed posts, other statistics (e.g. who they have reviewed the most) etc.
* Add a page for projects that show statistics about contributions made to it (e.g. best contributor, overall acceptance rate etc.)
* Add a page for contributors to see their individual performance (e.g acceptance rate, who has reviewed their posts the most etc.)

I can think of a lot more things to add, but the above is what I want to focus on for now.

### How can you contribute?
I would love for people to contribute to this (have spoken to a few people already who will probably help me improve UX immensely), so if you want to contribute something it would be great if you contacted me on Discord (Amos#4622) so we can talk about it. As I mentioned above, I'm an absolute numpty when it comes to CSS, so if anyone could help with that, it would be greatly appreciated (I spent hours today trying to create a better table, but finally gave up in the end). Help with PyMongo and Flask would also be greatly appreciated, as I'm probably doing a lot of things wrong regarding them as well. Of course suggestions/tips/constructive criticism are also very welcome!

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@amosbastian/introducing-utopian-rocks">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 98 others
properties (23)
authoramosbastian
permlinkintroducing-utopian-rocks
categoryutopian-io
json_metadata{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":123324842,"name":"utopian","full_name":"amosbastian/utopian","html_url":"https://github.com/amosbastian/utopian","fork":false,"owner":{"login":"amosbastian"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","steemdev","utopian","rocks","programming"],"users":["emrebeyler","amosbastian","wehmoen"],"links":["http://utopian.rocks/","https://utopian.io/utopian-io/@amosbastian/new-release-utopian-cli-0-5-2","https://res.cloudinary.com/hpiynhbhq/image/upload/v1520168095/igeoks5fcanynqnwo3rb.gif","https://github.com/emre/utopian_data","http://api.mongodb.com/python/current/tutorial.html","https://res.cloudinary.com/hpiynhbhq/image/upload/v1520084981/cfkgqis2c4ymmqs3wleg.gif","https://github.com/amosbastian/utopian/blob/master/README.md"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1520168095/igeoks5fcanynqnwo3rb.gif","https://res.cloudinary.com/hpiynhbhq/image/upload/v1520084981/cfkgqis2c4ymmqs3wleg.gif"],"moderator":{"account":"ms10398","time":"2018-03-04T14:02:36.711Z","reviewed":true,"pending":false,"flagged":false},"questions":[],"score":null}
created2018-03-04 13:08:33
last_update2018-03-04 14:02:36
depth0
children13
last_payout2018-03-11 13:08:33
cashout_time1969-12-31 23:59:59
total_payout_value51.564 HBD
curator_payout_value20.735 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,167
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,129,162
net_rshares21,658,119,837,998
author_curate_reward""
vote details (162)
@emrebeyler ·
$0.07
Great work Amos! Will try to review and contribute in my free time.
👍  
properties (23)
authoremrebeyler
permlinkre-amosbastian-introducing-utopian-rocks-20180304t154151134z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-04 15:41:51
last_update2018-03-04 15:41:51
depth1
children1
last_payout2018-03-11 15:41:51
cashout_time1969-12-31 23:59:59
total_payout_value0.056 HBD
curator_payout_value0.017 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length67
author_reputation448,535,049,068,622
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,159,060
net_rshares18,548,410,964
author_curate_reward""
vote details (1)
@amosbastian ·
Thanks!
properties (22)
authoramosbastian
permlinkre-emrebeyler-re-amosbastian-introducing-utopian-rocks-20180304t172035926z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 17:20:42
last_update2018-03-04 17:20:42
depth2
children0
last_payout2018-03-11 17:20:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,177,972
net_rshares0
@laxam · (edited)
$0.08
Quite cool to see those stats. Will be even better once your plans are realised (those are some nice ideas). Good job ;)
👍  ,
properties (23)
authorlaxam
permlinkre-amosbastian-introducing-utopian-rocks-20180304t142105125z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"steemit/0.1"}
created2018-03-04 14:21:09
last_update2018-03-04 14:28:42
depth1
children1
last_payout2018-03-11 14:21:09
cashout_time1969-12-31 23:59:59
total_payout_value0.076 HBD
curator_payout_value0.002 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length120
author_reputation4,021,844,514,967
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,143,296
net_rshares19,579,186,722
author_curate_reward""
vote details (2)
@amosbastian ·
Thanks a lot! When I have time I can't wait to implement everything, but unfortunately I have to catch up on some university work...
👍  
properties (23)
authoramosbastian
permlinkre-laxam-re-amosbastian-introducing-utopian-rocks-20180304t142750440z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 14:27:51
last_update2018-03-04 14:27:51
depth2
children0
last_payout2018-03-11 14:27:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length132
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,144,667
net_rshares587,702,928
author_curate_reward""
vote details (1)
@ms10398 ·
$0.08
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/uTyJkNm).

**[[utopian-moderator]](https://utopian.io/moderators)**
👍  
properties (23)
authorms10398
permlinkre-amosbastian-introducing-utopian-rocks-20180304t140304434z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-04 14:03:15
last_update2018-03-04 14:03:15
depth1
children1
last_payout2018-03-11 14:03:15
cashout_time1969-12-31 23:59:59
total_payout_value0.064 HBD
curator_payout_value0.014 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length173
author_reputation27,572,487,973,390
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,139,814
net_rshares19,460,627,897
author_curate_reward""
vote details (1)
@amosbastian ·
That was quick, thanks!
properties (22)
authoramosbastian
permlinkre-ms10398-re-amosbastian-introducing-utopian-rocks-20180304t142645527z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 14:26:45
last_update2018-03-04 14:26:45
depth2
children0
last_payout2018-03-11 14:26:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length23
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,144,444
net_rshares0
@nanzo-scoop ·
Hi Amos - how can I get in contact with you?
properties (22)
authornanzo-scoop
permlinkre-amosbastian-introducing-utopian-rocks-20180304t210329145z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-04 21:03:30
last_update2018-03-04 21:03:30
depth1
children1
last_payout2018-03-11 21:03:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length44
author_reputation304,748,025,353,998
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,214,981
net_rshares0
@amosbastian ·
Hi Nanzo, I'm pretty much always available on Discord (Amos#4622)! Let me know if you'd like to contact me some other way, I'm very flexible.
properties (22)
authoramosbastian
permlinkre-nanzo-scoop-re-amosbastian-introducing-utopian-rocks-20180304t214815739z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 21:48:18
last_update2018-03-04 21:48:18
depth2
children0
last_payout2018-03-11 21:48:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length141
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,221,801
net_rshares0
@oups ·
amos.rocks well I'm not used to use CLI tools but utopian cli just working fine for me. 
Roadmap looking fine, I clicked my name many time, nothing happened :D 
👍  
properties (23)
authoroups
permlinkre-amosbastian-introducing-utopian-rocks-20180304t203912599z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 20:39:12
last_update2018-03-04 20:39:12
depth1
children0
last_payout2018-03-11 20:39:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length160
author_reputation20,674,011,682,802
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,211,168
net_rshares2,911,722,655
author_curate_reward""
vote details (1)
@sambillingham ·
$0.08
Nice work Amos! One thing that I'd find interesting is seeing total pending for different categories and stats like average/longest/shortest review times.
👍  
properties (23)
authorsambillingham
permlinkre-amosbastian-introducing-utopian-rocks-20180304t134744148z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-04 13:47:42
last_update2018-03-04 13:47:42
depth1
children2
last_payout2018-03-11 13:47:42
cashout_time1969-12-31 23:59:59
total_payout_value0.058 HBD
curator_payout_value0.019 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length154
author_reputation34,876,406,478,004
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,136,757
net_rshares19,866,057,645
author_curate_reward""
vote details (1)
@amosbastian ·
$0.04
Hey Sam, thanks a lot! That's also a great idea! I think @wehmoen's website https://utopian.info/ already shows currently pending contributions, but I can definitely add a page showing the statistics you mentioned.
👍  
properties (23)
authoramosbastian
permlinkre-sambillingham-re-amosbastian-introducing-utopian-rocks-20180304t142623441z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/2.4.0"}
created2018-03-04 14:26:24
last_update2018-03-04 14:26:24
depth2
children1
last_payout2018-03-11 14:26:24
cashout_time1969-12-31 23:59:59
total_payout_value0.044 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length214
author_reputation174,473,586,900,705
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,144,372
net_rshares14,099,449,638
author_curate_reward""
vote details (1)
@sambillingham ·
ahh cool didn't know about utopian.info.  Seeing that made me realise how many translations and graphics contributions there are compared to dev :(
properties (22)
authorsambillingham
permlinkre-amosbastian-re-sambillingham-re-amosbastian-introducing-utopian-rocks-20180304t143158077z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-04 14:31:57
last_update2018-03-04 14:31:57
depth3
children0
last_payout2018-03-11 14:31:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length147
author_reputation34,876,406,478,004
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,145,550
net_rshares0
@utopian-io ·
### Hey @amosbastian I am @utopian-io. I have just upvoted you!
#### Achievements
- WOW WOW WOW People loved what you did here. GREAT JOB!
- You have less than 500 followers. Just gave you a gift to help you succeed!
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-amosbastian-introducing-utopian-rocks-20180305t120655945z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-05 12:06:57
last_update2018-03-05 12:06:57
depth1
children0
last_payout2018-03-12 12:06:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,144
author_reputation152,955,367,999,756
root_title"Introducing Utopian.rocks"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id42,363,784
net_rshares0