BrowserDB

After a long, tedious list of failures, suddenly so much has happened my head is spinning...

In the beginning was the new BTEC IT.  And lo, it contained an entire unit on designing and creating database systems (no, not OODBs - education is only just catching up with 1974 :P).

So began the list of failures...

The prospect of teaching sixth form students how to use Microsoft Access made me taste vomit, so I enthusiastically dusted off one of the department's Raspberry Pis and set up a PostGreSQL server with phppgadmin (MySQL has all the hostname guff, and sqlite didn't seem easily multi-user).

Everything went smoothly until... the pi's SD card gave out, losing everything.

So I set it up again, storing the database on a USB drive instead!

Everything went smoothly until... the filesystem kept corrupting, possibly due to overloading the poor little pi.

So I got the students into the habit of backing up their work every lesson!  (They were quite amused that they had to take a dump every lesson before leaving the classroom)

Everything went smoothly until... I got fed up of waiting for fsck every time it corrupted again.

So I took in an old laptop which would stand a better chance of coping with the load.

Everything went smoothly until... I realised how much the students needed a form design and reporting framework.

A quest for a free framework which didn't rely on extra client-side software ensued.  (I didn't want to give IT support more work every time I changed my fickle little mind)

Against the odds, I found one!  I installed it on the apache server already there, and... the laptop didn't have enough RAM to run it. >_<

So I was reduced to going back to Access and suppressing my gag reflex...*shudder*

Everything went smoothly until... I realised Access reporting functionality doesn't actually work.  You want a report that looks exactly like a datasheet?  No problem!  You want a scatter chart?  er...sure...that's er... NOPE.

Sure, the button is there.  The wizard is there too.  You can even choose all the options just like all the helpful web pages tell you.  Access will nod and smile and produce a graph which is almost, but not quite, entirely unlike the graph you wanted.

(Damn, that makes me realise I haven't read Hitchhiker's in far too long - there's my next project)

So anyway - Access is thankfully a bust.

Unless, of course, I fancied messing around with Visual Basic.

F*** that sh**.

So I realised I need a system which:
  • Enables easy manipulation of a database via SQL.
  • Does not rely on extra client-side software.
  • Can produce flexibly formatted reports (including graphs goddammit).
  • Can produce and use flexibly formatted forms.
And thus to the bewildering array of successes over the past couple of days...

I started researching making SVG charts in javascript.  It seems non-trivial but perfectly plausible.

Thence to how php would access PostGres on the server, and thinking about all the POST parameters and guff like that.

Then I found alasql which allows you to run SQL via javascript in a browser without a server.

Sure, I haven't fully thought through how the students will save the data, but alasql does appear to support local import/export.  (Yes, I know, this is going to be the next 'Everything went smoothly until...')

I started scribbling some HTML, CSS and Javascript to run SQL queries typed into a form...

...and it only went and worked!

So I dived head-first into javascript with Github's Atom and the Mocha test framework.  I even found out a lot about Node.js (whilst trying to rid myself of it so everything is browser-friendly).

There's even the possibility that I could get away with making the javascript available on a network share - obviating the need for a server at all.

There's such a long way to go, but the dream of having an in-browser application for students to implement a database dashboard is just too good to give up on.

Comments

Popular posts from this blog

Micro:Bit and SPI display

DCS World with TrackIR under Ubuntu

Cardboard Mock-up of USB Joystick