Search


Rss feeds
Posts Comments Source Code
Rating
Image to SpectrogramNontransitive DicecheaTorrentDomain ColoringiMac G5 CPU Fan view all...
Recent
Pretty GraphHypernova EngineEmergent FeedbackSDL Euclid OrchardSingularity Viewer view all...
Tags

All source code released under the BSD License unless otherwise specified
© 2010, Gavin Black

Haskell Backend Website

Overview

My brand new site, that has an entirely Haskell based backend (Using the Snap Framework). I still have several little features I want to add, but the core of it is complete. As far as I know this is the first Snap site that allows real-time comments and dynamic posts. Most of the real difficulty I had was dealing with Hexpat (and indirectly Heist) limitations, that are probably resolved as of the time of this writing.

Features

  • Strongly typed comments (Using Prelude.read and rebuilding through Hexpat), meaning no possible injection attacks (I hope)
  • Completely git controlled (with ssh), meaning no need to explicitly deal with permissions, and automagic hooks for rebuilding and publishing
  • JQuery plugins for doing popup images, image scrolling, and some of my own code for comment boxes and list navigation
  • Haskell serialized data structures for everything (Not sure if this is a benefit over Mongo or Couch, but it works so far)
  • Can handle multiple sites based on how it's called (ie. What domain name is used to get to that IP address)
  • Negative captcha that tries to detect if a comment is from a robot, instead of a normal captcha which tries to verify it is from a human

Source Code

Source Tree: http://devrand.org:8080/cgi-bin/cgit/haskellSite/tree/
Snapshots: http://devrand.org:8080/cgi-bin/cgit/haskellSite/commit/
Git Access: git clone http://devrand.org:8080/git/haskellSite

What's Left

  • The code needs a major overhaul, I wrote it without any real design and was still pretty new to Haskell when I originally started
  • Need to make a ton of administration tools, currently I can't even change a post without actually doing it in the datastore
  • Better Maybe handling instead of just abusing the hell out of fromJust
  • Comment validation
  • A monad for converting comments with markdown annotation to Hexpat nodes
  • Need to port Crafty-Crafts to the new system

Conclusion

I like it so far, and I'm curious if it will hold up in the long run. The Snap framework has been evolving steadily at the same pace as I've been using it, so hopefully I can make the code cleaner and more logically separated over time. Also I'm still not sure how good an idea it was writing my own data storage methods, and am wondering if there are any race conditions or other issues I've overlooked.



Last Edited: 2010-10-28 02:10:47

+ Add a comment