MooseStack

5 minute setup
Pre-integrated ClickHouse, Redpanda, Temporal
Hot-reload development

Type-safe, code-first tooling for building real-time analytical backends—OLAP Databases, Data Streaming, ETL Workflows, Query APIs, and more.

Get Started

Install Moose
bash -i <(curl -fsSL https://fiveonefour.com/install.sh) moose

Everything as Code

Declare all infrastructure (e.g. ClickHouse tables, Redpanda streams, APIs, etc.) and pipelines in pure TypeScript or Python. Your code auto-wires everything together, so no integration boilerplate needed.

Complete Analytical Backend in 1 TS file
import { Key, OlapTable, Stream, IngestApi, ConsumptionApi } from "@514labs/moose-lib";
 
interface DataModel {
  primaryKey: Key<string>;
  name: string;
}
// Create a ClickHouse table
export const clickhouseTable = new OlapTable<DataModel>("TableName");
 
// Create a Redpanda streaming topic
export const redpandaTopic = new Stream<DataModel>("TopicName", {
  destination: clickhouseTable,
});
 
// Create an ingest API endpoint
export const ingestApi = new IngestApi<DataModel>("post-api-route", {
  destination: redpandaTopic,
});
 
// Create consumption API endpoint
interface QueryParams {
  limit?: number;
}
export const consumptionApi = new ConsumptionApi<QueryParams, DataModel[]>("get-api-route", 
  async ({limit = 10}: QueryParams, {client, sql}) => {
    const result = await client.query.execute(sql`SELECT * FROM ${clickhouseTable} LIMIT ${limit}`);
    return await result.json();
  }
);

Core Concepts

Data Modeling

Model all of your infrastructure in native TypeScript or Python. Share the same types across all components.
interface Event {
  id: Key<string>;
  name: string;
  createdAt: Date;
}
 
interface AggregatedEvent {
  count: number;
  name: string;
}

Local Development Environment

Run your entire analytical backend on your laptop, hot reloading schema migrations as you work.
# Start local dev server
moose dev
 
 Starting local infrastructure
  Successfully started containers
  Validated clickhousedb-1 docker container
  Validated redpanda-1 docker container
  Successfully validated red panda cluster
  Validated temporal docker container
  Successfully ran local infrastructure

Modules

Moose OLAP

Store and query data with ClickHouse's columnar engine—100x faster than traditional databases for analytics. Manage tables, materialized views, and data migrations in code.
const table = new OlapTable<Event>("events");
 
const mv = new MaterializedView<AggregatedEvent>({
  selectStatement: sql`
    SELECT count(*) as count, name
    FROM ${table}
    GROUP BY name
  `,
  selectTables: [table],
  tableName: "events",
  materializedViewName: "aggregated_events"
});

Moose Streaming

Build real-time data pipelines with Kafka/Redpanda streams and transformations in code
const stream = new Stream<Event>("events", {
  destination: table,
});
 
stream.addConsumer((event) => {
  console.log(event);
});

Moose Workflows

Build ETL pipelines and task orchestration with in-memory workflow code
const etl = new Workflow("my_etl", {
  startingTask: startEtl,
  schedule: "@every 1h",
  retries: 3,
});

Moose APIs

Type-safe ingestion and query endpoints with auto-generated OpenAPI docs.
const postEvent = new IngestApi<Event>("post-event", {
  destination: stream,
});
 
const getEvents = new ConsumptionApi<Params, Event>("get-events", {
  async handler({limit = 10}, {client, sql}) {
    // query database and return results
    return await client.query.execute(sql`
      SELECT * FROM events LIMIT ${limit}
    `);
  }
});

Modular Design

Each module is independent and can be used on its own. You can start with one capability and incrementally adopt more over time.

Tooling

Moose Build

Easily package up your application for deploying to production
# Build for production
moose build

Moose Migrate

Preview and validate infrastructure changes before deployment with detailed schema diffs, migration planning, and rollback capabilities
# Create a plan
moose plan
 
# Example plan output:
  ~ Table events with column changes: [
    Added(
      Column { 
        name: "status", 
        data_type: String,
        required: true, 
        unique: false, 
        primary_key: false, 
        default: None 
      })] 
    and order by changes: OrderByChange { 
      before: [], after: [] 
    }
 

Technology Partners

Managed Moose in Production

Want this managed in production for you? Check out Boreal Cloud (from the makers of the Moose Stack).