FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source514
  1. MooseStack
  2. Configuration
  3. Dev Environment

On this page

Lifecycle HooksCommon ExamplesFile WatcherDebugging Data FlowDocker Infrastructure ExtensionsUsageNetworking ReferenceDefault PortsService URLs

Dev Environment Configuration

This reference covers configuration options specific to the local development workflow (moose dev), including lifecycle hooks, Docker infrastructure extensions, and network defaults.

Lifecycle Hooks

Configure shell commands to run automatically during the development server's lifecycle. These are defined within the [http_server_config] section of your configuration.

[http_server_config]# Script to run once on first starton_first_start_script = "echo 'Dev server started'" # Script to run after every reload completeson_reload_complete_script = "echo 'Reload complete'"
KeyEnv VariableTypeDefaultDescription
on_first_start_scriptMOOSE_HTTP_SERVER_CONFIG__ON_FIRST_START_SCRIPTString-Shell command executed once when moose dev starts.
on_reload_complete_scriptMOOSE_HTTP_SERVER_CONFIG__ON_RELOAD_COMPLETE_SCRIPTString-Shell command executed after every code/infra reload.

Sync External Tables on Start

on_first_start_script = "moose db pull --clickhouse-url $REMOTE_DB_URL"

Regenerate Clients on Reload

on_reload_complete_script = "openapi-generator-cli generate -i .moose/openapi.yaml ..."

File Watcher

The dev server watches your project and hot-reloads when you save changes. Use ignore_patterns to exclude files generated by lifecycle hooks that you don't want to trigger reloads.

Execution Context

Scripts run from your project root using your system's default shell (usually /bin/sh or bash). You can chain commands using &&.

Common Examples

[watcher_config]# Patterns use standard glob syntaxignore_patterns = ["generated/**", "*.gen.ts"]

Debugging Data Flow

To debug data as it flows through your pipeline, use the --log-payloads flag:

moose dev --log-payloads

This logs payloads at three key points with searchable prefixes:

  • PAYLOAD:INGEST - Data received at ingest API
  • PAYLOAD:STREAM_IN - Data before streaming function
  • PAYLOAD:STREAM_OUT - Data after streaming function

All logs appear in Moose logs and can be viewed using moose logs --tail.

Docker Infrastructure Extensions

Extend the default Moose development infrastructure by creating a specific override file in your project root.

File NamePurpose
docker-compose.dev.override.yamlAdds or overrides services in the generated Docker Compose setup.

Usage

Create docker-compose.dev.override.yaml to add services like PostgreSQL or monitoring tools. Moose automatically detects and merges this file when running moose dev.

# docker-compose.dev.override.yamlservices:  postgres:    image: postgres:16    environment:      POSTGRES_PASSWORD: mypassword    ports:      - "5432:5432"
Limitations

Do not use this file to configure Moose-managed services (ClickHouse, Redpanda, Redis, Temporal). Use moose.config.toml for those components to avoid configuration conflicts.

Networking Reference

Reference for default ports and URLs used by the Moose Runtime in development mode.

Default Ports

PortServiceDescriptionConfig Key
4000API ServerMain Ingestion/Consumption APIshttp_server_config.port
5001Management APIHealth checks & Metricshttp_server_config.management_port
18123ClickHouse HTTPOLAP Database (HTTP)clickhouse_config.host_port
9000ClickHouse NativeOLAP Database (TCP)clickhouse_config.native_port
19092RedpandaKafka Streamingredpanda_config.broker
8080Temporal UIWorkflow Dashboardtemporal_config.ui_port

Service URLs

Access points for local development services:

ServiceURL
Main APIhttp://localhost:4000
Management APIhttp://localhost:5001/metrics
OpenAPI Spechttp://localhost:5001/openapi.yaml
Temporal UIhttp://localhost:8080
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
    • Core Settings
    • Project Settings
    • TypeScript
    • Telemetry
    • Git
    • Features
    • Migrations
    • Infrastructure
    • ClickHouse
    • Redpanda
    • Redis
    • Temporal
    • HTTP Server
    • State Storage
    • Security
    • JWT
    • Admin API
    • Development
    • Dev Environment
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework