Studies of Life

Learning by doing.

Creating your first Web App: tales of a beginner

10 November 2013 by Jim

I have started getting into programming, little by little, first learning a tiny bit of Pascal when I was 16, then, last year, doing the CS106A course from Stanford (I’m a huge fan of professor Sahami, even if I’ve never met him), and now the CS106B follow-up course, which I’m not yet done with. Both are available as iTunes U downloads, which is great if you own an iPad, of course.

However, even though I’ve now invested some considerable time in programming, I have not yet found a particular real-life project to invest my time in and learn actual, practical programming. I’ve finally found a project to work on that will help me with two areas of my life: programming and earning an income.

new project: a subscription-based global stock screener for the new web

As a beginning investor employing the Piotroski screening method, and others, I need to use online stock screeners, but unfortunately none of them are pretty great, and the few that are usable generally only have US stock data, but no European stocks or other regions. That’s a pity, but instead of complaining about it, I’ll try to create my own solution as a web app.

getting the data: Reuters CSV

The first things I needed to find out was how I would get the stock data, because that will be the basic content of the stock screener. I noticed that many current screeners rely on Thomson Reuters in this area, and it seems Reuters offers global and not just US-based data. Perfect! But in what form do they deliver the data? And what would it cost? I have yet to find out, and already contacted support to get an answer. Their online documents indicate that data can be delivered as CSV files, if needed via FTP upload, so that’s a good starting point.

data storage: MongoDB

I’ll get CSV data onto my server (probably hosted on Amazon’s S3 servers later on) and then need to analyse that data and put it into a database to work through it and filter as needed for my screening needs. As a n00b, I initially thought about using MySQL, but then I found out that JavaScript, which will probably be the main motor of the filtering tools, does not directly communicate with MySQL, and therefore needs an intermediate PHP bridge. Since I wanted to keep my learning curriculum as small as initially possible, I wanted to reduce the number of languages I’ll have to get to know deeply, so I looked for an alternative.

Turns out, JavaScript can directly talk to a different, newer database, called MongoDB. A cursory search reveals that MongoDB is faster, easier to adapt and scale, and less demanding in terms of server resources. We have a winner!

server-side JavaScript with Node.js

Since I will have to learn JavaScript to provide a filtering / screening app without Flash or Java, I could see if the other areas of the project cannot also be done via JavaScript. Apparently, they can. I’ll need to do some server-side processing to get the CSV stock data into my database. Node.js is JavaScript for the server, and meets that need perfectly. I’ve also read up on AngularJS by Google, which is apparently great and highly efficient for templating a website. I’ll have to see if this fits my needs for the screener later on, but it’s definitely interesting.

the classical web app model

Even though I’ve just talked about using JavaScript server-side, the classical web app model actually works like this: the server-side code is PHP + MySQL, while the client-side relies on HTML/CSS + JS.

RESOURCES I’ve used to get an initial feel for some concepts: 


Leave a comment | Categories: Coding | Tags: , , , , , , ,

Leave a Reply