Moose

Getting Started

Quickstart

Moose Quickstart Guide

Viewing typescript

switch to python

Prerequisites

  • OS: macOS or Linux (WSL supported for Windows)
  • Docker Desktop/Engine: 24.0.0+

Install Moose

The easiest way to install Moose is to use the one-liner below:

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

Moose CLI Version Manager

The Moose CLI has a built in version manager that will automatically install the correct version of Moose for your project.

Create Your Project

Initialize Project

First, create a new Moose project:

moose init my-moose-app typescript
cd my-moose-app

Install Project Dependencies

npm install

Start Development Server

Start your local development environment:

moose dev

Understand Project Structure

Your project contains:

app/
├── index.ts            # Entrypoint for your Moose app
├── ingest/             # Raw data ingestion and streaming
│   ├── models.ts     
│   └── transform.ts  

├── views/            # Materialized views and aggregations
│   └── barAggregated.ts

└── apis/            # Analytics APIs
    └── bar.ts      
├── scripts/
│   └── generator/   # Random data generator for testing

└── moose.config.toml    # Project config

Test Your Pipeline

How Data Flows

1

Data Ingestion

Raw data enters through HTTP endpoints into your Foo stream

2

Stream Processing

Data is transformed on the fly into your Bar stream before landing in ClickHouse

3

Live Aggregations

Materialized views continuously update aggregated data tables in real-time

4

Analytics APIs

Query your aggregated data through type-safe REST endpoints with filtering and sorting

Setting up the OpenAPI UI

Moose auto-generates an OpenAPI spec for your APIs, enabling direct testing from your editor. To set up:

  1. Install the OpenAPI (Swagger) Viewer extension in your IDE
  2. Open .moose/openapi.yaml in your IDE
  3. Click the “Preview” icon (magnifying glass) in the top-right corner to launch the OpenAPI UI

Send Test Data

  1. Navigate to the POST /ingest/Foo endpoint in the OpenAPI UI
  2. Click “Try it out”
  3. Use the sample request body provided or modify it
  4. Click “Execute” to send the request

You should see output like this in your terminal:

          POST ingest/Foo
        [POST] Data received at ingest API sink for Foo
      Received Foo_0_0 -> Bar_0_0 1 message(s)
          [DB] 1 row(s) successfully written to DB table (Bar)

Data landed in ClickHouse!

  • You sent raw data via HTTP POST to the /ingest/Foo endpoint
  • Data is validated and written to the Foo stream
  • Moose transformed the data into the Bar stream
  • Transformed data is automatically synced to the Bar ClickHouse table

Query Your Data

Test your analytics API:

  1. Locate the GET /consumption/bar endpoint
  2. Click “Try it out”
  3. Experiment with query parameters:
    • orderBy: Try “rowsWithText”
    • startDay: Enter a number (e.g., 1)
    • endDay: Enter a number (e.g., 10)
  4. Click “Execute” to see the results

The UI will show both the request URL and the response data in a formatted view.

Next Steps

Take a deeper dive into core Moose concepts: