{"id":125,"date":"2016-06-18T14:21:00","date_gmt":"2016-06-18T14:21:00","guid":{"rendered":"http:\/\/www.chozabu.net\/blog\/?p=125"},"modified":"2016-06-21T21:23:03","modified_gmt":"2016-06-21T21:23:03","slug":"represent-me-and-various-other-things","status":"publish","type":"post","link":"http:\/\/www.chozabu.net\/blog\/?p=125","title":{"rendered":"Represent.me, and various other things"},"content":{"rendered":"<p>As many people reading this are probably aware &#8211; <a href=\"http:\/\/voteflow.net\">VoteFlow<\/a> is on hold indefinitely.<\/p>\n<p>Because I am working on <a href=\"http:\/\/represent.me\">Represent.me<\/a>\u00a0with <a href=\"http:\/\/eddowding.com\">Ed Dowding<\/a>\u00a0&#8211; similar enough for me to be happy to work on it, and similar enough for Ed to be impressed by my work on VoteFlow and ask me to become Represents CTO.<\/p>\n<p>Initially, I was working on the &#8220;old&#8221; version of Represent &#8211; Represent.cc, which was written in Node.js and backed by Mongo. I&#8217;ve a few good things to say about node &#8211; runs fast, fairly clean async code &#8211; but for Mongo I have no such positive comments. It lacks real relational data, encourages _massive duplication_ as an awful solution to this issue, and all around feels like a bit of a joke, except in a few very rare niche situations.<\/p>\n<p>That, and a collection of non-trivial security issues led us to re-build the system.<\/p>\n<p>Happy with the idea of Postgres as our main DB, there was quite a bit of consideration as to if we should stick with node. I eventually pushed the good ponts of Django and Django-Rest-Framework (in particular djangos\u00a0slick ORM and easy\/stable migrations, some existing code pastable from VoteFlow) hard enough for us to pick that as the foundation for the next version of represent!<\/p>\n<p>This is a decision I have often look on with contentment, nearly to the point of smugness. Often there has been situation which could have been hard, made easy by the great dev support of python\/django &#8211; and the exact library needed to help us on our way.<\/p>\n<p>Being the sole backend-dev\/sysadmin and managing and working with our frontend team along with several other roles has been tough &#8211; but we are a startup, everyone has several tough roles \ud83d\ude42<\/p>\n<p>Sometimes working in a team can be hard, but we tend to deal with issues that arise in a practical, mature and efficient manner.<\/p>\n<p>On another note, the main reasons I created VoteFlow were to try out:<\/p>\n<ol>\n<li>Liquid Democracy (pick a representative for a specific topic\/location\/other)<\/li>\n<li>Voteable Tags (voting on tags massively increases their utility)<\/li>\n<li>Democratic driven development (people vote on features\/changes they want)<\/li>\n<\/ol>\n<p>All of which worked very well indeed! but have\u00a0yet to get to the top of our &#8220;ToDo&#8221; list. Saying that, the other weekend I quietly implemented most of the backend for Liquid Democracy.<\/p>\n<p>Having said that, we do quite a few thing VF did not, including a slick UI, nice stats, detailed comparisons and geographic areas.<\/p>\n<p>For anyone wondering about our stack, Our frontend is served by nginx in production, and Django mediated by UWSGI &#8211; which also looks after prerender and celery.<br \/>\nHere are a few select libs, straight out of our requirements.txt<\/p>\n<pre>Django\r\ndjangorestframework\r\ndjangorestframework-filters # provides a secure client-queryable filter\/query system\r\ndjango-mass-edit # to change a large number of items in admin at once\r\ncelery # concurrency - one of the things I miss about node (though, future python versions should solve this)\r\nPillow # image generation\r\ndjango-ajax-selects\r\ndjango-cors-headers # makes it easy to make our API accessable to others\r\ndjango-dbbackup # easy backup\/restore\r\ndjango-debug-toolbar # handy for debugging\/performance\r\ndjango-dual-authentication # login using email\r\ndjango-push-notifications # push notifications to Android\/IOS, looking to send some updates upstream\r\ndjango-redis-cache\r\ndjangorestframework-gis\r\ndjoser # an authentication framework\r\ndjrill # send emails\r\nmysociety-django-popolo # import political data! I'm working with MySociety on improving this\r\npython-social-auth # makes connecting with FBoogle easier\r\npytz # practical timezone support for dates\r\nredis\r\nrequests\r\nrest-framework-generic-relations\r\nrest-social-auth\r\nuWSGI<\/pre>\n<p>A few interesting django\u00a0projects\u00a0for anyone else on a similar path:<\/p>\n<ul>\n<li>Disqus<\/li>\n<li>Pintrest<\/li>\n<li>Instagram<\/li>\n<li>Bitbucket<\/li>\n<\/ul>\n<p>Looking at information from the developers of these systems was a fantastic help in designing represent to work reliably and fast.<\/p>\n<p>Ultimately &#8211; I think the global solution to our &#8220;Democratic Deficit&#8221; should be a decentralised system. Something between Represent, RetroShare, BitTorrent and perhaps BitCoin &#8211; and I look forwards to crossing that bridge when we arrive at it.<\/p>\n<p>All in all, it feels like we are actually on a path towards upgrading democracy<\/p>\n<p><a href=\"http:\/\/www.chozabu.net\/blog\/wp-content\/uploads\/2016\/06\/upgradingdemocracy.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-128\" src=\"http:\/\/www.chozabu.net\/blog\/wp-content\/uploads\/2016\/06\/upgradingdemocracy.png\" alt=\"upgradingdemocracy\" width=\"282\" height=\"204\" srcset=\"http:\/\/www.chozabu.net\/blog\/wp-content\/uploads\/2016\/06\/upgradingdemocracy.png 282w, http:\/\/www.chozabu.net\/blog\/wp-content\/uploads\/2016\/06\/upgradingdemocracy-207x150.png 207w, http:\/\/www.chozabu.net\/blog\/wp-content\/uploads\/2016\/06\/upgradingdemocracy-150x109.png 150w\" sizes=\"auto, (max-width: 282px) 100vw, 282px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As many people reading this are probably aware &#8211; VoteFlow is on hold indefinitely. Because I am working on Represent.me\u00a0with Ed Dowding\u00a0&#8211; similar enough for me to be happy to work on it, and similar enough for Ed to be impressed by my work on VoteFlow and ask me to\u2026<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"http:\/\/www.chozabu.net\/blog\/?p=125\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":128,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all"],"_links":{"self":[{"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125"}],"version-history":[{"count":10,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":138,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions\/138"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=\/wp\/v2\/media\/128"}],"wp:attachment":[{"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chozabu.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}