.. | ||
resources | ||
src/todomvc | ||
.gitignore | ||
create_db.sql | ||
project.clj | ||
README.md |
Reagent Data Views Example - Todo MVC
This is a modification of the Todo MVC app for Reagent demonstrated here. This version of the app has been modified to use a PostgreSQL database to store the Todos and to provide realtime synchronization of changes to that data to any number of users currently viewing the app.
Running
Since Reagent Data Views and the Views library it depends on are all
currently in somewhat of an experimental / pre-beta state right now,
you will need to first clone the following repositories and manually
install the libraries via lein install
:
As well, you can install views-honeysql if you want to try out using HoneySQL instead of SQL with views. But this example app does not use it so it's not required.
Once these libraries are installed, you can simply build the ClojureScript:
$ lein cljsbuild once
And then start up a REPL and run:
(-main)
Or more simply, just do:
$ lein run
Done either way, a new browser window should open to the app.
Alternatively, to build the ClojureScript and run the app all in one go:
$ lein rundemo
Open up a second browser and make changes by adding or deleting a Todo, or marking them as completed, etc. and see that the changes are instantly propagated to all clients.