Giter Club home page Giter Club logo

dream-branches's Introduction

Dream

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



bash -c "$(curl -fsSL https://raw.githubusercontent.com/aantron/dream/master/example/quickstart.sh)"


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:


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. 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 takes care of horridness like ALPN.

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.


Quick start

bash -c "$(curl -fsSL https://raw.githubusercontent.com/aantron/dream/master/example/quickstart.sh)"

This script does a sandboxed build of one of the first tutorials, 2-middleware, which you can then edit.

It's mostly the same as:

git clone https://github.com/aantron/dream.git
cd dream/example/2-middleware
npm install esy && npx esy
npx esy start

Knowing that, you can start from any other example. All of them include their own build commands. You can copy them out to start your own project directory. Especially consider starting with the full-stack examples, which build both a Dream server and a JavaScript client.

opam

opam install dream

After that, go to one of the examples, such as 1-hello, and build it:

cd example/1-hello
dune exec --root . ./hello.exe

Documentation


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.

As an immediate note, if you'd like to clone the repo, be sure to use

git clone https://github.com/aantron/dream.git --recursive

The --recursive flag is necessary because Dream uses several git submodules.


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:


Roadmap

  • GraphQL subscriptions.
  • Optimizations: router, logger, microparsers (form data, etc.), fully zero-allocation streaming.
  • WebSocket and stream backpressure.
  • HTTP3/QUIC.
  • Review JSON.
  • Review SQL prepared statements.
  • Switch to AEAD_AES_256_GCM_SIV for the cipher.
  • WebSocket streaming (frames).
  • Factor out internal sub-libraries to port Dream to MirageOS, etc.
  • Token rotation-based session management.
  • Lots of optionals for decoupling defaults, e.g. forms without CSRF checking, SQL sessions with a different database.
  • Bundle GraphiQL into a single HTML file that does not access any external CDN.
  • Maybe a logo.
  • i18n helper, URL templates.
  • Auth library.
  • Maybe REST helpers.
  • Maybe Async support.
  • Multicore.
  • Effects.
  • Proxy headers support.
  • Introspection.
  • Dependency reduction, especially system dependencies.
  • And lots, lots more.

dream-branches's People

Contributors

aantron avatar dinosaure avatar lessp avatar persianturtle avatar tmattio avatar xvw avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.