https://github.com/opqdonut/clojure-train-radiator
A small example project in Clojure. Fetches train information from rata.digitraffic.fi API and displays it.
https://github.com/opqdonut/clojure-train-radiator
clojure example
Last synced: 2 months ago
JSON representation
A small example project in Clojure. Fetches train information from rata.digitraffic.fi API and displays it.
- Host: GitHub
- URL: https://github.com/opqdonut/clojure-train-radiator
- Owner: opqdonut
- Created: 2017-11-07T15:28:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-02T08:44:40.000Z (over 3 years ago)
- Last Synced: 2024-10-18T11:25:10.244Z (8 months ago)
- Topics: clojure, example
- Language: Clojure
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Clojure Train Radiator
======================A small example project in Clojure. Fetches train information from
[rata.digitraffic.fi](https://rata.digitraffic.fi/) API and displays
it.Getting started
===============1. Install the Clojure build tool [Leiningen](https://leiningen.org).
2. Run `lein ring server` to start the server and a browser
4. Change the code (file `src/handler.clj`)
5. Refresh the browser and see your changesProject structure
=================- `project.clj`: the configuration file for Leiningen
- `src/handler.clj`: the code is here
- `resources/public/style.css`: the CSS style file
- `test/handler_test.clj`: unit tests (run these with `lein test`)Useful documentation
====================- [ClojureDocs](https://clojuredocs.org) – the Clojure standard library documentation, searchable
- [Compojure wiki](https://github.com/weavejester/compojure/wiki) – the web framework used in this project
- [Hiccup wiki](https://github.com/weavejester/hiccup/wiki) - how to generate HTML
- [clj-time](https://github.com/clj-time/clj-time) - how to handle time
- [docs for the digitraffic api](https://rata.digitraffic.fi/swagger/index.html)Tasks
=====- make the page prettier
- make the station configurable
- show only time table rows for this station
- only show future events
- collect statistics of late trainsInteractive development
=======================Interactive development means having a REPL (command prompt) where you
can interact with the code and try out things, while also running the
server.Here's how:
1. Start an interactive clojure environment, for example:
- run `lein repl` in a terminal
- use `M-x cider-jack-in` in Emacs (after installing [cider](https://github.com/clojure-emacs/cider))
- install a Clojure IDE like [Cursive for IntelliJ](https://cursive-ide.com/userguide/)
2. Run `(run)` to start a server
3. Try out things and edit code
4. Reload code changes with either
- the reload functionality in your IDE
- running `(refresh)` in the replExperimental: integrated editor
===============================In case you don't feel like installing a Clojure IDE or editor, you
can try out the browser-based editor, [Nightlight](https://sekao.net/nightlight/):1. Run `lein nightlight`
2. Point your broser to
3. Open the file `src/handler.clj`
4. You can run the server like this:
1. Switch to _Clojure REPL_ (on the top left)
2. Type in `(handler/run)`
3. Open another browser tab toWhere to go from here?
======================TODO