Get up and running with Rohas in minutes. This guide will walk you through creating your first event-driven application.
Install the Rohas CLI using the recommended installation script:
curl -fsSL https://raw.githubusercontent.com/rohas-dev/rohas/main/scripts/build.sh | bash
This will automatically install all dependencies and build Rohas CLI.
Alternatively, install via Cargo:
cargo install rohas-cli
Verify the installation:
rohas --version
Initialize a new Rohas project:
rohas init my-app --lang python
Or for TypeScript (experimental):
rohas init my-app --lang typescript
Note: Python runtime is stable and production-ready, while TypeScript runtime is currently experimental.
This creates a project structure:
my-app/ ├── schema/ # Schema definitions (.ro files) │ ├── api/ # API endpoint schemas │ ├── events/ # Event schemas │ ├── models/ # Data model schemas │ └── cron/ # Cron job schemas ├── src/ │ ├── generated/ # Auto-generated types (DO NOT EDIT) │ └── handlers/ # Your handler implementations │ ├── api/ # API handlers │ ├── events/ # Event handlers │ └── cron/ # Cron job handlers └── config/ # Configuration files
After initializing your project, generate type-safe code from the example schemas:
cd my-app rohas codegen
This generates handler stubs and type definitions in src/generated/ from the example schemas created by rohas init.
Create a simple API schema in schema/api/Health.ro:
model HealthResponse {
status String
timestamp String
}
api Health {
method: GET
path: "/health"
response: HealthResponse
}Start the development server with hot reload:
rohas dev
Or start with the workbench UI for a better development experience:
rohas dev --workbench
Your API will be available at http://localhost:3000/health