Giter Site home page Giter Site logo

simonneutert / clojurescript-web-app-demo Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 36 KB

I wanted to see how far I can push it, having dabbled with Clojure/-Script for a few weeks after work. So, there you have it: an example of an artisinal (most probably bad ๐Ÿซ ) NodeJS-independent Frontend Project ๐Ÿป ๐Ÿ˜Ž

Dockerfile 2.23% Shell 4.39% HTML 14.67% Clojure 78.72%
clojure clojurescript json web-application website

clojurescript-web-app-demo's Introduction

fully functional everything clojurescript example

What is this and what will I see, when I run the Dockerfile?

A simple, but interactive event calendar for the city of Mainz, Germany. With search and filters and xhr calls in the background and such โ˜ฎ๏ธ


When you walk to the edge of all the light you have and take that first step into the darkness of the unknown, you must believe that one of two things will happen. There will be something solid for you to stand upon or you will be taught to fly.โ€
- Patrick Overton, The leaning tree

Rationale

I wanted to see how far I can push it, having dabbled with Clojure/-Script for a few weeks after work.

So, there you have it: an example of an artisinal (most probably bad ๐Ÿซ ) NodeJS-independent Frontend Project ๐Ÿป ๐Ÿ˜Ž

what's in for me learning clojure(-script?)
- everyone not writing lisp

well, if you thought Elm was cool, but you struggled with the types... or maybe you think types hinder from greatness... Rich never said this, but I heard it anyways in his talks.

What you have at hand, when going through this codebase

  • firing and receiving a http json request
    • json extraction
    • process data, extract information
  • dynamic data binding / state management
  • DOM creation/manipulation
  • state management
  • very basic Browser Event Management
    • user interaction
    • filtering
  • parameterized build for dev/prod scenarios

Run with Docker ๐Ÿณ

$ docker build . -t clj-events-spa
$ docker run --rm -p 8080:80 clj-events-spa

then open http://localhost:8080

Pre-Conditions (if you want to get your hands dirty ๐Ÿ‘)

I code clojure in VS Code using VSCode with Calva or a similar Editor supporting Clojure(-Script)

Compile the sources and view them

./build-production.sh and then http-serve the files

I solve that task using node's http-server
other may use Python for that

What's good, what could be easily improved, what did I learn?

improvements needed

  • state management abstraction, faster filtering may (see medium low hanging fruits)

medium low hanging fruits

  • lookup table for the calendar events
  • memoizing results ๐Ÿคทโ€โ™‚๏ธ

what was learned

  • clojure(-script) isn't witchcraft and has some really nice docs/api/reference
  • almost no dependencies needed ๐Ÿคฏ
  • one language to rule them all

Development (with VSCode and Calva)

  • start a REPL deps.edn + ClojureScript build for Browser
  • a Browser will open, then
  • evaluate core.cljs line by line
  • evaluate requirements in events.cljs and inspect the events in state

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.