Example cross platform (web/mobile/desktop) Clojure(Script) app

whatdidyoulearn
clojure
clojurescript

#1

I wanted to build a cross platform ClojureScript/React app similar to one I saw in JavaScript using reagent, re-frame, re-natal, and electron. This is to demonstrate using the same codebase to target all platforms, with as much code reuse as possible:

I decided to do an implementation of Generic Collectible Card Game (GCCG), an unofficial app I used in the past to play Magic: The Gathering. It also supports many other games and includes a scripting language to support more. I chose this because I thought it needed some 2018 polishing, and also because it seems more substantial than yet another todo app.

This initial proof of concept only does simple browsing of the data. I plan to ultimately finish this so it’s 100% compatible with the existing GCCG server/client.

Let me know your thoughts on this (don’t be too harsh :slight_smile:). I hope this is helpful to someone. Also, if you see any glaring issues, such as strange implementations etc. let me know.

Enjoy!


#2

This is great, very useful.

Any thoughts on how hard this would be to restructure as a template? That might be a useful thing to have. I like the idea of being able to do lein new multi-app and then write clojure(script) that will run anywhere. Would you be interested in taking it in that direction? Asking because I would be interested in getting involved.


#3

I too would love a template for targeting all these platforms, and would be interested in contributing to such. This project seems like it could serve as a great starting point.


#4

The thought of making this into a template had occurred to me. Biggest challenge is native where the iOS and Android have tons of files with the project name. This is currently generated by re-natal so perhaps the web/electron options could be added to that tool.


#5

re-natal is new to me. Will need to study it a bit. I think the first thing to consider is where the new generator would go. Re-frame-template has a plugin structure to make it possible to add new command line options. Perhaps it would be possible to build a plugin that triggers a re-natal init, and a separate one to add electron?


#6