Repository inventory

ymc182/bun-elysia-skill

Skills indexed from this repository, with install-style signals scoped to the repo.
1 skills0 GitHub stars0 weekly installsGitHubOwner profile

Overview

This skill helps you build full-stack applications using the Bun runtime and the Elysia.js framework. It bundles practical patterns for project setup, routing, validation, authentication, WebSocket, and Bun native APIs (SQL, Redis, S3). Use it to get fast, type-safe server code and smooth migrations from Fastify to Elysia.

How this skill works

The skill provides examples and recipes that wire Elysia routes to Bun native APIs and plugins, plus patterns for schema validation with Elysia's type helpers. It covers decorating the app with Bun services, grouping and guarding routes, WebSocket handlers, and a migration checklist for Fastify-to-Elysia differences. It also shows how to enable end-to-end type safety using Eden and how to structure monorepos with Bun workspaces.

When to use it

  • Starting a new Bun + Elysia project or scaffold (bun create elysia).
  • Connecting Elysia routes to Bun native APIs: SQL databases, Redis, or S3.
  • Implementing validation, authentication, or guarded API groups with Elysia types and middleware.
  • Adding WebSocket chat, subscription or realtime endpoints.
  • Migrating an existing Fastify app to Elysia while keeping behaviour consistent.

Best practices

  • Decorate the app with Bun native clients (sql, redis) to make them available across handlers.
  • Validate request params/body using Elysia's t.* helpers to keep runtime schemas and developer types aligned.
  • Use app.group and guard for authenticated route groups to centralize access control and reduce duplication.
  • Keep lifecycle hooks minimal; use beforeHandle for per-request checks instead of heavy global middleware.
  • Adopt Eden for a type-safe client-server contract and regenerate types when APIs change.

Example use cases

  • Simple REST API backed by Bun SQL client with typed request/response validation.
  • Real-time chat using Elysia.ws with room publish/subscribe and typed message bodies.
  • Protected /api route group that derives user from JWT and enforces access via guard beforeHandle.
  • Monorepo service with Bun workspaces sharing types and a type-safe Eden client across frontend and backend.
  • Migration plan converting Fastify routes, hooks, and plugins to Elysia equivalents with a mapping checklist.

FAQ

No. Elysia runs on Bun and benefits from Bun native APIs, but you can use Elysia handlers without Bun-specific clients. Decorating with Bun clients is optional.

How do I migrate Fastify plugins and hooks?

Map Fastify concepts to Elysia equivalents: preHandler -> beforeHandle, decorate -> .decorate(), register -> .use(). For validation map JSON Schema to Elysia's t.* types and translate lifecycle usage to Elysia hooks.

1 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational