|
2 | 2 |
|
3 | 3 | Simple crud app in Clojure
|
4 | 4 |
|
5 |
| -## Running for development with temporary in process database: |
6 |
| -In ns user, through lein repl/cider etc.: |
| 5 | +### Development |
| 6 | +This uses an in-process/in-memory only database. In the `user` namespace, through `lein repl/cider` etc.: |
7 | 7 | ```
|
8 | 8 | (go) ;; to start the component system, localhost:3000 will serve the site
|
9 | 9 | (reset) ;; to reset the whole component system
|
10 | 10 | ```
|
11 | 11 |
|
12 |
| -## Running production uberjar (for heroku) |
| 12 | +### Running production uberjar (for heroku): |
13 | 13 | ```
|
14 | 14 | lein uberjar
|
15 | 15 | java -jar target/cljs-crud-prod-standalone.jar PORT DB-URL
|
16 | 16 | ```
|
17 | 17 |
|
| 18 | +### Deploy on heroku |
| 19 | +First time, provision a postgrest database (see https://devcenter.heroku.com/articles/heroku-postgresql): |
| 20 | +``` |
| 21 | + heroku addons:add heroku-postgresql:dev |
| 22 | +``` |
| 23 | +First time and every time adding a migration: |
| 24 | +``` |
| 25 | + heroku run lein migrate |
| 26 | +``` |
| 27 | +Deploying: |
| 28 | +``` |
| 29 | + git push heroku |
| 30 | +``` |
| 31 | + |
18 | 32 | ## Demo accounts
|
19 | 33 | Create your own through Signup or login using
|
20 | 34 | ```
|
21 | 35 | Name: Admin Password: admin for the demo admin account.
|
22 | 36 | ```
|
23 | 37 |
|
| 38 | +## Compiling the ClojureScript |
| 39 | +This requires a leiningen [checkout](https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies) of [DataScript](https://github.com/tonsky/datascript) with transaction functions. |
| 40 | +``` |
| 41 | + lein cljsbuild auto dev ;; continues compilation for development |
| 42 | + lein cljsbuild test |
| 43 | + lein cljsbuild once local ;; advanced compilation for the client-side only demo |
| 44 | +``` |
| 45 | + |
| 46 | + |
24 | 47 | # Todo
|
25 |
| -- Show password reset link in html when using debug emailer for demo |
26 |
| -- Show demo credentials on login page |
27 | 48 | - Default to ssl on Heroku
|
28 | 49 | - Replace compojure with bidi
|
29 | 50 | - look into jdbc entities
|
30 | 51 | - use :base with liberator
|
31 | 52 | - secure headers etc from clojure.web/with-security
|
32 | 53 | - Walk through http://www.lispcast.com/clojure-web-security
|
| 54 | +- Make pull requests for changes to anti-forgery |
| 55 | +- Sort out ring.middleware.session situation/documentation |
| 56 | +- Re-add something with Server-Sent Events, as done on the hackbattle2014 branch |
| 57 | +- Look into flywheel/browser-repl |
33 | 58 |
|
34 | 59 | ## About
|
35 | 60 |
|
|
0 commit comments