This repository contains my attempt to create site using Haskell and Snap framework.
I'm novice to Haskell so use code at your own risk.
PREREQUISITES
- Haskell Platform http://www.haskell.org/platform/. I'm using 2012.1.0.0 from Ubuntu 12.04 repositoty.
- Node.js and less compiler http://lesscss.org/
- Closure linter https://developers.google.com/closure/utilities/docs/linter_howto
- Java and Python for Google Closure Compiler.
- MySQL database
BUILD PROJECT
To build project you need these steps:
- Checkout repository
- Import schema from
schema.sql
into your database - Configure database access in
src/Config.hs
- Setup cabal if you didn't do that earlier:
cabal update
andcabal install cabal-install
- Install project dependencies
cabal install --only-dependencies
. This step may require installation of dev-versions of some libraries (libcurl4-dev, etc.). For Ubuntu you can use this command:sudo apt-get install libcurl4-openssl-dev libmysqlclient-dev
. - In project root run
cabal configure
andcabal build
- The build all required js and css files by running
./build_debug.sh
- Create empty file
config/site_key.txt
:touch config/site_key.txt
- Start server
dist/build/haskell-blog/haskell-blog
That's all.
In development mode Snap framework dynamically rebuild source so all you have to do is refresh page in browser. And Google Closure Library doesn't require building in development mode. Using uncompressed less files is not yet supported. You have to rebuild them manually by running
./build_styles.js
Please let me know if I've missed something.
BUILD FOR PRODUCTION
- Checkout production branch.
- Comment out
rcp
command in./build.sh
- Configure variables (see below)
- Run
./build.sh
You'll find haskell-blog.tar.lzma in project root. It will contain all required files for running project.
CONFIGURING
There is
src/Config.hs
which contains configuration of your environment.adminLogin
,adminPassword
--- credentials for accessing vault.rackspaceAuthKey
,rackspaceAuthUser
--- you don't plan to use Rackspace CloudFiles you can skip itdisqusApiKey
--- disqus key for syncing comments.
from https://github.com/dikmax/haskell-blog