This is not a production ready process, but is for showcasing the rough architecture and structure that goes into building a project like this from scratch. NOT DIRECTLY FOR PRODUCTION USE - there's a ton of optimizations and hardening things you'd still need to do on top of this.
Also important to realize that we're not trying to build a product of any kind - purely focussing on the plumbing that a project would need to function. You're welcome to expand and morph it into whatever suits your fancy.
Note, there are many libraries out there that accomplish you could flip out instead of the ones used below. I am using the ones we use at Yuppiechef, but you may decide for yourself what is appropriate for your usecase. A starting point for the menu of options you have available is over here: https://www.clojure-toolbox.com/
Quickstart to see it in action:
- Open in VSCode (
Dev Containers: Open Folder in Container...
) - In Terminal view (inside VSCode), run
clj -X start/-main
- Split the tab (or create a new terminal), run
shadow-cljs watch app
- Browse to
http://localhost:8080
Developing this from scratch.
- Step 0 - Clojure + Reference
- Step 1 - Initial Basic setup
- Step 2 - Setup uberjar and run process from jar
- Step 3 - Embedded nrepl support
- Step 4 - HTTP server
- Step 5 - Hot reloading
- Step 6a - HTTP Routing
- Step 6b - Serving up static files
- Step 7 - ClojureScript
- Step 8 - Rum & SSR
- Step 9 - Housekeeping
- Step 10 - Service Lifecycle
- Step 11 - Dynamic Services
- Step 12 - Websockets
- Step 13 - Pages (screens)
- Step 14 - Persistence: Datomic
- Quicker startup
- Lightweight memory footprint
- Totally Free!
- Better Java integration (autocomplete)
- Copy/Paste Hiccup conversion!