This is an example program (a cow-themed version of the board game Clue) meant to demonstrate how to make a web app with ClojureScript and Firebase. It's deployed at cows.jacobobryant.com.
The following requires no knowledge of Clojure or Firebase. Once you have it
running, you can start poking around the code to see how it works. While
running ./task dev
, any Clojure(Script) files you change will be recompiled
automatically.
I've also recorded some commentary on the architecture of this project. The most interesting part is at 25:42, where I explain how you can specify declaratively which Firestore subscriptions the app needs based on its current state.
- At firebase.google.com, create a new project.
- In the "Authentication" section, click "Set up sign-in method." First enable "Email/Password," and then also enable "Email link (passwordless sign-in)." After that, enable sign-in with Google.
- In the "Database" section, click on "Create database." Accept the defaults.
- Install dependencies: NPM, Clojure and Overmind.
- Clone this repository. Inside the project directory, run
./task setup
. - Run
firebase login
and thenfirebase init
. Select your existing project, and then select Firestore, Hosting and Functions. Accept the defaults for everything.
- Run
./task dev
. - After Shadow CLJS loads, go to localhost:9630. Hover over "Builds," then check the "main" and "fn" boxes.
The app will be available at localhost:5000.
Run ./task deploy
. The app will be available at
https://your-project-id.web.app
.
Search for Jacob O'Bryant
on Clojurians Slack, or
get my email from my website.
If you want to support my work, subscribe to my newsletter.
Distributed under the EPL v2.0
Copyright © 2020 Jacob O'Bryant.