Skip to content
brix.v2 stable

Search documentation

70 guides

Documentation menu
Docs / Getting startedRead Markdown ↗

Introduction

Brix is an opinionated web platform for server-rendered Hono and Preact applications, typed routes, selective hydration, testing, and project workflows.

Release status

Brix 2 is stable and distributed from a private Git repository. New projects use the stable channel by default and record the resolved exact version. Review release changes before upgrading that pin.

Every developer and CI job needs Git and SSH access to the private Brix repository. The installer uses the caller's SSH identity; it does not make the framework public.

What Brix provides

A full-stack Brix application combines:

  • Hono application infrastructure and server-side rendering
  • Preact components with opt-in interactive islands
  • typed page and API contracts shared across boundaries
  • route discovery from conventional feature directories
  • managed Vite, Vitest, Oxfmt, Oxlint, TypeScript, and Panda CSS
  • a project-pinned brix command for development through deployment

Brix also supports libraries, UI libraries, workspaces, and browser-only React applications. The SSR pages and islands described in these docs use the Hono and Preact application type.

The application boundary

A generated application keeps framework wiring small. Browser-safe factories live in src/brix.ts:

import { defineBrix } from "brix/contracts";

export const brix = defineBrix();
export const { createApiContract, createPageContract, executeApi, getPath } = brix;

Server-only integrations live in src/brix.server.ts:

"use server";

import { defineBrixServer } from "brix/server";
import { brix } from "./brix.ts";

export const brixServer = defineBrixServer(brix);
export const { createApiRoute, createFragment, createPageRoute } = brixServer;

The application entry delegates infrastructure to Brix:

import { createBrixApp } from "brix/server";
import { brixServer } from "./brix.server.ts";

export const app = createBrixApp(brixServer);

createBrixApp owns route assembly, SSR, assets, request IDs, security headers, and default error handling. Feature modules define contracts, routes, components, and tests rather than rebuilding that infrastructure.

The normal workflow

Use Brix commands rather than invoking its underlying tools directly:

brix dev
brix check
brix test
brix build

The project records one exact Brix version. Normal commands execute that installed version, keeping the framework and toolchain aligned.

Where to go next

Start with installation, then learn the project structure. Build a page, add an API route, and introduce islands only where interaction is needed. Finish with testing and deployment.

The rest of the platform is organized by the work it supports: