Multiplayer board game implemented using Clojure and HTMX
  • Clojure 54.4%
  • CSS 43.2%
  • Dockerfile 1.9%
  • JavaScript 0.5%
Find a file
2025-01-17 00:07:33 +05:30
dev Add websocket logic and handling to routes. 2025-01-14 20:56:58 +05:30
resources Display match history on dashboard. 2025-01-14 20:59:30 +05:30
src/chain_reaction Add source to homepage, fix readme 2025-01-17 00:07:33 +05:30
test/chain_reaction Add chain reaction game logic 2025-01-09 22:45:47 +05:30
.dockerignore Add dockerfile and deploy to Fly.io 2025-01-14 23:36:32 +05:30
.gitignore Remove /css from tracking 2025-01-14 23:41:30 +05:30
build.clj Add dockerfile and deploy to Fly.io 2025-01-14 23:36:32 +05:30
deps.edn Add dockerfile and deploy to Fly.io 2025-01-14 23:36:32 +05:30
Dockerfile Add dockerfile and deploy to Fly.io 2025-01-14 23:36:32 +05:30
fly.toml Add dockerfile and deploy to Fly.io 2025-01-14 23:36:32 +05:30
README.md Add source to homepage, fix readme 2025-01-17 00:07:33 +05:30

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.