This directory contains guides and documentation for developing applications on the Hyperware platform.
Comprehensive guide covering:
- HTTP endpoint requirements
- Runtime requirements (/our.js)
- P2P communication patterns
- Common pitfalls and best practices
- Debugging tips
Quick reference for:
- Common build errors
- Runtime errors
- State management issues
- P2P communication problems
- Quick fixes and debugging steps
Specific guidance on:
- The
_request_bodyparameter requirement - Parameter passing formats
- Error handling
Details about:
- The
/our.jsscript - Node identity management
- WebSocket connections
Explains:
- ProcessId construction
- Remote RPC patterns
- Request/response handling
- Common P2P issues
Hyperware is a peer-to-peer application platform where:
- Each user runs their own node
- Apps communicate directly between nodes
- No central servers required
- State is managed locally on each node
- Write Rust backend using
#[hyperprocess]macro - Define interfaces in WIT files
- Build frontend with React/TypeScript
- Compile with
kit b --hyperapp - Test locally then with multiple nodes
- ALL HTTP endpoints must have
_request_body: Stringparameter - Frontend HTML must include
<script src="/our.js"></script> - Multi-param endpoints use tuple format
[param1, param2]not objects - Remote calls need
.expects_response(timeout) - ProcessId format:
"app-name:package-name:publisher"
For new developers:
- Start with the Development Guide
- Keep the Troubleshooting Checklist handy
- Refer to specific guides as needed
- Study the samchat example app for patterns
A working P2P chat application demonstrating:
- Text messaging between nodes
- Group chat functionality
- File sharing
- Voice calls
- Proper error handling
Study this app to understand:
- Remote endpoint patterns
- State management
- UI/backend communication
- P2P architecture
// Backend
#[remote]
async fn handle_request(&mut self, param: String) -> Result<String, String> {
// Process request from another node
}
// Calling from another node
let request_wrapper = json!({
"HandleRequest": (param,)
});
Request::new()
.target(remote_address)
.body(serde_json::to_vec(&request_wrapper).unwrap())
.expects_response(30)
.send_and_await_response(30).unwrap()// Don't rely on React state immediately after setting
const doSomething = async (value: string) => {
setValue(value);
await processValue(value); // Pass explicitly, don't use state
};# Full rebuild
kit b --hyperapp
# Check built package
ls -la pkg/
# View generated WIT
cat api/*.wit
# Check UI build
cd ui && npm run build- Check the troubleshooting checklist first
- Look for similar patterns in samchat
- Add debugging output (println!/console.log)
- Test with minimal examples
- Verify all requirements are met
Remember: Most issues come from missing requirements or format mismatches!