pdlug / re-frame-starter

A re-frame/pedestal starter app, clone and start iterating

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Re-frame starter app

This is a re-frame app skeleton that's a bit more full featured than the app created by lein new re-frame. I found myself making the same modifications to every new project: add a pedestal app for an API (and set up reloading), carve out a component organization, add routing, etc. So I packed this into something easy to clone and start working with for every new project.

Server side pedestal app:

  • Static asset serving
  • JSON REST API with echo endpoint for prototyping
  • Hot code reloading

Client side re-frame app:

  • Routing using bidi
  • Event interceptor that validate sapp DB against spec in development
  • Components structured into separate namespaces each with their own db spec, event handlers, subscriptions, and views. Namespaced using the re-frame synthetic namespace pattern
  • Pages separated out with potential to use parallel structure to components as their complexity grows

To demonstrate things a homepage with a signup form that POSTs to an API which just echo's back the response is provided.

Development Mode

Start the server in a terminal:

lein run-dev

In another terminal start figwheel:

lein figwheel dev

Point your browser to: http://localhost:8080 and you should be ready to play.

Deployment with Docker

lein uberjar && docker build .
docker run -e PORT=8000 -p 8000:8000 <image_id from above>

TODO

  • Package as a lein template
  • Add test coverage/framework(s)

About

A re-frame/pedestal starter app, clone and start iterating


Languages

Language:Clojure 94.9%Language:HTML 4.2%Language:CSS 0.9%