Skip to content

Commit 85630ed

Browse files
committed
add fire
commit c2a580b Author: Bruno Bonacci <[email protected]> Date: Wed Sep 23 18:48:16 2020 +0100 doc/code formatting commit 08df4a8 Author: Alexander Oloo <[email protected]> Date: Wed Sep 23 18:21:47 2020 +0200 add fire
1 parent ba8274c commit 85630ed

File tree

6 files changed

+110
-27
lines changed

6 files changed

+110
-27
lines changed

README.md

+28-27
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,34 @@ Here the instructions on how to build your own Clojure projects with GraalVM.
1212

1313
Here the list of libraries tested:
1414

15-
| Status | Library | Description | Remarks |
16-
|:------------------:|------------------------------------------------------|--------------------------------------------------------|--------------------------------|
17-
| :white_check_mark: | [Clojure core](./clojure) | Clojure core | |
18-
| :white_check_mark: | [clojure spec](./spec) | Clojure Spec | |
19-
| :white_check_mark: | [clojure/tools.logging](./tools-logging) | Logging library | |
20-
| :white_check_mark: | [clojure/tools.logging+log4j](./tools-logging-log4j) | Logging library | |
21-
| :white_check_mark: | [aleph](./aleph) | Web server | |
22-
| :white_check_mark: | [amazonica+s3](./amazonica-s3) | Cloud API wrapper library | |
23-
| :white_check_mark: | [cheshire](./cheshire) | JSON parser/writer | |
24-
| :white_check_mark: | [clj-http-lite](./clj-http-lite) | Web client | |
25-
| :x: | [clj-sophia](./clj-sophia) | A fast RAM-Disk hybrid storage | *Runtime error/JNA* |
26-
| :white_check_mark: | [clj-uuid](./clj-uuid) | RFC4122 Unique Identifiers for Clojure | No objects in namespaced uuids |
27-
| :white_check_mark: | [clostache](./clostache) | {{ mustache }} for Clojure | |
28-
| :x: | [cognitect/aws-api+s3](./aws-api-s3) | Cloud API library | *Buildtime error* |
29-
| :white_check_mark: | [component](./component) | Managing lifecycle and dependencies of software | |
30-
| :white_check_mark: | [datascript](./datascript) | Immutable database and Datalog query engine | |
31-
| :warning: | [fastmath](./fastmath) | Fast and primitive math and stats library | *See README* |
32-
| :white_check_mark: | [hiccup](./hiccup) | Fast library for rendering HTML in Clojure | |
33-
| :white_check_mark: | [http-kit](./http-kit) | Web server and server | |
34-
| :x: | [monger](./monger) | An idiomatic Clojure MongoDB driver with sane defaults | |
35-
| :white_check_mark: | [next.jdbc + honeysql](./next-jdbc) | Database driver and SQL-in-Clojure | |
36-
| :warning: | [nippy](./nippy) | Clojure serialization/deserialization library | *Can't serialize exceptions* |
37-
| :white_check_mark: | [ring/jetty](./ring-jetty) | Web server | |
38-
| :white_check_mark: | [safely](./safely) | Circuit breaker | |
39-
| :white_check_mark: | [secure-random](./secure-random) | `SecureRandom` initialization | |
40-
| :white_check_mark: | [selmer](./selmer) | A fast, Django inspired template system for Clojure. | |
41-
| :x: | [system](./system) | Layer on top of components | *Buildtime error, see Readme* |
15+
| Status | Library | Description | Remarks |
16+
|:------------------:|------------------------------------------------------|---------------------------------------------------------------------|--------------------------------|
17+
| :white_check_mark: | [Clojure core](./clojure) | Clojure core | |
18+
| :white_check_mark: | [clojure spec](./spec) | Clojure Spec | |
19+
| :white_check_mark: | [clojure/tools.logging](./tools-logging) | Logging library | |
20+
| :white_check_mark: | [clojure/tools.logging+log4j](./tools-logging-log4j) | Logging library | |
21+
| :white_check_mark: | [aleph](./aleph) | Web server | |
22+
| :white_check_mark: | [amazonica+s3](./amazonica-s3) | Cloud API wrapper library | |
23+
| :white_check_mark: | [cheshire](./cheshire) | JSON parser/writer | |
24+
| :white_check_mark: | [clj-http-lite](./clj-http-lite) | Web client | |
25+
| :x: | [clj-sophia](./clj-sophia) | A fast RAM-Disk hybrid storage | *Runtime error/JNA* |
26+
| :white_check_mark: | [clj-uuid](./clj-uuid) | RFC4122 Unique Identifiers for Clojure | No objects in namespaced uuids |
27+
| :white_check_mark: | [clostache](./clostache) | {{ mustache }} for Clojure | |
28+
| :x: | [cognitect/aws-api+s3](./aws-api-s3) | Cloud API library | *Buildtime error* |
29+
| :white_check_mark: | [component](./component) | Managing lifecycle and dependencies of software | |
30+
| :white_check_mark: | [datascript](./datascript) | Immutable database and Datalog query engine | |
31+
| :warning: | [fastmath](./fastmath) | Fast and primitive math and stats library | *See README* |
32+
| :white_check_mark: | [fire](./fire) | A lightweight clojure client for Firebase based using the REST API. | |
33+
| :white_check_mark: | [hiccup](./hiccup) | Fast library for rendering HTML in Clojure | |
34+
| :white_check_mark: | [http-kit](./http-kit) | Web server and server | |
35+
| :x: | [monger](./monger) | An idiomatic Clojure MongoDB driver with sane defaults | |
36+
| :white_check_mark: | [next.jdbc + honeysql](./next-jdbc) | Database driver and SQL-in-Clojure | |
37+
| :warning: | [nippy](./nippy) | Clojure serialization/deserialization library | *Can't serialize exceptions* |
38+
| :white_check_mark: | [ring/jetty](./ring-jetty) | Web server | |
39+
| :white_check_mark: | [safely](./safely) | Circuit breaker | |
40+
| :white_check_mark: | [secure-random](./secure-random) | `SecureRandom` initialization | |
41+
| :white_check_mark: | [selmer](./selmer) | A fast, Django inspired template system for Clojure. | |
42+
| :x: | [system](./system) | Layer on top of components | *Buildtime error, see Readme* |
4243

4344

4445
More libraries to come (*PRs are welcome*).

fire/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/target
2+
/classes
3+
/checkouts
4+
profiles.clj
5+
pom.xml
6+
pom.xml.asc
7+
*.jar
8+
*.class
9+
/.lein-*
10+
/.nrepl-port
11+
.hgignore
12+
.hg/

fire/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fire
2+
3+
Testing whether [fire](https://github.com/alekcz/fire) can be used to
4+
read and write to Firebase's realtime database in a native binary
5+
image with GraalVM.
6+
7+
## Usage
8+
9+
Currently testing:
10+
11+
[alekcz/fire "0.3.0]
12+
13+
Test with:
14+
15+
docker-compose up -d
16+
lein do clean, uberjar, native, run-native
17+
docker-compose down
18+
19+
## Results
20+
21+
`[fire.core :as fire]` :white_check_mark:
22+
`[fire.auth :as auth]` :white_check_mark:

fire/docker-compose.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3'
2+
services:
3+
database:
4+
image: "thainaribeiro/firebase-emulator-database" #
5+
ports:
6+
- "9000:9000"

fire/project.clj

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(defproject fire "0.1.0-SNAPSHOT"
2+
3+
:dependencies [[org.clojure/clojure "1.10.2-alpha1"]
4+
[alekcz/fire "0.3.0"]]
5+
6+
:main simple.main
7+
8+
:uberjar-name "simple-main.jar"
9+
10+
:profiles {:uberjar {:aot :all}
11+
:dev {:plugins [[lein-shell "0.5.0"]]}}
12+
13+
:aliases
14+
{"native"
15+
["shell"
16+
"native-image" "--report-unsupported-elements-at-runtime" "--no-server"
17+
"--initialize-at-build-time"
18+
"--enable-url-protocols=http,https"
19+
"-jar" "./target/${:uberjar-name:-${:name}-${:version}-standalone.jar}"
20+
"-H:Name=./target/${:name}"]
21+
22+
"run-native" ["shell" "./target/${:name}"]})

fire/src/simple/main.clj

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(ns simple.main
2+
(:require ;[fire.auth :as auth]
3+
[fire.core :as fire])
4+
(:gen-class))
5+
6+
7+
(defn -main []
8+
(let [db "http://localhost:9000"
9+
; auth (auth/create-token "GOOGLE_APPLICATION_CREDENTIALS") ; actual auth with firebase server
10+
path "/graal"]
11+
(fire/push! db path {:hi "GraalVM"} nil)
12+
(fire/push! db path {:hi "Clojure"} nil)
13+
(println (fire/read db path nil))
14+
(fire/write! db path {:fire "Base"} nil)
15+
(println (fire/read db path nil))
16+
; How you auth against the actual firebase server (see https://github.com/alekcz/fire)
17+
; (fire/push! (:project-id auth) path {:autheticated "Using Google Server"} auth)
18+
; (println (fire/read (:project-id auth) path auth))
19+
(fire/delete! db path nil)
20+
(println (fire/read db path nil))))

0 commit comments

Comments
 (0)