StockHouse combines live market data from Massive, storage and analytics powered by ClickHouse, and real-time visualization with Perspective.
It’s a complete demo of how to build a high-performance streaming analytics app.
Available at https://stockhouse.clickhouse.com
StockHouse ingests real-time market data — both stock and crypto — directly from Massive WebSocket APIs, storing it in ClickHouse for fast querying and serving through a live dashboard built with Perspective.
This setup demonstrates how to handle streaming financial data, store it efficiently, and visualize it with millisecond updates.
This blog explains in detail the concepts behind building this application.
Financial data moves fast and traditional systems can’t always keep up.
StockHouse shows how to build a scalable analytics system that can handle millions of updates per second, while still offering:
- Low-latency, high-concurrency queries
- Efficient ingestion of streaming data
- Smooth, real-time visualizations
This is a practical demo for engineers and analysts interested in building real-time dashboards, trading monitors, or financial observability tools.
- Real-time data ingestion from Massive WebSocket APIs for stocks and cryptocurrencies
- High-performance storage with ClickHouse optimized for time-series data
- Live visualizations using Perspective with millisecond-level updates
- Scalable architecture handling millions of updates per second
StockHouse consists of five main components:
-
Data Source – Massive WebSocket APIs streaming real-time market data
-
Ingester – Go-based service that consumes WebSocket data and writes to ClickHouse
-
Database – ClickHouse tables optimized for time-series ingestion and aggregation
-
Backend – Node.js API server for querying ClickHouse
-
Frontend – Vue.js dashboard with Perspective for real-time visualization
Before you begin, ensure you have:
- Node.js >= 18
- npm >= 9
- Docker (for running the ingester)
- ClickHouse >= 24.3 (ClickHouse Cloud or self-hosted)
- Massive API key (Sign up here)
You can explore the public demo at https://stockhouse.clickhouse.com or deploy it locally by following these steps.
Run the schema script to set up all required tables and materialized views:
clickhouse-client --query "CREATE DATABASE stockhouse"
clickhouse-client --database stockhouse < scripts/schema.sqlThe schema includes:
- Base tables:
trades,quotes,crypto_trades,crypto_quotes,stock_fmv - Aggregate tables: Daily aggregations for quotes and trades
- Materialized views: Automatic real-time aggregation of trading data
The ingester is a Go-based service that connects to Massive WebSocket APIs and streams data into ClickHouse.
Build the Docker image from the ingester-go directory:
cd ingester-go
docker build -t massive-ingester:latest .Run the ingester with your credentials:
docker run --rm \
-e CLICKHOUSE_HOST=your-instance.clickhouse.cloud:9440 \
-e CLICKHOUSE_USER=default \
-e CLICKHOUSE_PASSWORD='your_password' \
-e CLICKHOUSE_DB=stockhouse \
-e MASSIVE_API_KEY=your_api_key \
massive-ingester:latestEnvironment variables:
CLICKHOUSE_HOST- ClickHouse host and native port (e.g.,your-instance.clickhouse.cloud:9440orhost.docker.internal:9000if running the server locally)CLICKHOUSE_USER- ClickHouse username (usuallydefault)CLICKHOUSE_PASSWORD- ClickHouse passwordCLICKHOUSE_DB- Database name (stockhouse)MASSIVE_API_KEY- Your Massive API key
The ingester will start streaming data immediately. You should see log messages indicating successful connections and data ingestion.
Install dependencies:
npm installConfigure environment variables:
Copy .env.example to .env.local and set your credentials:
CLICKHOUSE_URL=https://your-instance.clickhouse.cloud:8443
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=your_password
CLICKHOUSE_DB=stockhouseNote: The application uses the HTTP(S) interface (port 8443 for ClickHouse Cloud, 8123 for self-hosted).
Start the backend API server:
npm run devThe backend server will start on http://localhost:3000.
Start the frontend dashboard:
In a new terminal:
npm run frontendAccess the dashboard:
Open http://localhost:5173 in your browser to view the live dashboard.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
