# Datomic Flare A web server that offers an HTTP/JSON API for interacting with [Datomic](https://www.datomic.com) databases. ![The image features a logo with curved lines forming a tesseract, suggesting distortion and movement like space-time.](https://media.githubusercontent.com/media/gbaptista/assets/refs/heads/main/datomic-flare/datomic-flare-canvas.png) _This is not an official Datomic project or documentation and it is not affiliated with Datomic in any way._ ## TL;DR and Quick Start Ensure you have [Java](https://clojure.org/guides/install_clojure#java) and [Clojure](https://clojure.org/guides/install_clojure) installed. ```bash cp .env.example .env ``` ```bash clj -M:run ``` ```text [main] INFO flare.components.server - Starting server on http://0.0.0.0:3042 as peer ``` Ensure you have [curl](https://github.com/curl/curl), [bb](https://github.com/babashka/babashka), and [jq](https://github.com/jqlang/jq) installed. Transact a Schema: ```bash echo ' [{:db/ident :book/title :db/valueType :db.type/string :db/cardinality :db.cardinality/one :db/doc "The title of the book."} {:db/ident :book/genre :db/valueType :db.type/string :db/cardinality :db.cardinality/one :db/doc "The genre of the book."}] ' \ | bb -e '(pr-str (edn/read-string (slurp *in*)))' \ | curl -s http://localhost:3042/datomic/transact \ -X POST \ -H "Content-Type: application/json" \ --data-binary @- < JSON -> [Your Language] and vice-versa: something will be lost in translation and expressiveness. - An extra layer in the architecture adds a new hop to requests, potentially increasing latency. - Being one step away from Clojure reduces our power to leverage its types, data structures, immutability, and other desired properties. - Some tricks that would be easy to do in Clojure + Datomic become more cumbersome: transaction functions, advanced Datalog datasources, lazy loading, etc. ## Development ```bash clj -M:repl ``` ```bash clj -M:format clj -M:lint ``` ```bash cljfmt fix deps.edn src/ clj-kondo --lint deps.edn src/ ```