Skip to content

Latest commit

Β 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Goddo πŸ›‘οΈ

JSR JSR Score

Goddo Kurosu – God Cloths

Goddo Logo

An ergonomic web framework for Deno, engineered to recreate the ElysiaJS syntax with a 1:1 Developer Experience (DX). Enjoy End-to-End Type Safety, seamless autocompletion, and an incredibly intuitive API β€” zero npm dependencies, built exclusively with native Deno and Web Platform APIs.

Requirements

Starting a New Project

Goddo and its plugins are published on the JSR registry under the @goddo scope.

Install the core framework:

deno add jsr:@goddo/core

Official Plugins

You can install only the plugins you need to keep your server lightweight:

To install multiple packages at once:

deno add jsr:@goddo/core jsr:@goddo/html jsr:@goddo/cors

Quick Start

import { Goddo } from '@goddo/core'

new Goddo()
  .get('/', () => 'Hello Goddo')
  .get('/user/:id', ({ params: { id } }) => id)
  .post('/mirror', ({ body }) => body)
  .listen(3000)

Examples

You can find a complete standalone demo using the published JSR packages at: carlosxfelipe/goddo-example

There is also a local demo within this repository (src/), which you can run using:

deno task dev

ElysiaJS Compatibility

Goddo's core API is designed to mirror ElysiaJS as closely as possible, making migration straightforward for Deno projects. The table below shows the current parity:

Feature ElysiaJS Goddo Notes
Route handlers (get, post, etc.) app.get('/', () => ...) βœ… app.get('/', () => ...) Identical
Path params ({ params }) => params.id βœ… Same Identical
Schema validation (t) t.Object, t.String βœ… Same builders Identical
t.Numeric βœ… βœ… Coerces string to number
t.Files, t.Record, t.Tuple βœ… βœ… Files support maxSize / type
t.Intersect, t.ObjectString βœ… βœ… ObjectString parses JSON strings
Lifecycle hooks onRequest, onBeforeHandle, etc. βœ… Same hooks Including onMapResponse
onMapResponse βœ… βœ… Runs after handler / before response
Plugin encapsulation `.as('scoped' 'global')` βœ… Same
.state() / .decorate() βœ… βœ… Injected into context
.mount() βœ… βœ… Mount fetch-compatible apps
.model() βœ… βœ… Named reusable schemas + OpenAPI $ref
.trace() βœ… βœ… Per-stage timing hooks
Generator/SSE handlers function* () { yield sse(...) } βœ… Same Auto text/event-stream
AOT compilation aot: false βœ… Same Enabled by default
WebSocket app.ws() βœ… Same With pub/sub
Treaty / Eden @elysiajs/eden βœ… @goddo/treaty End-to-end type-safe client
GraphQL plugin @elysiajs/graphql ❌ Not yet Out of current scope
OpenTelemetry @elysiajs/opentelemetry βœ… @goddo/opentelemetry OpenTelemetry distributed tracing
tRPC plugin @elysiajs/trpc ❌ Not yet Out of current scope

For a practical migration example:

// ElysiaJS
const app = new Elysia()
  .state('version', '1.0')
  .model('user', t.Object({ id: t.Number(), name: t.String() }))
  .get('/', ({ version }) => version)
  .post('/user', ({ body }) => body, { body: 'user' })
  .listen(3000)

// Goddo (Deno)
const app = new Goddo()
  .state('version', '1.0')
  .model('user', t.Object({ id: t.Number(), name: t.String() }))
  .get('/', ({ version }) => version)
  .post('/user', ({ body }) => body, { body: 'user' })
  .listen(3000)

Tasks

Task Description
deno task dev Demo app (src/) with watch
deno task start Demo app (src/)
deno task test Runs the test suite
deno task coverage Generates code coverage report
deno task check Type-check
deno task fmt Formats the code
deno task lint Linting
deno task bench Runs performance benchmarks

Documentation

The full API reference, routing syntax, validation schemas, and plugins are available on our official website.

Read the Full Documentation here

Performance (AOT Compilation)

Goddo compiles all routes into a single optimized handler at listen() time (or when compile() is called manually). This Ahead-Of-Time compilation provides:

  • Pre-merged hooks: global and route-level lifecycle hooks are merged once, not per-request
  • Pre-computed flags: validation checks use boolean flags instead of truthiness checks on every request
  • Static route map: routes without dynamic segments (:param / *) are stored in a Map for O(1) lookup, bypassing the radix tree
  • Sucrose detection: sync handlers skip the await overhead by detecting async functions via source inspection
  • V8-Optimized Context: utilizes a specialized GoddoContext class to leverage hidden classes, lazily evaluating query, headers, and cookie only when accessed
  • Fast URL Parsing: manual extraction of paths using string indices instead of the heavy new URL()
  • Method-Aware Execution: automatically skips body parsing ticks for GET and HEAD requests
const app = new Goddo()
  .get('/', () => 'Hello')
  .get('/user/:id', ({ params }) => params.id)

app.compile() // optional β€” listen() calls this automatically
app.listen(3000)

Benchmarks

deno task bench

Goddo was heavily optimized to offer world-class performance, standing toe-to-toe with the fastest runtimes available. Thanks to the integrated Ahead-Of-Time (AOT) compiler and Just-In-Time (JIT) schema validation, Goddo excels particularly in heavy I/O operations (like POST/PATCH requests with JSON payloads).

Below is a direct comparison between Goddo and the original ElysiaJS using the same API structure (measured in requests per second on an Apple M1):

Route / Benchmark ElysiaJS (Bun v1.3.14) Goddo (Deno v2.9.3) Comparison
PATCH /todos/1 (Update JSON) ~276,200 req/s 274,600 req/s Elysia is ~1% faster
POST /todos/ (Create JSON) ~301,200 req/s 273,800 req/s Elysia is ~10% faster
DELETE /todos/2 (Delete) ~450,500 req/s 373,900 req/s Elysia is ~20% faster
GET /todos/1 (Get specific) ~657,900 req/s 564,200 req/s Elysia is ~17% faster
GET /todos/ (List all) ~900,900 req/s 607,800 req/s Elysia is ~48% faster
GET /page (HTML Render) ~97,500 req/s 65,080 req/s Elysia is ~50% faster
GET / (Redirect) ~1,035,000 req/s 728,900 req/s Elysia is ~42% faster

While Elysia leverages Bun's heavily optimized internal router for static and lightweight GET endpoints, Goddo closely matches Elysia where it matters most: complex validation and JSON parsing operations (POST/PATCH), making it exceptionally suited for heavy database-driven applications.

Note on HTML Rendering (/page): While Bun features highly specialized C++ string optimizations in its engine for JSX concatenation, Goddo still delivers one of the fastest JSX pipelines in Deno by completely eliminating redundant parser allocations.

Note on Redirect (/): For extremely lightweight routes like redirects, benchmark performance is dominated by the native-to-JS bridge overhead (FFI). Bun's deep C++ uSockets integration natively outpaces Deno's Rust-to-V8 bridge for empty requests, though this advantage disappears once real JavaScript logic and JSON parsing are introduced.

API Collections

This project includes API collections for Bruno, an open-source IDE for exploring and testing APIs.

To use them:

  1. Open Bruno.
  2. Click Open Collection.
  3. Select the bruno/ directory.

Code Formatting

This project uses Deno's built-in formatter. To ensure consistent code style across the project, run:

deno fmt

Formatting rules and file exclusions are managed in deno.json.

VS Code Setup

If you use VS Code and have the Prettier extension installed, it may conflict with Deno's formatter. To use Deno's formatter automatically on save, add the following to your .vscode/settings.json:

"[typescript]": {
  "editor.defaultFormatter": "denoland.vscode-deno"
},
"[typescriptreact]": {
  "editor.defaultFormatter": "denoland.vscode-deno"
}

Structure

  • assets/ β€” Static assets for the repository (e.g. logos, images).
  • src/ β€” Demo application serving as an example of how to use Goddo.
  • site/ β€” Documentation & examples website (dogfoods Goddo itself), CDN-only, no build step. See site/README.md.
  • packages/ β€” Monorepo containing the framework and all plugins.
    • packages/core/ β€” Framework core containing routing, context, validation, and all built-in features.
    • packages/<plugin>/ β€” Official built-in plugins (like HTML, OpenAPI, CORS, Rate Limit, etc.) as independent packages.
  • bruno/ β€” Bruno API collections for testing the demo application endpoints.
  • tests/ β€” Comprehensive test suite for the Goddo core and all its plugins.
  • benchmarks/ β€” Performance benchmarks for router lookup, handler throughput, and compilation overhead.

Testing & Coverage

Goddo is built with reliability in mind, backed by a robust suite of over 200 unit tests covering core routing, parsing, validation, and plugin features. While it is highly capable, extremely fast, and deeply typed, it is a new framework; we encourage you to test it thoroughly for your specific use cases before large-scale production deployments.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages