Skip to content

danneu/bulletin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bulletin

A bulletin board service (like proboards) written in Clojure.

Live demo: www.fed.nu (It's very rough)

Setting up for local development

Install leiningen so that you have the lein command available in your console.

Use environment variables to configure bulletin. A nice way to do this is to create .lein-env in the root directory:

{:database-url "postgres://<dbuser>:<dbpassword>@localhost:5432/bulletin"}

You can also provide :port <Number>, but the default port will be 3000.

Now boot the server:

lein ring server-headless

To force the server to create the database tables and then populate them with seed data, visit http://localhost:3000/reset-db.

The website should now be running on http://localhost:3000.

Misc

  • Using bootstrap v3.2.0
  • Using bootstrap-markdown v2.6.0 (jQuery v2.1.1) Deps on bootstrap 3.1.1 but I'll use 3.2.0 for convenience for now

TODO

  • Add more ON DELETE CASCADE
  • Implement authorization and protect routes with it
  • Add CSRF protection
  • Add tests for authorization rules at the very least
  • Recaptcha community creation
  • Flood protection
  • Users should only be able to edit their posts for a certain duration
  • Find java/clj markdown lib that's compatible enough with markdown.js that also escapes user html like markdown.js does. So far no good.
  • For now I'm disabling buttons that the current user is unauthorized to use so that I can quickly reason about my progress and the look/feel. But I will eventually avoid rendering the buttons completely instead of just greying them out.
  • I'm used to using Hiccup for templating which makes it trivial to share my cancan.clj between routes and templates. However, this is my first time using Selmer and so far my approach of shoehorning can-*-? keys into random objects has been ugly and feels so ad-hoc.
  • I really need to document things like what *current-user* actually looks like. What kind of things can get assoc'd to it. Etc.
  • Reuse views/community layout on www homepage
  • Add profiling per route
  • Add logging
  • Change my custom timestamp Selmer filter to utc which ensures java.sql.Timestamp and any other date representations are represented as utc strings. That way I can just apply {{some_date|utc}} to anything without checking to see if it's a java.sql.Timestamp or a to_json string first.
  • Add pagination to topics and posts
  • Add post permalinking
  • Link "Latest Post" in community/forum views to the last post's permalink instead of just the topic
  • Now that I'm rendering markdown on the client side, my Reply and Edit buttons no longer have to hit the server to get the original post markdown.

And much much more...

About

communities as a service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published