Pure Blog


Welcome to Pure Blog!

This is exciting!

## Intro

My very first Pure Blog post in "prod" deployment.
It took a while to figure out the deployment settings, but it seems to run now.
I had to run DB migrations manually, but that's a minor at the moment.
Although, there's users table, a hard-coded user is used for every new blog post - this user had to be inserted manually too.
There's no authentication and styling is quite rough.
Everything should work and I can finish the documentation.

As regards to this Pure Blog application, it's just the beginning. It's basically MVP with the most essential functionality:
* Listing all posts on the main page.
* Create new post via "New Post" button on the main page
* View details of the page via a link on the main page
* Editing a blog post via "EDIT!" button on the "post detail" page.

## Duct/Integrant

This whole application is built on top of Duct/Integrant microframework.
It was a quite valuable experience to learn about these relatively new things in Clojure ecosystem.
I think they are great and I'd like to use them again in the near future.

### Application Structure

I've found the problem of structuring real-world application one of the most interesting issues that advancing (Clojure) programmer will face.
I like Integrant/Duct's approach which make it very configurable and explicit.
However, almost all functions still have `db` parameter which makes them impure.
I'm not sure if there's a cleaner approach to do this.

## CSS

I used CSS Bulma framework, but I've had mixed feelings about it.
It was _relatively_ easy to start with, but once I had to modify something, it seemed to break other things.
I guess I'd better off to use plain CSS in this case.

## Tests

There are some basic tests for simple utilities and for some request handlers.
However, I think it would be more valuable to have full integration tests for HTTP endpoints to exercise the whole stack.
There could be more unit tests too, but there's almost no real domain logic. It's just glue connecting handlers with database and some data format conversions.

## Future

There are lots of things I could do with this simple project:
- I'd love to try Datomic - perhaps for keeping all historical versions of posts?
- Adding some specs for most important functions/data.
- Paging posts on the main page.
- Deleting/archiving existing posts.
- Styles could be better; just use plain CSS!
- Sidebar with most recent blog posts on the main page.
- Proper authentication using buddy or friend.
- Support for adding comments to blog posts.
- Support for tags.
- Markdown editor.
- Import from Evernote; this is actually I wanted to do with my real blog but eventually decided to write blog posts only in Wordpress editor (which kind of sucks) because there were many formatting issues.
- Export to Wordpress