Skip to content

bens-schreiber/cloesce

Repository files navigation

cloesce (alpha, v0.1.0)

Alpha Note: Cloesce is under active development, expanding its feature set as it pushes toward full Cloudflare support across any language. In this alpha, breaking changes can occur between releases.

Cloesce converts class definitions into a full stack Cloudflare application.

Inspired by

Cloesce is not just an ORM, migration engine, web framework, runtime validation library, IaC tool, or API Generator. It is all of these things and more, wrapped in a clean paradigm that makes building Cloudflare applications a breeze.

@Model(["GET", "SAVE", "LIST"])
class User {
    id: Integer;
    name: String;
    posts: Post[];

    @KV("user/settings/{id}", namespace)
    settings: KValue<unknown>;

    @R2("user/avatars/{id}.png", bucket)
    avatar: R2Object;

    @POST
    async hello(): User {
        // D1, KV, and R2 all hydrated here!
        return this;
    }
}

Documentation

See the Cloesce Docs for more information on getting started, language features, architecture, and roadmap.

Utilize an LLM to interact with the docs in a conversational way:

curl https://cloesce.pages.dev/llms-full.txt -o llms-full.txt

See the Typescript API Reference for the generated client library documentation.

Contributing

Contributions are welcome at all levels. Join our Discord to discuss ideas, report issues, or get help getting started. Create an issue on GitHub if you find a bug or have a feature request.

Coalesce

Check out Coalesce, an accelerated web app framework for Vue.js and Entity Framework by IntelliTect. Cloesce takes much of its inspiration from Coalesce (Cloesce = Cloudflare + Coalesce).)

Building, Formatting, Testing

Prerequisites

Before building, ensure you have the required dependencies installed:

Required:

  • Rust (with wasm32-unknown-unknown and wasm32-wasip1 targets)
  • Node.js and npm

Optional (but recommended):

  • binaryen (for WASM optimization) - brew install binaryen
  • pandoc (for documentation) - brew install pandoc
  • mdbook (for documentation) - cargo install mdbook

Run make check-deps to verify your setup.

Build Commands

All relevant commands can be found in the Makefile in the project root. Run make all to build, format and test all packages.