Skip to content

Commit 0c5c878

Browse files
committed
- Fixed the repo state. Remove a lot of old testing garbage files, fixed the compile-all.sh runstream. Now if you compile on your own it will closer reflect the release, artifacts-wise, and not be a dev-mode disaster (solo pushing to a private repo for a long period of time creates a lot of garbo).
- Dockerfile created - first Docker image release w v0.1.1, not perfect but seems stable and fully functional - Fixed issue where DuckDB files did not get proper metadata for UI browsing - Cache DB is now Duck by default (configurable in the future) - Materialize to Cache DB now has options for persitent or memory (cache.db or cache.db.memory) - both Duck ATM - Compressed the shipping assets/openai-images examples to JPGs (rather than 3MB PNGs, kek) - In addition to defs/config.edn you can have a map in defs/secrets.edn for API keys and such - can be accessed in any part of the system as a reactive parameter with the :settings prefix. So :settings/openai-api-key will resolve to that key on execution. etc. - changed the example flow "openai-image-gen-ladder" to use :settings/openai-api-key if it exists. - audio transcription also uses OpenAI at the moment, so the icon will only appear if a valid key is detected (key gets checked on boot) - added a config.edn option to disable the sub/unsub reactor messages. They are useful for debugging pub/sub issues, but can get annoying. :hide-sub-and-unsub-alerts? - reminder that you can disable ALL pop-up notifications via a toggle on the lower right hand corner of the canvas - added rotating-theme-blank screen, which will cycle randomly through all the images found in assets/openai-images and change the theme colors to match. Not for a prod dashboard, obvs, but for random Data eng boards where im just monitoring data, it's nice to have some vibes flowing. - Fixed a double-query bug - Added an optional pop-up notification about SQL query time execution. Off by defaut, can be changed in the config.edn - :show-query-times? true - Added more OAI images to show off dynamic themes better. Not your cup of tea? Cool beans. Replace them with Smurfs or Lumberjacks or Kittens - that's the beauty of a fully customizable and hackable platform! Will have a tutorial video in a few days on how to automate image gen with a flow. Express yourself!
1 parent 2b3a201 commit 0c5c878

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+23411
-7160
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ Besides the built-in runners of SQL queries and Views (UI) - the combination of
265265
## Caveats
266266

267267
- Use Engelbart's beautiful invention please 🐁
268+
- Reccommend JDK 17+
268269
- Smattering of various UI jank; being worked on
269270
- Limited SQL DB support ATM
270271
Tested with SQLite, Postgres, MySQL, SQL Server, Vertica, Clickhouse, DuckDB

backend/assets/2077shot.jpg

2.12 MB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
-84.5 KB
Loading
Loading
544 KB
Loading
292 KB
Loading
Loading
333 KB
Loading
Loading
Loading
-284 KB
Loading
-63.4 KB
Loading

backend/defs/config.edn

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
{:debug-level 1 ;; for console output. somewhat deprecated.
1010
:hide-sub-and-unsub-alerts? false
11+
:show-query-times? false
1112
:default "./screens/frost-terminal2.edn"
1213
;; ^^ if no screen given in URL, load this one. the "start page" essentially.
14+
;; if this screen can't be read or is nil, you will get a basic blank screen with a default theme
1315
:harvest-on-boot? true ;;false
1416
;; ^^ do a full database sniff for each connection on boot? (generally not needed)
1517
:modes {:pre [:pre
@@ -132,7 +134,39 @@
132134
Since this system is EDN based, all code has to be wrapped in a (do ..) form in order to be evaluated as a single expression. If a user-provided do block already exists, just use it, do not double wrap it - a single parent (do ...) form is all that is needed.
133135
Being saved in EDN also means that it cannot use Clojure artifacts that are invalid EDN - so, do not use the shorthand for anon functions (#(this %)), or shorthand atom derefs (@atom), or shortcode sets (#{}) always use the full for version for these things - instead w/o the special characters (deref, set, (fn[x]...))."
134136
:icon "images/clojure-alt.svg"
135-
:kits {:export-to-csv {:when-fn (fn [client-panels client-data] ;; return a vector of [:block-id :runner-type :view-id] tuple for things that are "eligible"
137+
:kits {;; unfinished: might work better as a flow block... WIP
138+
;; :openai-data-clean {:when-fn (fn [client-panels client-data] ;; return a vector of [:block-id :runner-type :view-id] tuple for things that are "eligible"
139+
;; (vec (apply concat (for [[k v] client-panels ;; ^^ runs on the local repl, not the host
140+
;; :when (get v :queries)] ;; only things eligble are query results
141+
;; (for [kk (keys (get v :queries))]
142+
;; [k :queries kk])))))
143+
;; :output :kit-map
144+
;; :icon-location :query
145+
;; :tooltip "Experimental! Use OpenAI's API to clean data. Use as little data as possible to save tokens."
146+
;; :icon "ri-openai-fill"
147+
;; :kit-expr (do
148+
;; (require '[cognitect.transit :as transit]
149+
;; '[clojure.data.csv :as csv]
150+
;; '[rvbbit-backend.external :as ext]
151+
;; '[rvbbit-backend.assistant :as ass]
152+
;; '[rvbbit-backend.util :as ut]
153+
;; '[clojure.string :as cstr]
154+
;; '[clojure.java.io :as io])
155+
;; (ass/oai-call {:url "https://api.openai.com/v1/chat/completions"
156+
;; :method :post
157+
;; :body {:model "gpt-4o"
158+
;; :messages [{:role "system"
159+
;; :content (str "You are a data cleaner. You are given a dataset and instructions,
160+
;; you will not respond to anything, you will just clean the data and return it as valid Clojure EDN.
161+
;; Do NOT send backticks or language identifiers, JUST the EDN structure please.
162+
;; The instructions are: 'Fix the YEAR col - make a guess if you have to with the information given.
163+
;; If a range is given, pick something in the middle - just make a reasonable assumption as to what
164+
;; the user intended. If you CANNOT decide or there is not enough information,
165+
;; use -1 as the answer for that column.'"
166+
;; "here is the data: " (pr-str test-data))}]}}
167+
;; :settings/openai-api-key
168+
;; :settings/openai-org-id))}
169+
:export-to-csv {:when-fn (fn [client-panels client-data] ;; return a vector of [:block-id :runner-type :view-id] tuple for things that are "eligible"
136170
(vec (apply concat (for [[k v] client-panels ;; ^^ runs on the local repl, not the host
137171
:when (get v :queries)] ;; only things eligble are query results
138172
(for [kk (keys (get v :queries))]

backend/defs/solvers.edn

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
:data {:flowmap "node-color-thief-js-webp"
55
:opts {:overrides {:image-path :solver/wallpaper-of-the-moment}}
66
:return nil}}
7+
:materialize-offenses-drag-4 {:signal :signal/daily-at-7am
8+
:type :sql
9+
:snapshot? false
10+
:data {:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location
11+
:Long :MONTH :OCCURRED_ON_DATE :OFFENSE_CODE
12+
:OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA
13+
:SHOOTING :STREET :UCR_PART :YEAR]
14+
:from [[:offenses :dd96]]
15+
:page -4
16+
:connection-id "boston-crime"}}
717
:all-large-webp-files {:signal false
818
:type :clojure
919
:cache? true
@@ -32,6 +42,31 @@
3242
default-field-attributes
3343
default-derived-fields
3444
default-viz-shapes)))}
45+
:materialize-cached-offenses-drag-43-1
46+
{:signal :signal/daily-at-7am
47+
:type :sql
48+
:snapshot? false
49+
:data {:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location :Long :MONTH
50+
:OCCURRED_ON_DATE :OFFENSE_CODE :OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA
51+
:SHOOTING :STREET :UCR_PART :YEAR]
52+
:from [[:offenses_drag_43 :zz175]]
53+
:page -4
54+
:connection-id "cache.db.memory"}}
55+
:materialize-DISTRICT-drag-18
56+
{:signal :signal/daily-at-7am
57+
:type :sql
58+
:snapshot? false
59+
:data
60+
{:select [:DISTRICT [[:count 1] :rowcnt] :OFFENSE_CODE :STREET]
61+
:from
62+
[[{:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location :Long :MONTH :OCCURRED_ON_DATE
63+
:OFFENSE_CODE :OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA :SHOOTING :STREET :UCR_PART
64+
:YEAR]
65+
:from [[:offenses :ww131]]} :kk71]]
66+
:group-by [:DISTRICT :OFFENSE_CODE :STREET]
67+
:order-by [[:rowcnt :desc]]
68+
:page -4
69+
:connection-id "boston-crime"}}
3570
:random-mp3
3671
{:signal :signal/changed-wallpaper?
3772
:type :clojure
@@ -93,6 +128,26 @@
93128
:connection-id "system-db"
94129
:select [[[[:sum :mem_used]] :mem_used] [[:sum :recent_messages_per_second] :messages_per_second] :ts]
95130
:post-process-fn (fn [x] (vec (reverse (for [row x] (assoc row :mb (int (/ (get row :mem_used 0) 1048576)))))))}}
131+
:materialize-offenses-drag-43 {:signal :signal/daily-at-7am
132+
:type :sql
133+
:snapshot? false
134+
:data {:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location
135+
:Long :MONTH :OCCURRED_ON_DATE :OFFENSE_CODE
136+
:OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA
137+
:SHOOTING :STREET :UCR_PART :YEAR]
138+
:from [[:offenses :aa855]]
139+
:page -4
140+
:connection-id "boston-crime"}}
141+
:materialize-offenses-drag-20 {:signal :signal/daily-at-7am
142+
:type :sql
143+
:snapshot? false
144+
:data {:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location
145+
:Long :MONTH :OCCURRED_ON_DATE :OFFENSE_CODE
146+
:OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA
147+
:SHOOTING :STREET :UCR_PART :YEAR]
148+
:from [[:offenses :zz384]]
149+
:page -4
150+
:connection-id "boston-crime"}}
96151
:static-data {:signal false :type :clojure :data [(apply + [1 2 3])]}
97152
:refresh-boston-crime {:signal :signal/daily-at-9am
98153
:type :clojure
@@ -113,6 +168,16 @@
113168
:type :clojure
114169
:cache? true
115170
:data (true? (clojure.string/ends-with? :solver/wallpaper-of-the-moment ".png"))}
171+
:materialize-offenses-drag-24 {:signal :signal/daily-at-7am
172+
:type :sql
173+
:snapshot? false
174+
:data {:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location
175+
:Long :MONTH :OCCURRED_ON_DATE :OFFENSE_CODE
176+
:OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA
177+
:SHOOTING :STREET :UCR_PART :YEAR]
178+
:from [[:offenses :ww131]]
179+
:page -4
180+
:connection-id "boston-crime"}}
116181
:wallpaper-of-the-moment
117182
{:signal :signal/every-5-minutes
118183
:type :clojure
@@ -141,4 +206,18 @@
141206
default-field-attributes
142207
default-derived-fields
143208
default-viz-shapes)))}
209+
:materialize-Lat-drag-22
210+
{:signal :signal/daily-at-7am
211+
:type :sql
212+
:snapshot? false
213+
:data
214+
{:select [[[:sum :Lat] :Lat_sum] :OFFENSE_CODE_GROUP]
215+
:from
216+
[[{:select [:DAY_OF_WEEK :DISTRICT :HOUR :INCIDENT_NUMBER :Lat :Location :Long :MONTH :OCCURRED_ON_DATE
217+
:OFFENSE_CODE :OFFENSE_CODE_GROUP :OFFENSE_DESCRIPTION :REPORTING_AREA :SHOOTING :STREET :UCR_PART
218+
:YEAR]
219+
:from [[:offenses :ww131]]} :ee900]]
220+
:group-by [:OFFENSE_CODE_GROUP]
221+
:page -4
222+
:connection-id "boston-crime"}}
144223
:dazzling-gnu-solver {:signal :signal/hourly? :type :clojure :cache? true :data (+ 1 2 3 90 (rand-int 124345))}}

0 commit comments

Comments
 (0)