Fork me on GitHub

I see that the luminus docs include instructions on how to deploy to Heroku. Do those instructions apply to the frontend as well? I want to create a full stack app with re-frame and shadow-cljs on the frontend. Do I follow the shadow-cljs instructions for building a release build as well as the clojure side instructions for Heroku and it'll all work? Since Heroku has a postgres setup and the instructions include directions for that, when building my Luminus template, can I just use the +postgres addon and it should work as detailed? So the full app creation would be lein new luminus my-app +reitit +re-frame +shadow-cljs +postgres . Any other advice I should know about deploying such an app?


It was mentioned in the #clojure channel that including shadow-cljs and npm did not work with the heroku build packs so he had to create a Docker image and push that instead. But I don't think he was using luminus and I'm not sure if luminus is using those default build packs or has figured out their own approved approach to such things


Hi, again 😉 I did in fact use Luminus. After a little googling, it seems other people faced similar problems with shadow-cljs on Heroku Maybe this is also interesting to you:


In this post, a custom build script is created for use on Heroku (although it’s fulcro):


Ahh ok, I'll check these out. Thanks for following me in here. haha


That first one used Docker too it seems . The second one might work but this is all looking a bit hairy for my current dev ops skills. But that's how we learn I guess. I'm jealous of like the Next.js folks just using Vercel and calling into something like Supabase for auth and db needs. Seems way easier (but is it simpler...)


Had some time on my hands and tried it. I created a new luminus app with your proposed command from above: lein new luminus my-app +reitit +re-frame +shadow-cljs +postgres and pushed it to Heroku


So for the default without doing anything it definitely fails


I then tried to add the npm buildpack and clojure buildpack together, but I get the same error:


Hmm, ok. I'm over here still trying to get that template running with my postgres credentials. That's also kind of new to me. lol


I feel like the process will be building out the frontend using the shadow-cljs instructions and then matching that with heroku's js instructions since then it will be js?


Oh wait, that looks like what you are trying


There seems to be an issue in the template, when I lein uberjar a freshly created application locally on my machine, I get the same errors


yeah same here.


The struct 1.4.0 version is quite old, so I guess there is a transient dependency which is a problem


Yeah, I removed the whole cljc directory and it compiles fine


I'm still having stupid postgres authentication errors over here though. In my limited experience I've found that whole thing brittle too but it seems to be well loved so that's definitely user error on my part


Want to share your (anonymized, obfuscated) DB config?


Got the compile error, though. The latest luminus-template includes funcool/cuerdas as a dependency. This is also a transient dependency of funcool/struct, and there is a conflict


Ahh. For the DB stuff I'm getting a password authentication error so trying to work through that.


I probably didn't set it up correctly. I've never actually used postgres before.


I usually run it locally on Docker so I don’t have to install it on the system directly…


Yeah, the universe seems to be telling me to learn some Docker basics today


If it helps: docker run -p 5432:5432 --name db-name -e POSTGRES_PASSWORD=mypass -d postgres:12.2


I got the db thing cleared up but haven't gotten it deployed successfully yet.


The error I am getting:


I took some of the instructions from that fulcro deployment guide and built a bin/build file with the following:

#!/usr/bin/env bash                                                                                                       
npm install                                                                                                               
npx shadow-cljs release app                                                                                               
lein uberjar  

👍 2

Everything else seems to follow from the rest of the luminus and/or heroku clojure deployment docs