Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Datomic Browser - Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeoffrey committed Jan 26, 2024
1 parent 068d2f9 commit ff35c3c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/datomic_browser/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Electric Datomic Browser


You need [Datomic pro](https://docs.datomic.com/pro/releases.html) (now free!) to run this demo.

## Getting started
To get Datomic and install the sample data set:
```shell
./datomic_fixtures.sh
```

Run Datomic:
```shell
./state/datomic-pro/bin/transactor config/samples/dev-transactor-template.properties >>state/datomic.log 2>&1 &
```

Run Electric Fiddle:
```shell
clj -A:dev:datomic-browser
```
At the repl:
```clojure
(dev/-main)
(dev/load-fiddle! 'datomic-browser)
```

Open your browser at [http://localhost:8080](http://localhost:8080).



23 changes: 23 additions & 0 deletions src/datomic_browser/datomic_fixtures.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eux -o pipefail

mkdir -p state
pushd state
curl https://datomic-pro-downloads.s3.amazonaws.com/1.0.6735/datomic-pro-1.0.6735.zip -O -C -
if [ ! -d "datomic-pro" ]; then
unzip datomic-pro-1.0.6735.zip
mv datomic-pro-1.0.6735 datomic-pro
fi

set +e
wget --no-clobber -O mbrainz.tar https://s3.amazonaws.com/mbrainz/datomic-mbrainz-1968-1973-backup-2017-07-20.tar
set -e
if [ ! -d "mbrainz" ]; then
tar -xvf mbrainz.tar
fi

datomic-pro/bin/transactor config/samples/dev-transactor-template.properties >>datomic.log 2>&1 &
datomic_transactor_pid=$!
# https://datomic.narkive.com/OUskfRdr/backup-error
datomic-pro/bin/datomic restore-db file:`pwd`/mbrainz-1968-1973 datomic:dev://localhost:4334/mbrainz-1968-1973
kill $datomic_transactor_pid

0 comments on commit ff35c3c

Please sign in to comment.