Skip to content

ptrthomas/karate-todomvc

Repository files navigation

About

This is the React TodoMVC sample re-written in "KarateJS" - an experimental app-server implemented as part of the Karate project.

"KarateJS" is a simple server-side framework that requires you to only write HTML and JS and nothing else.

Features:

  • SPA-like user-experience, but Server Side Rendered
  • Pure-HTML, XD-friendly preview-able templates powered by Thymeleaf
  • Compose complex views out of re-usable HTML templates
  • AJAX and partial DOM rendering powered by htmx
  • Server-side JS powered by Graal JS
  • All code for a "view" can fit in a single HTML file
  • ES6 JS can be included within IDE-friendly <script> tags
  • Server powered by Armeria
  • CLI powered by picocli
  • Hot reload !
  • Only a JRE needed
  • Can run serverless / within an AWS Lambda
  • Pluggable HTTP-session store (can be wired up to e.g. DynamoDB with very little effort)
  • also see this tweet and this one too

Running Locally

  • clone this repository: git clone https://github.com/ptrthomas/karate-todomvc.git or download a ZIP
  • Use jbang (no need to download the Karate JAR or install Java):
    • if jbang is installed, run: jbang karate -S
    • if not installed: curl -Ls https://sh.jbang.dev | bash -s - karate -S
  • Manually:
    • Download karate-1.1.0.jar from here
    • rename it to karate.jar, place it in the same folder as the files from git
    • Java should be installed (only a JRE is needed)
      • java -jar karate.jar -S
    • or using Docker, and Java does not need to be installed
      • docker run --rm -v "$PWD":/src -w /src -p 8080:8080 openjdk:8 java -jar karate.jar -S
  • navigate to http://localhost:8080 to view the app
  • you can add -p to change the port number if needed e.g. -p 8000

Running as an AWS Lambda

Yet to be documented as part of the Karate project, but do get in touch if you are interested !

About

Web UI that can run within a single AWS Lambda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published