Skip to content
main
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Blueboat

CI

Blueboat is an open-source alternative to Cloudflare Workers and aims to be a developer-friendly, multi-tenant platform for serverless web applications.

A simple Blueboat application looks like:

Router.get("/", req => new Response("hello world"));

Router.get("/example", req => {
  return fetch("https://example.com");
});

Router.get("/yaml", req => {
  const res = TextUtil.Yaml.stringify({
    hello: "world",
  });
  return new Response(res);
});

Features

Supported and planned features:

  • Standard JavaScript features supported by V8
  • A subset of the Web platform API
    • fetch(), Request and Response objects
    • TextEncoder, TextDecoder
    • Timers
      • setTimeout, clearTimeout
      • setInterval, clearInterval
    • URL, URLSearchParams
    • crypto.getRandomValues
    • crypto.randomUUID
    • crypto.subtle
    • console
      • console.log()
      • console.warn()
      • console.error()
  • Request router
    • The Router object
  • Cryptography extensions
    • Ed25519 and X25519: NativeCrypto.Ed25519, NativeCrypto.X25519
    • JWT signing and verification: NativeCrypto.JWT
    • Hashing: NativeCrypto.digest
  • Graphics API
    • Canvas (Graphics.Canvas)
    • Layout constraint solver based on Z3 (Graphics.Layout)
  • Template API
    • Tera template rendering: Template.render()
  • Encoding and decoding
    • Codec.hexencode(), Codec.hexdecode()
    • Codec.b64encode(), Codec.b64decode()
  • Embedded datasets
    • MIME type guessing: Dataset.Mime.guessByExt()
  • Background tasks
    • Background.atMostOnce()
    • Background.atLeastOnce()
    • Background.delayed()
  • Data validation
    • JSON Type Definition validation: Validation.JTD
  • Text utilities
    • YAML serialization and deserialization: TextUtil.Yaml.parse(), TextUtil.Yaml.stringify()
    • Markdown rendering: TextUtil.Markdown.renderToHtml()
  • Native API to external services
    • MySQL client
    • Apple Push Notification Service (APNS) client

The entire API definition is published as the blueboat-types package.

Deploy your own Blueboat instance

Blueboat depends on various external services such as FoundationDB and Kafka to operate reliably as a distributed system, but you don't need all these services to run Blueboat on a single machine. Just pull b6t - this contains all necessary dependencies to get Blueboat up and running.

After starting b6t you need to set up a reverse proxy such as Nginx or Caddy to accept external traffic. Blueboat loads the application's metadata from the S3 key specified in the X-Blueboat-Metadata header, and this information should be provided by the reverse proxy.

An example Caddy config looks like:

hello.blueboat.example.com {
  reverse_proxy blueboat:3000 {
    # S3 path to application metadata
    header_up X-Blueboat-Metadata "test/metadata.json"
    header_up X-Blueboat-Client-Ip "{remote_host}"

    # Prevent faked request id
    header_up -X-Blueboat-Request-Id
  }
}

Automatic deployments

b6t's readme describes a simple way to manually deploy apps, but if you need an automatic multi-tenant deployment service, you can deploy the bbcp app (which itself runs on Blueboat) and use the bbcli tool.

License

Currently AGPL-3.0, but see #56.

About

Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Resources

License

Code of conduct

Stars

Watchers

Forks