Quick Start

Quick Start

Viewing typescript

switch to python

Prerequisites

Create Your Moose Project

Initialize a New Project

Terminal
npx create-moose-app@latest my-moose-app ts

This creates a new project with all necessary files and configuration.

Set Up Project Dependencies

Terminal
cd my-moose-app && npm install

Start the Development Server

Terminal
npx moose-cli dev

Verify Infrastructure Setup

Open a new terminal, navigate to your project directory, and run:

Terminal
npx moose-cli ls 

You should see this output showing your ingestion points and tables:

Data ModelIngestion PointTable
Foo/ingest/FooFoo_0_0
Bar/ingest/BarBar_0_0

Understanding Data Models

Explore Data Models

Your project includes two sample data models in app/datamodels/models.ts:

/app/datamodels/models.ts
import { Key } from "@514labs/moose-lib";
 
export interface Foo {
  primaryKey: Key<string>;
  timestamp: Date;
  optionalString?: string;
}
 
export interface Bar {
  primaryKey: Key<string>;
  utcTimestamp: Date;
  hasString: boolean;
  stringLength: number;
}
MooseTip:

Moose automatically creates database tables and ingestion endpoints for these models. Run npx moose-cli ls to see them.

Ingest Data

Send Data to an Ingestion Endpoint

Terminal
curl -X POST "http://localhost:4000/ingest/Foo" \
  -H "Content-Type: application/json" \
  -d '{"primaryKey": "1234567890", "timestamp": 1546300801.0, "optionalString": "hello world"}'

Verify Data Ingestion

Terminal
npx moose-cli peek Foo

You should see your ingested data:

{"primaryKey": "1234567890", "timestamp": 1546300801.0, "optionalString": "hello world"}

Troubleshooting

Next Steps

Congratulations!

You've successfully set up a Moose project and ingested your first data.

Create Ingestion Workflows

Build data pipelines with Moose Workflows

Stream Processing

Process data streams with Streaming Functions

Create Analytics APIs

Build and expose fully-typed APIs to consume your processed data

Database Connectivity

Connect to the local ClickHouse database:

moose.config.toml
[clickhouse_config]
db_name = "local"
user = "panda"
password = "pandapass"
host = "localhost"
host_port = 18123
native_port = 9000
use_ssl = false

VSCode Integration