This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-31
Channels
- # aleph (37)
- # babashka (23)
- # beginners (46)
- # calva (1)
- # catalyst (12)
- # cider (3)
- # circleci (5)
- # clj-kondo (8)
- # clojure (188)
- # clojure-europe (28)
- # clojure-nl (1)
- # clojure-norway (84)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (6)
- # clr (1)
- # cursive (4)
- # datahike (4)
- # datascript (7)
- # datomic (31)
- # deps-new (16)
- # emacs (4)
- # fulcro (4)
- # gratitude (17)
- # hyperfiddle (24)
- # introduce-yourself (4)
- # jobs (5)
- # off-topic (84)
- # pathom (10)
- # polylith (21)
- # portal (6)
- # re-frame (6)
- # reitit (4)
- # releases (1)
- # sci (74)
- # specter (3)
- # tools-build (3)
- # tools-deps (5)
Full-Stack Hello World
I’m working with https://github.com/seancorfield/deps-new. Thanks @seancorfield. Installed the tool. Grokking the templates. It’s so helpful to have a simple starting deps.edn
. I was so clueless. I thought the https://github.com/seancorfield/dot-clojure deps.edn
was supposed to be in the project. I’m sure I read the first sentence in the README. Apparently it went right on by.
Anyway, I’m searching for a multi-tier, ion-based Hello World template or example. All I have is Datomic Cloud up and running on AWS, accessed via a local SSO connection. I want to make a Hello World round trip from the browser through a baby API to the database and back. I checked out the Practicalli templates and didn’t recognize any as a full-stack template. Having Cognito already stubbed in would be gravy.
Thoughts? Suggestions?
PS I’ll put this post somewhere else if here is inappropriate.
PPS I’m sticking my head back in the the https://docs.datomic.com/cloud/ions-tutorial/ions-tutorial.html while I search for my unicorn.
The https://github.com/Datomic/ion-starter I assume could be used as a basis for creating a deps-new template, however I've not used Diatomic Ions commercially and when I did try to use them in a workshop (when they first came out) they took a long time to provision all the AWS infrastructure. I'd also need to check what potential costs would be involved from the AWS infrastructure use (and how to minimize or avoid those costs) I really like the idea of Diatomic Ions, but haven't had the need to use them myself, so creating such a template is low on my very long 'gratis' to-do list. This is the first time I've seen anyone ask for such a template, or discuss Ions for a while. If there is a lot of interest I could add an Ions template via Clojurist Together funding application (if I am lucky enough to be awarded that)
@U05254DQM Thank you. Sean convinced me I’m in “roll your own” territory.
You'll be able to pull some useful stuff from the Datomic ion-starter -- there are also forks of that out there will full ClojureScript frontends that you could also look at.
I’m working through https://github.com/Datomic/ion-starter now. Thank you.
I don't know if anyone has created a Datomic Ions project template -- asking in #C03RZMDSH or #CC0A7PUHF might turn up something. I don't use Datomic myself (and I don't do full-stack with ClojureScript).
There's a bit of resistance from experienced Clojurians to use project templates -- and the core team haven't felt any need to address this, given that a minimal project is deps.edn
+ src/my/main.clj
-- and anything else you might want to add is up to you. I get their reticence. For Clojure library projects, the minimum requirement as far as I'm concerned is a way to run tests -- Cognitect's test-runner
repo tells users how to add it and it's just a couple of lines in deps.edn
and test/my/main_test.clj
and you're off to the races. You don't need to deploy to Clojars: folks can depend on your library on GitHub. Even so, adding dep-deploys
under an alias is also only a few lines in deps.edn
and that project repo explains how to do it.
If you want to build a library JAR, you can copy wants on the http://clojure.org site into a build.clj
and add a :build
alias to deps.edn
-- all explained in the docs and it's only a dozen lines. With apps, it's a similar story for backend "uberjar" projects. You need tests, you do not need a deploy step, you do need a JAR building step -- and again it can all be copied from docs etc. Creating new projects isn't something Clojurians do all the time at work -- it's more something beginners do as they're learning.
So I think deps-new
helps beginners by doing "just enough" to create barebones lib
and app
projects.
Once you go beyond the basics, you're usually in "custom app" territory -- especially if you're doing full-stack stuff. I have no idea how to set up shadow-cljs but I've used figwheel-main a bit (and that pretty much only needs an alias in deps.edn
to get you started -- although it gets more complex once you start getting into "production builds" etc).
The only time I use deps-new
is to create a scratch app
or lib
project to help out a beginner -- but it's more common that I can just fire up a REPL with some deps (via -Sdeps
) or git clone
the beginner's project from GH.
So... the upshot of all that is that there's no "one size fits all" full-stack hello world project: any template you find it going to come with assumptions and opinions which you may or may not recognize/understand and you're probably going to need to change a bunch of stuff anyway.
@two.stewards Not sure that helps you but I hope it provides some background on why such a template might not exist?
Here's a post from 2019 talking about setting up a web app backed by Datomic Ions -- but it's all custom stuff and the author changed libraries multiple times. It does indicate just how many choices you might have to make...
Though I guess I shouldn’t be by now, I am stunned by the depth, breadth, wisdom, practicality, and simple generosity of your response. I’m left wanting to wash your car or something. Thank you yet again…again. I’m off to cobble together…something. If I run into Santa, I’m asking for 20 years of experience at all this. A quote comes to mind: In the early nineteenth century, Marshal Lyautey, one of Napoleon’s greatest generals, who was later buried alongside his former commander, was reported to have the most beautiful garden in France. Standing with his head gardener, looking out over his estate, he observed the wonderful specimens of the world’s great trees planted there. Lyautey then turned to the gardener and said, “I see no copper beech tree.” His gardener replied, “But, mon général, such a tree takes one hundred and fifty years to grow.” Lyautey, without a second’s hesitation, said, “Then we must plant today—we have no time to waste.” Hughes, James E.. Family Wealth (Bloomberg) (p. 13). Wiley. Kindle Edition.
