- Clojure 54.4%
- CSS 43.2%
- Dockerfile 1.9%
- JavaScript 0.5%
| dev | ||
| resources | ||
| src/chain_reaction | ||
| test/chain_reaction | ||
| .dockerignore | ||
| .gitignore | ||
| build.clj | ||
| deps.edn | ||
| Dockerfile | ||
| fly.toml | ||
| README.md | ||
Chain Reaction
Chain reaction game implemented as a multiplayer web app.
Deployed link: chain-reaction-app.fly.dev
Blog link: Multiplayer board game in Clojure
Note that the first load could take a while (around 1 min) to load.
https://github.com/user-attachments/assets/ca69469f-b8f8-4ea2-9a7e-fbbb085218a9
Run Locally
Make sure Clojure is installed.
Refer resources/config.edn for all environment variables and configuration.
The application uses sqlite for storing user data.
Create a file locally at project root called local.db.
(Refer to config file above for using a different name, or switching to in memory sqlite :memory:).
touch local.db
Run the application locally using.
clj -M:repl
Start the web server locally by evaluating (go) in the REPL.
(go) ; start's the server
Refer dev/user.clj for other commands for starting / halting / resetting the server.
For building CSS, make sure tailwind cli is installed.
Evaluate (start-css-watch) in dev/css.clj.
It starts a tailwindcss process which watches the src directories and rebuilds css if necessary.
Build
clj -T:build uber
Creates a standlone uberjar /target folder.
Deployment
Refer Dockerfile for creating the image. I used fly.io for deploying the docker image.
Used Practicalli | Multi-Stage Dockerfile for Clojure as reference for creating the Dockerfile.