Environment Setup
Set up your development environment for building Hyperstack stacks.
Prerequisites
Section titled “Prerequisites”- Rust 1.70+ (install via rustup)
- A code editor with Rust support (VS Code + rust-analyzer recommended)
The Hyperstack CLI (hs) handles project initialization, deployment, and SDK generation.
cargo install hyperstack-cliVerify the installation:
hs --versionRust Dependencies
Section titled “Rust Dependencies”Add the Hyperstack crate to your stack project’s Cargo.toml:
[dependencies]hyperstack = "0.5.3"serde = { version = "1.0", features = ["derive"] }This gives you access to:
#[hyperstack]— The main macro for defining stacks#[entity],#[map],#[aggregate]— Field-level attributesStreamderive macro — Generates streaming infrastructure
Project Initialization
Section titled “Project Initialization”Create a new stack project:
cargo new my-stack --libcd my-stackInitialize Hyperstack configuration:
hs initThis creates hyperstack.toml and a .hyperstack/ directory for generated stack files.
hyperstack.toml:
[project]name = "my-stack"
[sdk]output_dir = "./generated"Validate your setup:
hs config validateEnvironment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
HYPERSTACK_API_URL | Override API endpoint | Production API |
Next Steps
Section titled “Next Steps”- Stack Definitions — Understand the declarative model
- Your First Stack — Build an end-to-end streaming app
- Macros Reference — Complete attribute documentation
Troubleshooting
Section titled “Troubleshooting”| Issue | Solution |
|---|---|
hs: command not found | Add ~/.cargo/bin to your PATH |
cargo build fails | Ensure hyperstack = "0.5.3" is in Cargo.toml |
hs init fails | Check you’re in a valid Cargo project |