Today let’s try something different. Slack market capital is currently arround 18.92B of dollars.
Why not make persistent chat with chatrooms using some modern open source technologies like Docker for scalability, tornado for webserver, graphql for data exchange and rethinkdb for persistant layer.
The last one is chosen specifically to produce less code cause of change feeds. From all of those technologies I never made graphql subscriptions and never used rethinkdb in my life and it’s going to be interesting.
Let’s start with set up backend environment by creating virtualenv and adding dependencies
And then modify basic application to make request to tornado web server.
And of course this example failed due to stupid CORS that can’t be easliy disabled for development purposes. Thank you browser vendros for loving backend developers they love you to.
To obey it I need to extend TornadoGraphQLHandler from example so my base server looks like that.
And I have this nice basic output.
Ok so now it’s time to setup some database. I won’t install it locally but use docker and I will also create docker-compose file right away so I can configure my frontend and backend there later.
I got lucky because there is official RethinkDB docker image so I can just use it. Unfortunately there is no documentation on hub website where it’s storing data so I needed to look inside Dockerfile of this container to know where to mount my volume and what ports I want to expose.
So my compose yaml file with only one service for now looks like that
It worked from first try and I could see web admin interface.