Fork me on GitHub
#off-topic
<
2022-07-16
>
pinkfrog11:07:05

Anybody know the web framework behind metabase? https://www.metabase.com/security

dpsutton14:07:04

Front end or backend?

dpsutton14:07:42

Nothing special either side. Back end is ring on top of jetty with a few macros for convenience

dpsutton14:07:30

Front end is a standard react app. Increasingly more typescript and redux

dpsutton14:07:22

• Uses ring protocols on top of jetty async handler https://github.com/metabase/metabase/blob/master/src/metabase/server.clj • example of a handler with our own macro api/defendpoint is https://github.com/metabase/metabase/blob/master/src/metabase/api/card.clj#L166 It’s nothing too special I don’t think. Happy to answer any questions

pinkfrog15:07:14

Hi @U11BV7MTK, I am interested in the fe. 1. On routing, looking at the URL, so no SPA is involved (for example, https://www.metabase.com/blog/). How is the html page generated? Selmer? 2. Is there backend for frontend stuff used for the website? 3. The UI, as in the following picture, looks very neat. What js/css framework is involed? 4. One more thing, is cljs mixed with ts, or the web is solely based on ts?

dpsutton15:07:19

1. I think that site is all js. Perhaps vercel or something? I don't know. I work on our core application and that's just our marketing site. I can guarantee that there is no Clojure involved so no Selmer 2. I don't believe there is any backend for that site 3. No idea. I'm on the backend team 4. For our core application (not this marketing site) the majority of the FE is in regular JS. We used to use Flow but have migrated to TS and the amount is increasing but not total yet. We do have some shared cljc files so we can do some query operations on our own custom query language in JS the same way we do on the backend when running the query. Those files are at https://github.com/metabase/metabase/tree/master/shared/src/metabase

pinkfrog15:07:30

Is the marketing site code on github?

dpsutton15:07:49

I don't know if it's public or not. You can go see the public repos we have

pinkfrog15:07:52

Thanks! Very informative

pinkfrog15:07:37

For the backend, I just noticed https://github.com/metabase/metabase/blob/master/src/metabase/server.clj there is no di tools like integrant being used. • How do you achieve a reload-able workflow? • Also, how do you do stuffs like singleton, etc.

dpsutton16:07:34

• We just reload whatever namespace we change. Redefining vars is good enough for us • We just have an atom named instance* and compare and set it with a new server

pinkfrog16:07:30

> We just reload whatever namespace we change. Redefining vars is good enough for us I guess you do not have much defprotocol or defmulti.

dpsutton16:07:28

we do. quite a bit actually. we use defprotocol+ from potemkin to not redefine protocols and we don’t often change them. Defmulti’s change a lot, but we normally don’t change the dispatch function which is where the pain can often come from