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
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.
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.
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.
SSG | ISG | CSR | SSR | Hydration | |
Example | rain.examples.ssg | bbin-site | TODO | TODO | rain.examples.todomvc |
Command | rain new -t ssg |
TODO | TODO | TODO | rain new -t hydration |
Use Cases | Landing pages, blogs | Dashboards | Full-featured apps | Document-based sites | Supports both CSR and SSR use cases |
Host as a static site (JAMstack)? | Yes | Yes | Yes | No | No |
API required? | No | No | Yes | No | Yes |
Custom server required? | No | No | No | Yes | Yes |
JavaScript required for viewing? | No | No | Yes | No | No |
JavaScript required for interaction? | No | No | Yes | No | Yes |
Dynamic content on build? | Yes | Yes | Yes | Yes | Yes |
Dynamic content after deploy? | No | Yes | Yes | Yes | Yes |
Dynamic content based on request? | No | No | Yes | Yes | Yes |
User login supported? | No | No | Yes | Yes | Yes |
First Content Paint (FCP)? | Good | Good | Varies | Good | Good |
Time-to-Interactive (TTI)? | Good | Good | Varies | Good | Varies |