Skip to content

nakkaya/weave

Repository files navigation

Weave

Weave is an easy-to-use, Clojure-based web application framework.

Weave enables the creation of full-stack web applications in Clojure including the user interface. It’s great for micro web apps, dashboards, admin interfaces, smart home solutions, and similar use cases.

Features

  • Browser-based graphical user interface with real-time updates
  • Reactive UI with server-sent events (SSE) for instant updates
  • Standard GUI elements like labels, buttons, forms, and inputs
  • Simple component organization with Hiccup syntax
  • Client-side routing with hash-based navigation
  • Built-in session management and authentication
  • Server-side rendering with client-side interactivity
  • Push updates to specific browser tabs or broadcast to all sessions
  • GraalVM compatible. See demo/Dockerfile for static single executable builds
  • Automatically generate and serve the needed resources for Progressive Web Apps (PWA)

Installation

Add Weave to your `deps.edn` file:

{weave/core {:git/url "https://github.com/nakkaya/weave/"
             :git/sha "LATEST_SHA"}}

Weave in 1 minute

(ns app.core
  (:require [weave.core :as weave]))

(defn view []
  [:div.p-6
   [:h1#label.text-2xl.font-bold "Hello Weave!"]
   [:button.bg-blue-500.text-white.px-4.py-2.rounded
    {:data-on-click
     (weave/handler []
      (weave/push-html!
       [:h1#label.text-2xl.font-bold "Button was clicked!"]))}
    "CLICK ME"]])

(defn -main []
  (weave/run view {}))

Examples

The repository includes several example applications demonstrating Weave’s capabilities:

CounterSimple state management with atomic updates
Todo ListForm handling and dynamic content
NavigationClient-side routing with hash-based URLs
AuthenticationSession management with login/logout

Why Weave?

Weave combines the simplicity of Hiccup templates with the power of server-side rendering and real-time updates. It provides a cohesive development experience where your UI logic lives alongside your application code.

Unlike traditional SPAs that require separate frontend and backend codebases, Weave lets you build interactive web applications using only Clojure. The server pushes UI updates directly to the browser using server-sent events, eliminating the need for complex client-side JavaScript frameworks.

Documentation

For more detailed documentation see Documentation.

License

Copyright © 2025

Distributed under the Eclipse Public License, the same as Clojure.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •