Giter VIP home page Giter VIP logo

cow-blog's Introduction

cow-blog 0.2.0

by Brian Carper

This is a(nother) complete rewrite of my blog engine, written in Clojure using Compojure and PostgreSQL.

Version 0.1.0 of this code used Tokyo Cabinet. I ran it that way successfully for a year in hobby-production, but I don't advise you to do the same. There were issues with thread-safety and stability and it was a huge hack / proof of concept. Use it at your own risk.

Version 0.2.0 currently depends upon a highly experimental ORM-ish library called Oyako which I'm building at the same time I build this blog engine.

Purpose

This code runs my hobby-website. Its purpose is to teach me how to write webapps in Clojure, and to have fun while doing so.

The intended audience for this code is a knowledgeable Clojure programmer. User-friendliness is almost entirely lacking. Users posting comments might get semi-helpful error messages when (not if) something breaks, but as an admin, you'll get stacktraces.

Get the picture? I wouldn't use version even 0.2.0 of this code for anything you make money from. But it might be fun to play with.

Features

  • Post tags, categories, comments
  • Archives, with gratuitous tag cloud
  • Markdown
  • Gravatars
  • RSS
  • Lame spam filter
  • Add/edit/delete posts/tags/categories via admin interface
  • SyntaxHighlighter

Getting started

Clone this git repo, then cd into the directory and:

lein deps

Edit src/blog/config.clj to your tastes.

Look at (and run) blog.db.postgres.clj/init-db-postgres to create the tables in your database.

Use blog.db/create-user to create an admin user, or you'll never be able to do anything.

Once your tables are set up, then do this:

(require 'blog.server)
(blog.server/start)

Deploying

Right now I deploy this by running Emacs in SLIME. This is less than ideal. Doing it WAR-style is a possibility in the future. (Patches welcome.)

I use Apache to proxy to a running Jetty server. Documentation possibly forthcoming, or read here for an out-of-date writeup of my general strategy.

Bugs

Bugs are a certainty.

For bug reports, feedback, or suggestions, please open an issue on github.

LICENSE

See the LICENSE file.

Changelog

  • June 20, 2010 - Rewrite again? No more Tokyo Cabinet. Now uses Postgres. Cows still missing.

  • October 22, 2009 - Rewrite from scratch. No more CRUD. Tokyo Cabinet. Removed cows.

  • April 12, 2009 - Updated to work on Compojure's bleeding-edge "ring" branch. Complete rewrite of the CRUD library. Overhauled mostly everything.

  • March 27, 2009 - Initial release.

cow-blog's People

Contributors

cdaddr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cow-blog's Issues

bug in blog.utils.pretty-date

(defn pretty-date [date]
  (.format (java.text.SimpleDateFormat. "MMM dd, yyyy")
           (now)))

should be sth like

(defn pretty-date
  ([] (pretty-date (now)))
  ([date] (.format (java.text.SimpleDateFormat. "yyyy MM dd") date)))

Are you planning to incorporate Enlive and/or ClojureQL

hi,
Sorry to sound like a pain, but your blog is sort of turning out to be the canonical webapp to learn/work with Compojure + a database. I was wondering if you are going to continue to work on Oyako, or support the momentum behind ClojureQL ?

Similarly, are you planning on adding any support for things like Enlive (for templating.. i know you use hiccup, but Enlive has the advantage of designer-accessible templates) .

thanks!

create-user instruction in README

This isn't a bug but I'd like to suggest that the README contain these instructions for calling blog.db/create-user:

(require 'blog.db)
(blog.db/with-db
  (blog.db/create-user "user" "password"))

JDBC connection params in blog.config

The DB var in the comment should use :user instead of :username.

diff --git a/src/blog/config.clj b/src/blog/config.clj
--- a/src/blog/config.clj
+++ b/src/blog/config.clj
@@ -42,7 +42,7 @@
   (def DB {:classname "org.postgresql.Driver"
            :subprotocol "postgresql"
            :subname "//localhost/blogtest"
-           :username "blogtest"
+           :user "blogtest"
            :password "blogtest"})

   ;; MySQL

Running with GAE

It can be usefull to replace direct Tokio Cabinet support with selectable storage plugin. JPA/JDO and/or low-level BigTable support can be one of them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.