Effect HTTP backend API with TypeScript, part of the bEvr stack.
- Effect Platform - Api framework
- Bun - JavaScript runtime
- TypeScript - Type safety
- @repo/domain - Shared types and schemas
Copy the root .env.example to apps/server/.env and set
ANTHROPIC_API_KEY. The server requires the key at startup, including when
you only use REST or presence.
From the monorepo root:
# Start development server
bun run dev --filter=server
# Build for production
bun run build --filter=serverThe API runs on http://localhost:9000 in development.
The server uses Effect Platform HTTP API for type-safe, functional HTTP handling:
- Type-safe Routes: Shared types from
@repo/domain - CORS Support: Pre-configured for client communication
- Effect Integration: Functional error handling and data processing
- Bun runtime: Uses
@effect/platform-bunfor HTTP serving
import { Api, type ApiResponse } from "@repo/domain/Api";
import { Effect } from "effect";
import { HttpApiBuilder } from "effect/http-api";
const HelloGroupLive = HttpApiBuilder.group(Api, "hello", (handlers) =>
handlers.handle("get", () => {
const data: typeof ApiResponse.Type = {
message: "Hello bEvr!",
success: true,
};
return Effect.succeed(data);
}),
);The shared definition in Api.ts exposes
this handler at GET /hello/.
The server uses Vitest 5 with @effect/vitest for testing Effect-based code.
# Run server tests
bun run test --filter=server
# Run specific test file
bun run test --filter=server -- src/index.test.tsSee src/index.test.ts for complete it.effect examples.
Use it.effect() for tests that return Effect values. The test runner
automatically handles Effect execution and error propagation.