This guide takes you from a fresh clone to a running dev server. Two paths are covered:
- Devcontainer (recommended) - everything installs automatically
- Local machine - you install Java, Leiningen, and Datomic yourself
Both paths end at the same place: Datomic running, backend serving on port 8890, and Figwheel hot-reloading the frontend.
Requires VS Code with the Dev Containers extension, or GitHub Codespaces.
git clone https://github.com/orcpub/orcpub.git
cd orcpub
code .When VS Code prompts "Reopen in Container", click it. The container installs Java 21, Leiningen, and Datomic Pro automatically.
Once the container is built, open a terminal inside VS Code:
./scripts/dev-setup.shThis will:
- Download project dependencies (
lein deps) - Start the Datomic transactor
- Initialize the database schema
- Create a test user: test / test@test.com / testpass
./menuThe interactive menu shows service status and lets you start/stop with single keystrokes. Or start individually:
./menu start server # Backend on port 8890
./menu start figwheel # Frontend hot-reload on port 3449Navigate to http://localhost:8890 (or the Codespaces forwarded URL). Log in with test@test.com / testpass.
| Tool | Version | Install |
|---|---|---|
| Java | 21+ (OpenJDK) | Adoptium |
| Leiningen | 2.9+ | leiningen.org |
| Datomic Pro | 1.0.7482 | See below |
Datomic Pro is free (Apache 2.0 license). The devcontainer installer handles this automatically, but on a local machine you need to install it manually:
# The install script downloads and extracts Datomic Pro
./.devcontainer/post-create.shOr follow the manual steps in docs/migration/datomic-pro.md. Datomic should end up at lib/com/datomic/datomic-pro/1.0.7482/.
cp .env.example .envEdit .env if needed. The defaults work for local development. The most important variable is SIGNATURE (JWT secret) -a dev default is provided automatically via .lein-env, so this step is optional for local dev.
See ENVIRONMENT.md for the full variable list.
lein deps./scripts/start.sh datomicWait for "Datomic is ready" before continuing. The transactor listens on port 4334.
First time only -creates the schema and applies seed data:
./scripts/start.sh init-db./menu add test testpassThis creates test@test.com with password testpass, already verified.
./scripts/start.sh serverThe server starts on port 8890 with an nREPL port for editor connections.
In a separate terminal:
./scripts/start.sh figwheelFigwheel compiles ClojureScript and serves it on port 3449. Changes to .cljs files are pushed to the browser automatically.
Navigate to http://localhost:8890. Log in with test@test.com / testpass.
If you prefer lein repl over the shell scripts:
lein replThe user namespace loads automatically with helpers:
(start-server) ; Start web server on port 8890
(stop-server) ; Stop web server
(init-database) ; Initialize DB schema (first time)
(fig-start) ; Start Figwheel from the REPL
(cljs-repl) ; Connect to ClojureScript REPL (after fig-start)The :dev profile provides a dev SIGNATURE via .lein-env, so auth works without extra setup. If you need to override with your .env values:
source .env && lein replAfter starting services, confirm everything is working:
| Check | Expected |
|---|---|
http://localhost:8890 loads |
Splash page appears |
| Log in with test@test.com / testpass | Character list page |
| Create a new character | Builder loads with race/class options |
| Edit and wait 7.5 seconds | Autosave (check Network tab for POST) |
Upload a .orcbrew file (My Content page) |
Homebrew options appear in builder |
Server returns 500 on login or API calls
The SIGNATURE env var is missing. If using ./menu or ./scripts/start.sh, check that .env exists and has SIGNATURE set. If using lein repl, the dev profile provides a default -but if you've overridden it with an empty value, auth will fail.
Datomic won't start
- Check that port 4334 isn't already in use:
lsof -i :4334 - Verify Datomic is installed:
ls lib/com/datomic/datomic-pro/1.0.7482/bin/transactor - Check logs:
cat logs/datomic.log
Figwheel compilation errors
- Run
lein fig:buildfor a one-shot compile to see all errors - First compilation can be slow (1-2 minutes) as it downloads ClojureScript dependencies
Port already in use
./scripts/stop.sh # Stop all services
./scripts/stop.sh server # Stop just the server- Architecture overview -how entities, templates, and modifiers work
- Dev tooling guide -Leiningen profiles, REPL helpers, build commands
- Environment variables -full config reference
- Stack migration context -why Java 21, Datomic Pro, React 18, etc.