Build APIs with Breeze

BreezeAPI is a TypeScript framework that aims to make building APIs a breeze.

import { t, HttpContext } from '@breezeapi/core';
import { sendToChannel } from '@breezeapi/discord';

export const GET_config = {
  querys: t.object({ name: t.string() }),
  response: t.string(),
};

export async function GET(ctx: HttpContext) {
  const name = ctx.querys?.name || "No name";
  await sendToChannel('1364724391392579695', `New registration: ${name}`);
  return Response.json({ name });
}
Why BreezeAPI?

Features that make development a breeze

Some of the features we offer to help you build your API faster.

File-based Routing

Create routes by simply adding files to your project. BreezeAPI automatically maps your file structure to endpoints.

Builtin Sync Layer

BreezeAPI comes with a built-in sync layer, that allowes you to sync your websocket data with your database.

Plugin System

We allow you to build your own plugins, that can deeply integrate into the framework and make it even more powerful.

Multi Protocoll Support

Add Websockets, http routes, tRCP or TCP to your API just by adding a file. No config required!

Get started in seconds

BreezeAPI is designed to be simple to set up and use

Terminal
# Install BreezeAPI
bun add @breezeapi/core

# Initialize a new project
coming soon...

Ready to build your API?

Start building with BreezeAPI today and let us know what you think.

Experimental

Documentation out of the box

BreezeAPI automatically generates Documentation for your API endpoints and all other supported protocols. This is still experimental and does currently not contain a option to add it as ui.

  • OpenAPI compatible
  • No config required
  • Automatic route discovery
  • Disable it if you don't need it
http://localhost:3000/docs

BreezeAPI Documentation

v1.0.0
GET/users

Get all users

POST/users

Create a new user

GET/users/{id}

Get a user by ID

sockets/chat/[id].ts

export function open(ctx) {
  // Handle connection logic here
}

export function message(ctx, msg) {
  let parsed;
  try {
    parsed = JSON.parse(msg);
  } catch {
    ctx.send(JSON.stringify({ type: 'error', error: 'Invalid JSON' }));
    return;
  }
  if (!parsed.user || !parsed.text) {
    ctx.send(JSON.stringify({ type: 'error', error: 'Missing user or text' }));
    return;
  }
  // Handle the message (e.g., echo or broadcast)
  ctx.send(JSON.stringify({ type: 'message', user: parsed.user, text: parsed.text, ts: Date.now() }));
}

export function close(ctx) {
  // Handle cleanup here
}
Real-time

Dynamic WebSocket routing

Create dynamic WebSocket endpoints with the same file-based routing system. Perfect for chat rooms, live dashboards, and anything you can imagine.

  • Dynamic route parameters
  • Isolated state per endpoint
  • Targeted broadcasting