Skip to main content

Cav

Cav is a solo developer’s web framework, made for Deno. Guiding principles:

  • Modular, maintainable server definitions
  • No-fuss data serialization
  • Automatic end-to-end typesafety
  • Isomorphic client
  • Use The Platform

Status: WIP, active, almost tested, and definitely not ready for production.

Goals

  • Learn as much as possible about backend web frameworks, by writing one from scratch Deno
    • Zero third-party dependencies
  • It should come with everything a modern web server might need, without relying on third-party services (minus the database)
    • Routing
    • Static asset serving
    • Signed cookies and JWTs
    • Web sockets
    • Form and JSON parsing / validation
    • De/serialization of most data types, including Files, Dates, Maps, etc.
    • Dev-time bundling for TypeScript assets
    • Works with frontend frameworks like Preact
  • “Hello world” should be as easy as deno running a tiny main.ts
    • Zero config
    • Zero CLI commands
  • The client should use types imported from the server to catch API mistakes at the IDE level automatically
    • End-to-end typesafety
    • Compatible with Zod data parsers
  • Most tasks should be typesafe without needing to write TypeScript
    • Uses inferencing and generics behind-the-scenes
    • Maximal TypeScript benefits, minimal TypeScript
  • Its syntax should be functional and declarative
    • Immutable, schema-like Router and Endpoint definitions
    • No hidden context
    • No middleware
    • No magic Yes magic 🧙‍♂️
  • Production deployments should be a simple git-commit-push

Non-goals

  • React-first
  • Built-in SSR and hydration
  • SSG
  • Strict file/folder structure
  • File-system based routing
  • Make everyone happy
  • Money

Inspirations

Dedication

Cav is dedicated to the bar it’s named after. 🍻