Skip to content

gigasquid/coils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clojure on Coils

Website found at http://coils.cc

Clojure on Coils

A web framework for Clojure. A few notes:

  • Uses Clojure for the server side
  • Uses ClojureScript for the client side
  • Best developed and run using the LightTable IDE

Installation

git clone https://github.com/zubairq/coils.git

Then rename the folder coils to the name of your project

Adding something to the page

Go to a clojurescript view in src/webapp/client/views

From the Lighttable IDE:

(add-to "main" "<div>hello world</div>")

Client side message passing system (AKA events)

Define an action: (redefine-action "Say something" (js/alert "Hello") )

Call an action: (do-action "Say something")

Calling server side code

Define in fns.clj on the server side (using core.async):

(defn say-hello [params]
    {:text (str "Hello " (:name params))}
)

From the client side:

(go
     (js/alert
         (:text (<! (remote "say-hello" {:name "Johnny"})))))

Client side SQL

(go
    (.log js/console (str (<! (sql "SELECT * FROM test_table where name = ?" ["shopping"] ))))
 )

Please note that the SQL is not visible from web browsers as it is encryted via a server side macro.

About

Clojure web frameowrk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.6%
  • CSS 22.9%
  • Clojure 10.5%