[ANN] Reagent + Sente (+ Heroku) = Rente

842 views
Skip to first unread message

Henrik Mohr

unread,
Jan 18, 2015, 7:28:50 AM1/18/15
to clo...@googlegroups.com
Hi guys,

If you want a sample on how to make the newest versions of Reagent, Sente (for web sockets) work together, want figwheel for ease of development, and deploy it to Heroku, take a look at my small demo project:

I use it myself as a template/basis for Proof-of-Concept projects, and plan to use it for production stuff later.

Comments/feedback/suggestions/enhancements are welcome!

Best,
Henrik

gvim

unread,
Jan 21, 2015, 7:23:36 AM1/21/15
to clo...@googlegroups.com
As per the documentation:

$ lein run

$ lein figwheel
Figwheel: focusing on build-ids (client)
Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from
'(resources|dev-resources|resources-index/dev)/public'
Compiling "resources/public/js/app.js" from ("src/rente/client" "dev")...
Compiling "resources/public/js/app.js" failed.
java.io.FileNotFoundException: resources/public/js/app.js (No such file
or directory)

gvim

Henrik Mohr

unread,
Jan 21, 2015, 7:46:42 AM1/21/15
to clo...@googlegroups.com
Thanks for your comment, please pull again and retry:

lein figwheel
Figwheel: focusing on build-ids (client)
Compiling ClojureScript.
Figwheel: Starting server at http://localhost:3449
Figwheel: Serving files from '(resources|dev-resources|resources-index/dev)/public'
Compiling "resources/public/js/app.js" from ("src/rente/client" "dev")...
Successfully compiled "resources/public/js/app.js" in 14.874 seconds.
notifying browser that file changed:  /js/app.js
notifying browser that file changed:  /js/out/goog/deps.js
notifying browser that file changed:  /js/out/rente/client/views.js
notifying browser that file changed:  /js/out/rente/client/ws.js
notifying browser that file changed:  /js/out/start.js
notifying browser that file changed:  /js/out/rente/client/app.js

Best regards,
Henrik

Henrik Mohr

unread,
Jan 21, 2015, 8:06:17 AM1/21/15
to clo...@googlegroups.com

On Wednesday, January 21, 2015 at 1:23:36 PM UTC+1, g vim wrote:
As per the documentation:

I've just revised the documentation, please follow the revised usage documentation.

I've changed the order of lein run/figwheel since the server won't serve files correctly (the first time the server runs) until figwheel has finished building client files.

So the order is now:
  1. lein figwheel
  2. wait for figwheel to finish
  3. lein run
  4. browser -> localhost:8080

gvim

unread,
Jan 21, 2015, 9:05:10 AM1/21/15
to clo...@googlegroups.com
Thanks. Working now. Great work!

Slightly OT: for low cost VPS hosting with only 512Mb or 1Gb RAM Node.js
is often the only option. A full-stack Clojurescript option built on
similar tech as Sente would be fantastic.

gvim

Henrik Mohr

unread,
Jan 22, 2015, 2:01:13 AM1/22/15
to clo...@googlegroups.com
Good to hear that! :)

OT: I'm supporting a production app with Clojure/ClojureScript/Datomic/Ring/Sente etc. on a Heroku 2X dyno having 1 GB of RAM.
It works like a charm!

Best,
Henrik

gvim

unread,
Jan 22, 2015, 10:06:40 AM1/22/15
to clo...@googlegroups.com
On 22/01/2015 07:01, Henrik Mohr wrote:
>
> OT: I'm supporting a production app with
> Clojure/ClojureScript/Datomic/Ring/Sente etc. on a Heroku 2X dyno having
> 1 GB of RAM.
> It works like a charm!
>
> Best,
> Henrik
>

What kind of load? Is a basic web app even do-able on a 1X dyno, ie.
512Mb RAM? It's just that the no-cost lead-in is such an attractive
proposition for more conservative clients.

gvim

Henrik Mohr

unread,
Jan 22, 2015, 11:53:29 AM1/22/15
to clo...@googlegroups.com
(still) a moderate load. Around 10-50 users online at the same time. Not an extreme load on the Datomic Peer library since not a whole lot of data is stored per user (well, not for all users at least). But the server does a lot of real time calculations all the time based on user actions.

And yes, you can easily fit a Rente app into a Heroku 1X dyno setup. I have 2 Rente-apps running with that configuration without any issues. Unfortunately they are both closed systems I've made for a customer, so can't show them to you (1 in production use, 1 being evaluated as as Proof of Concept).

The running 2X app is here: https://app.meewee.com

It's based on a hybrid of Rente and older tech.

Best,
Henrik

Wei Hsu

unread,
Jan 22, 2015, 6:43:28 PM1/22/15
to clo...@googlegroups.com
How are you running Datomic on Heroku?

Henrik Mohr

unread,
Jan 23, 2015, 2:27:01 AM1/23/15
to clo...@googlegroups.com
I'm not. The Datomic Transactor is on one of our own hosts.

Henrik Mohr

unread,
Mar 10, 2015, 7:11:51 AM3/10/15
to clo...@googlegroups.com
Rente has been upgraded to sente 1.4.0 (breaking change).

Best,
Henrik

Henrik Mohr

unread,
Mar 25, 2015, 5:24:52 PM3/25/15
to clo...@googlegroups.com
Rente just got a "Deploy to Heroku" button for easy clone/deployment:
https://github.com/enterlab/rente

A running demo of Rente can be found here:

Best,
Henrik

Joe Kutner

unread,
Mar 26, 2015, 12:41:37 PM3/26/15
to clo...@googlegroups.com
That's awesome. I'm really glad to see people using the Heroku button for projects like this.

Is there a reason you explicitly set the BUILDPACK_URL? Heroku should detect the `project.clj` and use the Clojure buildpack automatically (I was able to deploy like that when I tested it). If there was a problem please let me know and I'll see if we can fix it (I work for Heroku).

Henrik Mohr

unread,
Mar 27, 2015, 2:49:26 AM3/27/15
to clo...@googlegroups.com
Thanks Joe! :)

It's not the standard Clojure buildpack, that's the reason it has to be specified explicitly.

I actually started out having no env parameter in app.json. The result was a completely dead app.
After I added the variable it worked.

Best,
Henrik

Joe Kutner

unread,
Mar 27, 2015, 3:06:28 AM3/27/15
to clo...@googlegroups.com
The buildpack you show in the readme appears to be the standard buildpack (unless i'm overlooking something):
https://github.com/heroku/heroku-buildpack-clojure

I was able to pull the Git repo down and deploy successfully without setting BUILDPACK_URL.

What do you mean by "dead app"? Did it fail the compile process, or just fail to start the app after the compile?

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/lK7MRwahT0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luposlip

unread,
Mar 27, 2015, 3:10:28 AM3/27/15
to clo...@googlegroups.com
By "dead app" I mean an app with no compilation of cljs.

Perhaps only the "LEIN_BUILD_TASK": "package" parameter that is needed!
Reply all
Reply to author
Forward
0 new messages