Thursday, April 18, 2013

Project Progress

I'm working on a web app that will create printable (pdf) math tests.  My tech stack:
  • Server (WAMP for dev - very easy setup!, Ubuntu server on Amazon Cloud for prod)
    • PHP - I originally tried Django, but the user community seems a lot smaller than the community around PHP.  Also, it seemed like it was better designed for sites that host a large number of pages (like newspapers) rather than single page web apps like what I wanted to do.  Also, I tried to implement some simple AJAX and it was taking FOREVER... switched to PHP and I had AJAX going in under 30 minutes
    • MySQL - it would be nice to have a database that could easily store JSON, but I don't have time to investigate whether switching to MongoDB or similar would work
    • pdflatex - for creating pdf files with equations.  I spent a lot of time investigating whether it would be possible to create word documents (easier for the end user to edit) but eventually decided that there was no easy way to do this.  On my windows PC I'm using MikTex.
  • Client
    • Twitter Bootstrap - used to make things look semi-professional.
    • AngularJS - Used because the two-way data binding greatly reduces and simplifies my JavaScript code.  Before I made the change to Angular I was writing code to create the HTML, then go an write separate code to update the corresponding JSON.
    • JQuery or AngularUI - I haven't figured out yet whether I will need these
  • Other
    • Asymptote SVG - the dominant open source tool that allows you to problematically create publication quality mathematical images 
    • Payments - Stripe looks like the best in terms of cost and easy of use, but I haven't investigated this that much yet
    • Login system - I'm using Angry Frog's PHP login script
General Design
  • All of the logic for creating the math questions (using random numbers) happens on the server side.  I originally was doing with JavaScript on the client, but changed for the following reasons:
    • Preventing others from stealing my code
    • Future enhancement idea - entire test can be regenerated based on existing questions with new random numbers and a new pdf file can be created.
    • Code itself seems less messy this way
    • PHP page can automatically generate a set of all sample questions in JSON form all in one shot - nice for testing
Issues
  • Getting MathJax to play nicely with AngularJS.  I posted a question on StackOverflow.