Skip to content
Projects

camlworks/dream has 1,900 GitHub stars and 164 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 03:58 UTC. Last push 2026-11-02.

How these counts are measured

Tidy, feature-complete Web framework

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Dream

Easy-to-use, feature-complete Web framework without boilerplate.


let hello who =
  <html>
  <body>
    <h1>Hello, <%s who %>!</h1>
  </body>
  </html>

let () =
  Dream.run
  @@ Dream.logger
  @@ Dream.router [
    Dream.get "/" (fun _ -> Dream.html (hello "world"));
  ]

Quick Start | Tutorial | Reference   



Dream is one flat module in one package, documented on one page, but with many examples. It offers:


...all without sacrificing ease of use — Dream has:

  • A simple programming model — Web apps are just functions!
  • Composable middleware and routes.
  • Unified, internationalization-friendly error handling.
  • Cryptography helpers, key rotation, and a chosen cipher.
  • A neat logger, and attention to configuring the OCaml runtime nicely.
  • Deployment instructions for Digital Ocean, Heroku, and Fly.io, with sample CI scripts.

Every part of the API is arranged to be easy to understand, use, and remember. Dream sticks to base OCaml types like string and list, introducing only a few types of its own — and some of those are just abbreviations for bare functions!

The neat interface is not a limitation. Everything is still configurable by a large number of optional arguments, and very loose coupling. Where necessary, Dream exposes the lower-level machinery that it is composed from. For example, the basic body and WebSocket readers return strings, but you can also do zero-copy streaming.

You can even run Dream as a quite bare abstraction over its underlying set of HTTP libraries, where it acts only as minimal glue code between their slightly different interfaces.

And, even though Dream is presented as one package for ordinary usage, it is internally factored into several sub-libraries, according to the different dependencies of each, for fast porting to different environments.

Dream is a low-level and unopinionated framework, and you can swap out its conveniences. For example, you can use TyXML with server-side JSX instead of Dream's built-in templates. You can bundle assets into a single Dream binary, or use Dream in a subcommand. Dream tries to be as functional as possible, touching global runtime state only lazily, when called into.


Quick start

The easiest way to use Dream is via opam. Install it and create a switch if you don't already have one. Then clone Dream and run the first tutorial example, 1-hello:

git clone https://github.com/camlworks/dream.git
cd dream/example/1-hello
opam install . --deps-only
dune exec --root . ./hello.exe

--root . makes the example directory the Dune project root, so dune builds only the example against the dream package installed by opam, rather than the Dream source in the surrounding checkout. If you're modifying Dream itself and want to observe the changes in the examples drop the --root ..

esy

Some examples, such as w-esy, show how to package a Dream application with esy.


Documentation


Recommended projects


Example repositories


Contact

Apart from the issues, good places to discuss Dream are...

Highlight @antron to poke @aantron specifically.


Contributing

All kinds of contributions are welcome, including examples, links to blogs, related libraries, and, of course, PRs! See CONTRIBUTING.md.


Acknowledgements

Dream is based on work by the authors and contributors of its many dependencies and their transitive dependencies. There are, however, several influences that cannot be discovered directly:

Explore related projects