Skip to content

kierke-gaard/redekunst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redekunst

Chatbot as clojure/clojurescript/re-frame web-application with server/client part connected via websocket. Figwheel for debugging.

Tested with java 14 and leiningen 2.8.1, Chrome

Project based on a leiningen template containing server, debugging and testing lein new re-frame fullstack +10x +handler +test

Development Mode

Run application:

lein clean
lein figwheel dev

Figwheel will automatically push cljs changes to the browser. Wait a bit, then browse to http://localhost:3448.

In the repl invoke the function

(fullstack.dev-server/start-dev)

Note that you could run a repl in emacs via cider through M-x cider-jack-in or C-c M-j.

Run tests:

Install karma and headless chrome

npm install -g karma-cli
npm install karma karma-cljs-test karma-chrome-launcher --save-dev

And then run your tests

lein clean
lein doo chrome-headless test once

Please note that doo can be configured to run cljs.test in many JS environments (phantom, chrome, ie, safari, opera, slimer, node, rhino, or nashorn).

Production Build

lein clean
lein uberjar

That should compile the clojurescript code first, and then create the standalone jar. If it's not set, it will run on port 80 by default.

To compile clojurescript to javascript:

lein clean
lein cljsbuild once min

These jobs are defined in the project.clj. So lein uberjar suffices.

Run production build

run the compiled uberjar with

java -cp "./*" fullstack.server &

in the directory target. Or

java -tar fullstack.jar fullstack.server &

Then browse to http://localhost:port where port is defined as prod-port in config

Docker

Build Image

shell execute in root dir

docker build -t image_name .

Run Container

docker run -p 80:80 --name container_name image_name

Add Container to Azure Container registry

az acr build --file Dockerfile --registry dockercontainerregistryjcla --image r .

About

Chat bot in clojure/clojure-script

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages