ClojureScript Train Radiator
A small example project in ClojureScript. Fetches train information from rata.digitraffic.fi API and displays it.
- Install the Clojure build tool Leiningen.
lein figwheel devto start the server and a browser
- Wait a bit, then browse to http://localhost:3449.
- Change the code (browser refreshes automatically thanks to Figwheel)
project.clj: the configuration file for Leiningen
src/cljs/clojurescript_train_radiator/: the code is here
resources/public/style.css: the CSS style file
- ClojureDocs – the Clojure standard library documentation, searchable
- re-frame – the web framework used in this project that does what React and Redux do
- Hiccup wiki - how to generate HTML
- cljs-time - how to handle time
- make the page prettier
- make the station configurable
- poll timetables
- show only time table rows for this station
- only show future events
- collect statistics of late trains
Interactive development means having a REPL (command prompt) where you can interact with the code and try out things, while also running the server.
- Start an interactive clojure environment, for example:
- Try out things and edit code
- Code is automatically refreshed thanks to Figwheel
Where to go from here?