Getting Started
Prerequisites
Under the hood
Fulgur is not a framework — it's a glue layer between three proven tools:
- Elysia — the server. Every route you write is a standard Elysia instance with full access to its validation, hooks, guards and plugin ecosystem.
- Eden Treaty — the client. Eden Treaty reads your Elysia types and generates a fully type-safe HTTP client at compile time. No code generation step, no OpenAPI spec to maintain.
- Vite — the dev server and build tool. Fulgur is a single Vite plugin that manages your backend process, proxies API requests in dev, and generates production entry points.
Create a new project
The fastest way to get started:
sh
bunx degit wiizzl/fulgur/examples/react-hello-world my-app
cd my-app
bun install
bun run devYour first route
Create src/api/hello.server.ts:
ts
import { Elysia } from "fulgur/server";
export const helloRoutes = new Elysia().get("/hello", () => {
return { message: "Hello World!" };
});Wire it up in the entry point
Create src/route.server.ts — this is the single file Fulgur reads:
ts
import { Elysia } from "fulgur/server";
import { helloRoutes } from "./api/hello.server";
const app = new Elysia().use(helloRoutes);
export default app;
export type App = typeof app;Call it from the client
ts
// src/lib/api.ts
import type { App } from "../route.server";
import { createClient } from "fulgur/client";
export const api = createClient<App>();Use it in any component:
tsx
import { api } from "./lib/api";
const { data } = await api.hello.get();
// data.message → "Hello World!"That's it. Types flow from server to client automatically.
