Skip to content

Repository files navigation

rain Slack

A Clojure/Script library for fast and flexible web apps.

When you start architecting a new web app, one of the foundational decisions you make is - "How and where do I want to render content?". Should it be rendered on the web server, build server, on the Edge, or directly on the client? Should it be rendered all at once, partially, or progressively? (patterns.dev)

Rain helps you answer these questions. Once you decide on an approach, you can use rain new to create an app from scratch and deploy it to a JAMstack host or cloud VPS provider in minutes. Check out the Installation and Usage sections to get started.

  • Supports multiple rendering patterns in the same app:
    • Static Site Generation (SSG)
    • Incremental Static Generation (ISG)
    • Server-Side Rendering (SSR)
    • Client-Side Rendering (CSR)
    • Hydration
  • Supports reusable code between the server and browser
  • Helpers for biff, reitit, reagent, and re-frame
  • Fast
  • Extensible

Status: alpha

Table of Contents

Installation

Command-Line Tool (CLI)

First, install bbin. Then run the following command:

bbin install io.github.rads/rain

Now you can run rain in your shell to see the docs for the CLI tool.

Library

Add io.github.rads/rain to your deps.edn:

io.github.rads/rain {:git/tag"v0.1.8":git/sha"c490345"}

See the Usage section for examples on how to use the library to build an app.

Docs

Usage

Rain supports multiple rendering patterns. See the table below to find an example based on your needs.

Note: This table is a work-in-progress and may change as Rain matures. For a more nuanced view of rendering patterns, see the Additional Resources section.

SSGISGCSRSSRHydration
Examplerain.examples.ssgbbin-siteTODOTODOrain.examples.todomvc
Commandrain new -t ssgTODOTODOTODOrain new -t hydration
Use CasesLanding pages, blogsDashboardsFull-featured appsDocument-based sitesSupports both CSR and SSR use cases
Host as a static site (JAMstack)?YesYesYesNoNo
API required?NoNoYesNoYes
Custom server required?NoNoNoYesYes
JavaScript required for viewing?NoNoYesNoNo
JavaScript required for interaction?NoNoYesNoYes
Dynamic content on build?YesYesYesYesYes
Dynamic content after deploy?NoYesYesYesYes
Dynamic content based on request?NoNoYesYesYes
User login supported?NoNoYesYesYes
First Content Paint (FCP)?GoodGoodVariesGoodGood
Time-to-Interactive (TTI)?GoodGoodVariesGoodVaries

Additional Resources