100 Days of Code – What Does it Look Like at Day 11

Stoltzmaniac Fans – It’s time for a #100DaysOfCode update.

I have completed 11 days of the challenge. Let me tell you, it has been a blast and I have already learned a lot. In this post I’ll walk you through what I’ve done thus far. Here is a link to the code on my GitHub repository.  

As you may recall from my previous post I set out to create a flask application to host data science projects for the Meetup group that I organize (Fort Collins Data Science Meetup). My goal is to provide people with an outlet to run code online where they will get the benefits of having a server and a dynamic UI. This will improve the group’s collaboration and Git skills along with allowing people to showcase their work without having to build infrastructure. In case you’re wondering, I built this using Docker Compose, Flask, NGINX, PostgreSQL, and MongoDB.

In order to keep from boring myself to sleep while writing this, I’m going to keep it short and to the point. You might be asking, “what does this application look like?” That’s a great question. It’s a normal website where people contribute Python scripts to do some sort of data processing or analysis. For example, here’s a word cloud generator where the user inserts a Twitter handle with a link to a logo of some sort and then a word cloud is created from all of the most recent tweets! Here is @realdonaldtrump as the Republican elephant and @barackobama as the Democrat donkey.

 

 

 

 

 

 

 

 

 

 

 

 

 

Cool, right? While this type of stuff is all over the internet, none of it lives in a web application to allow for user interaction (until now).

My 11 Day Summary

  1. Setup Flask application with Travis CI and Coveralls.io
  2. Add MongoDB as a secondary database and connect to Twitter API
  3. Store user Twitter search data in MongoDB
  4. Create data visualization and build Blueprint for other people to contribute code
  5. Make it easier for others to contribute data sources
  6. Create examples of easy things to build
  7. Deploy the darn thing!
  8. Deploy the darn thing (again)!
  9. Switch everything to Docker Compose
  10. Add NGINX and deploy the darn thing!
  11. Add a fun word cloud page

I can summarize my experience so far with two adjectives: valuable and frustrating. Honestly, I thought the hardest part of this challenge would be making it work with my schedule. The reality is, it hasn’t destroyed my schedule too much, so long as I get up earlier than usual and focus during those early hours of the morning. The most valuable part has been seeing tremendous growth in my skills and the frustrating part is seeing the lack of growth in my skills! That sounds ridiculous… and it is! I found myself getting back to loving the Python language and learning new tricks with Flask but I absolutely crushed my spirit when I realized my Docker skills were not up to par. I used to think, “this Docker thing isn’t too bad.” I was wrong. It’s brutal. Anyone who tells you otherwise is probably just trying to make you ruin a weekend, week, or decade learning it. Here’s a chart of my comfort level from 0 to 10 of a few skills in this project.

As you may notice, there’s a strong sense of “yeah, I got this” up until day 8. That’s when the proverbial 💩 hit the fan. I was absolutely crushed by how difficult it is to take such an amazing cookiecutter template of Flask + PostgreSQL and get it online. I was easily able to add MongoDB (albeit unsecured) but when I tried to put it on Heroku the frustration started. Error after error after error after error… repeat … Heroku is supposed to be the easiest thing ever (it really amazing is if you live in a simple git push heroku world) but it sure wasn’t obvious when it came to using docker-compose.yml with my setup. When day 9 came around I was optimistic that I could get it done if I put it on a $5/mo server running Ubuntu but I failed again! I struggled with getting the proper ports exposed and setting up NGINX in a way to speak with the rest of the app. After quite a bit of tinkering around I finally got the ports to line up and my app was deployed! That got me back out of the hole and into the positive for comfort with Docker.

All of that said, I’m really happy with Docker and Docker Compose. This project and #100DaysOfCode is really great and I’d highly recommend stepping out of your comfort zone to build something during this challenge.

I am keeping notes on the little things that slowed me down and will post a more technical post when I have the tech stack buttoned up. Please feel free to contribute code and build something you’re interested in. You don’t have to live in Fort Collins or be part of the Meetup group just follow the instructions online and make a pull request. Thanks for reading!