Sample web application using compojure and clj-record libs
JavaScript Clojure CSS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
resources/public
src/clj_record_blog
test/clojure_blog/test
.gitignore
README
project.clj

README

= clj-record-blog

This is a sample web application for a blog implmeneted with Clojure and clj-record (ORM library).

== Installation

First you have to configure the database:

1) Have to create a database on MySQL server

  $ mysqladmin -u<username> -p<password> create <db-name>

2) Set your username/password for the database an site on the src/clj_record_blog/config/db.clj

    # config/db.clj
    (def *user-name* "<site-username>")
    (def *password* "<site-password>")

    (def *db-host* "localhost")
    (def *db-port* 3306)
    (def *db-name* "<db-name>")
    (def *db-user* "<db-username>")
    (def *db-password* "<db-password>")

3) Install project's dependencies.

  $ lein deps

4) Create database schema

  $ lein repl
  user=> (use 'clj-record-blog.db.migrate)
  nil
  user=> (create-blog)
  (0)
  user=>
  [Ctrl+D] (to exit from REPL)

5) Run the server.

  $ lein ring server

== Usage

That's it. Now you can visit the site at http://127.0.0.1:3000.

Notice that you need to be logged-in in order to publish a post.

Just use use the site-username/site-password pair you previously set on step 2, and then you'll be able to create a post.

== License

Copyright (C) 2010

Distributed under the Eclipse Public License, the same as Clojure.