Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docs/app-directory/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The App Directory showcases existing **Calimero applications** that you can depl
## Getting Started

You can browse available apps directly from the **Calimero Application Registry**:
👉 [Calimero App Registry](https://github.com/calimero-network/apps)
👉 [Calimero App Registry](https://github.com/calimero-network/app-registry){:target="_blank"}

To get started:

Expand All @@ -17,9 +17,7 @@ More detailed guides and configuration examples will be added here soon.

## Featured Projects

- `Battleships` — Turn-based multiplayer with private boards and Merobox workflows. [Repo README](https://github.com/calimero-network/battleships#readme)
- `Shared Todo Backlog` — Collaborative backlog with CRDT sync patterns. [Repo README](https://github.com/calimero-network/shared-todo-backlog#readme)
- `Split Bills` — Expense sharing with delegation flows and settlement patterns. [Repo README](https://github.com/calimero-network/split-bills#readme)
- `KV Store` — Minimal read/write example ideal for first integrations. [Repo README](https://github.com/calimero-network/kv-store#readme)
- `Demo Blob App` — File-style payload handling plus frontend wiring. [Repo README](https://github.com/calimero-network/demo-blob-app#readme)
- `Calimero Curb Chat` — Rich messaging UI with cross-device workflows. [Repo README](https://github.com/calimero-network/calimero-curb-chat#readme)
- `Battleships` — Turn-based multiplayer with private boards and Merobox workflows. [Repo README](https://github.com/calimero-network/battleships#readme){:target="_blank"}
- `KV Store` — Minimal read/write example ideal for first integrations. [Repo README](https://github.com/calimero-network/kv-store#readme){:target="_blank"}
- `Demo Blob App` — File-style payload handling plus frontend wiring. [Repo README](https://github.com/calimero-network/demo-blob-app#readme){:target="_blank"}
- `Calimero Curb Chat` — Rich messaging UI with cross-device workflows. [Repo README](https://github.com/calimero-network/calimero-curb-chat#readme){:target="_blank"}
26 changes: 12 additions & 14 deletions docs/builder-directory/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Before we dive in, here are the tools we'll be using:

### Core Tools

- **`merod`** - The runtime that executes your Calimero applications. [Source code](https://github.com/calimero-network/core)
- **`merod`** - The runtime that executes your Calimero applications. [Source code](https://github.com/calimero-network/core){:target="_blank"}

- **`merobox`** - Docker orchestration tool that makes it trivial to spin up local Calimero nodes (`merod` instances). [Source code](https://github.com/calimero-network/merobox)
- **`merobox`** - Docker orchestration tool that makes it trivial to spin up local Calimero nodes (`merod` instances). [Source code](https://github.com/calimero-network/merobox){:target="_blank"}

- **`mero-devtools-js`** - JavaScript wrappers for Calimero tooling to keep your development workflow simple and consistent. [Source code](https://github.com/calimero-network/mero-devtools-js)
- **`mero-devtools-js`** - JavaScript wrappers for Calimero tooling to keep your development workflow simple and consistent. [Source code](https://github.com/calimero-network/mero-devtools-js){:target="_blank"}

- **`@calimero-network/abi-codegen`** - Generates TypeScript clients from your Rust backend, keeping frontend/backend in sync.

Expand Down Expand Up @@ -49,8 +49,6 @@ git clone https://github.com/calimero-network/battleships
cd battleships
pnpm install

# Or explore other examples (coming soon)
git clone https://github.com/calimero-network/awesome-apps
```

**Time:** Variable
Expand All @@ -75,12 +73,12 @@ Keep this loop handy; the walkthrough below explains each step in detail and sho

## The AI-Assisted Path (Walkthrough)

This walkthrough uses **Cursor** (an AI-powered IDE) to build a complete Calimero application. We'll use the [Battleships game](https://github.com/calimero-network/battleships) as our example to show you exactly what happens at each step.
This walkthrough uses **Cursor** (an AI-powered IDE) to build a complete Calimero application. We'll use the [Battleships game](https://github.com/calimero-network/battleships){:target="_blank"} as our example to show you exactly what happens at each step.

### Prerequisites

1. **Install Cursor** - [Download here](https://cursor.sh)
2. **Install Docker** - [Download here](https://www.docker.com/products/docker-desktop) (required for `merobox`)
1. **Install Cursor** - [Download here](https://cursor.sh){:target="_blank"}
2. **Install Docker** - [Download here](https://www.docker.com/products/docker-desktop){:target="_blank"} (required for `merobox`)
3. **Have an idea** - Know what you want to build (or follow along with Battleships)
4. **Basic familiarity** - Know JavaScript/TypeScript and have seen Rust (don't need to be an expert)

Expand All @@ -89,7 +87,7 @@ This walkthrough uses **Cursor** (an AI-powered IDE) to build a complete Calimer
The key to AI-assisted development is giving the AI the right context. We've created a specialized prompt that teaches the AI about Calimero development patterns.

**Access the prompt:**
[Calimero Bootstrap Prompt](https://gist.github.com/antonpaisov/270d609b43798a926f1755e4036319f5)
[Calimero Bootstrap Prompt](https://gist.github.com/antonpaisov/270d609b43798a926f1755e4036319f5){:target="_blank"}

**In Cursor:**

Expand Down Expand Up @@ -149,14 +147,14 @@ battleships/

**Why this structure:**

- `logic/` contains your Rust business logic compiled to WASM
- `logic/` contains your Rust or TypeScript business logic compiled to WASM
- `app/` is your React frontend that calls into the WASM
- `workflows/` your local merobox configuration and workflow
- `scripts/` automates building, deploying, and testing

#### Phase 2: Domain Modeling (Rust Backend)

The AI starts by modeling your domain in Rust. For Battleships, this means:
The AI starts by modeling your domain in Rust or TypeScript. For Battleships, this means:

**2.1 Core Types** (`board.rs`, `ships.rs`)

Expand Down Expand Up @@ -936,7 +934,7 @@ Now that it works, dig into what was created:
**🔍 Things to notice:**

- **Type safety everywhere** - Rust types flow to TypeScript
- **Clear separation** - Logic in Rust, UI in React, network in YAML
- **Clear separation** - Logic in Rust/TypeScript, UI in React, network in YAML
- **No boilerplate** - `#[calimero::state]` and `#[calimero::logic]` do the heavy lifting
- **Event-driven** - State changes emit events, frontend reacts

Expand Down Expand Up @@ -990,7 +988,7 @@ By following this walkthrough (or just reading it), you now understand:

### Do I need to be a Rust expert?

No. The AI generates idiomatic Rust, and you can mostly work in JavaScript. But basic Rust familiarity helps - consider the [Rust Book](https://doc.rust-lang.org/book/) for fundamentals.
No. The AI generates idiomatic Rust, and you can mostly work in JavaScript. But basic Rust familiarity helps - consider the [Rust Book](https://doc.rust-lang.org/book/){:target="_blank"} for fundamentals.

### Can I use a different frontend framework?

Expand Down Expand Up @@ -1021,7 +1019,7 @@ mod tests {

### Can I see the full Battleships code?

Yes! [github.com/calimero-network/battleships](https://github.com/calimero-network/battleships)
Yes! [github.com/calimero-network/battleships](https://github.com/calimero-network/battleships){:target="_blank"}

### Is this production-ready?

Expand Down
71 changes: 38 additions & 33 deletions docs/builder-directory/js-sdk-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Build Calimero services using **TypeScript/JavaScript**. The JavaScript SDK comp

The JavaScript SDK (`calimero-sdk-js`) consists of two main packages:

- **`@calimero/sdk`** - Decorators, CRDT collections, event system, and environment bindings
- **`@calimero/cli`** - Build toolchain (Rollup → QuickJS → WASM)
- **`@calimero-network/calimero-sdk-js`** - Decorators, CRDT collections, event system, and environment bindings
- **`@calimero-network/calimero-cli-js`** - Build toolchain (Rollup → QuickJS → WASM)

**Key features:**
- Write services in TypeScript/JavaScript instead of Rust
Expand Down Expand Up @@ -69,16 +69,21 @@ flowchart LR
### Installation

```bash
pnpm add @calimero/sdk
pnpm add -D @calimero/cli typescript
pnpm add @calimero-network/calimero-sdk-js
pnpm add -D @calimero-network/calimero-cli-js typescript
```

**NPM Resources:**

- [calimero-sdk-js](https://www.npmjs.com/package/@calimero-network/calimero-sdk-js){:target="_blank"}
- [calimero-cli-js](https://www.npmjs.com/package/@calimero-network/calimero-cli-js){:target="_blank"}

### Minimal Service

```typescript
import { State, Logic, Init, View } from '@calimero/sdk';
import { Counter } from '@calimero/sdk/collections';
import * as env from '@calimero/sdk/env';
import { State, Logic, Init, View } from '@calimero-network/calimero-sdk-js';
import { Counter } from '@calimero-network/calimero-sdk-js/collections';
import * as env from '@calimero-network/calimero-sdk-js/env';

@State
export class CounterApp {
Expand Down Expand Up @@ -135,8 +140,8 @@ meroctl --node node1 call \
Marks a class as application state:

```typescript
import { State } from '@calimero/sdk';
import { UnorderedMap, Counter } from '@calimero/sdk/collections';
import { State } from '@calimero-network/calimero-sdk-js';
import { UnorderedMap, Counter } from '@calimero-network/calimero-sdk-js/collections';

@State
export class MyApp {
Expand All @@ -155,7 +160,7 @@ export class MyApp {
Marks a class as application logic (methods):

```typescript
import { Logic, Init } from '@calimero/sdk';
import { Logic, Init } from '@calimero-network/calimero-sdk-js';

@Logic(MyApp)
export class MyAppLogic extends MyApp {
Expand Down Expand Up @@ -213,7 +218,7 @@ export class MyAppLogic extends MyApp {
Marks event classes:

```typescript
import { Event } from '@calimero/sdk';
import { Event } from '@calimero-network/calimero-sdk-js';

@Event
export class ItemAdded {
Expand Down Expand Up @@ -253,7 +258,7 @@ The JavaScript SDK provides the same CRDT collections as the Rust SDK:
Key-value storage with Last-Write-Wins conflict resolution:

```typescript
import { UnorderedMap } from '@calimero/sdk/collections';
import { UnorderedMap } from '@calimero-network/calimero-sdk-js/collections';

const map = new UnorderedMap<string, string>();

Expand Down Expand Up @@ -283,7 +288,7 @@ const size = map.entries().length;
Ordered list maintaining insertion order:

```typescript
import { Vector } from '@calimero/sdk/collections';
import { Vector } from '@calimero-network/calimero-sdk-js/collections';

const vec = new Vector<string>();

Expand All @@ -306,7 +311,7 @@ const len = vec.len(); // number
Distributed counter with automatic summation:

```typescript
import { Counter } from '@calimero/sdk/collections';
import { Counter } from '@calimero-network/calimero-sdk-js/collections';

const counter = new Counter();

Expand All @@ -327,7 +332,7 @@ counter.decrementBy(2);
Last-Write-Wins register for single values:

```typescript
import { LwwRegister } from '@calimero/sdk/collections';
import { LwwRegister } from '@calimero-network/calimero-sdk-js/collections';

const register = new LwwRegister<string>();

Expand All @@ -346,7 +351,7 @@ const timestamp = register.timestamp(); // bigint
Set with union-based merging:

```typescript
import { UnorderedSet } from '@calimero/sdk/collections';
import { UnorderedSet } from '@calimero-network/calimero-sdk-js/collections';

const set = new UnorderedSet<string>();

Expand Down Expand Up @@ -409,7 +414,7 @@ if (metrics) {
Emit events for real-time updates:

```typescript
import { Event, emit, emitWithHandler } from '@calimero/sdk';
import { Event, emit, emitWithHandler } from '@calimero-network/calimero-sdk-js';

// Define event
@Event
Expand Down Expand Up @@ -454,7 +459,7 @@ export class MyAppLogic extends MyApp {
For node-local data (secrets, caches, per-node counters):

```typescript
import { createPrivateEntry } from '@calimero/sdk';
import { createPrivateEntry } from '@calimero-network/calimero-sdk-js';

// Create private entry
const secrets = createPrivateEntry<{ token: string }>('private:secrets');
Expand Down Expand Up @@ -488,8 +493,8 @@ cd my-calimero-service
pnpm init

# Install dependencies
pnpm add @calimero/sdk
pnpm add -D @calimero/cli typescript @types/node
pnpm add @calimero-network/calimero-sdk-js
pnpm add -D @calimero-network/calimero-cli-js typescript @types/node

# Create TypeScript config
cat > tsconfig.json << EOF
Expand Down Expand Up @@ -542,8 +547,8 @@ The CLI automatically handles:
### Pattern 1: Simple Key-Value Store

```typescript
import { State, Logic, Init, View } from '@calimero/sdk';
import { UnorderedMap, LwwRegister } from '@calimero/sdk/collections';
import { State, Logic, Init, View } from '@calimero-network/calimero-sdk-js';
import { UnorderedMap, LwwRegister } from '@calimero-network/calimero-sdk-js/collections';

@State
export class KvStore {
Expand Down Expand Up @@ -582,8 +587,8 @@ export class KvStoreLogic extends KvStore {
### Pattern 2: Metrics with Counters

```typescript
import { State, Logic, Init, View } from '@calimero/sdk';
import { UnorderedMap, Counter } from '@calimero/sdk/collections';
import { State, Logic, Init, View } from '@calimero-network/calimero-sdk-js';
import { UnorderedMap, Counter } from '@calimero-network/calimero-sdk-js/collections';

@State
export class Metrics {
Expand Down Expand Up @@ -618,9 +623,9 @@ export class MetricsLogic extends Metrics {
### Pattern 3: Event-Driven Updates

```typescript
import { State, Logic, Init, Event, emitWithHandler } from '@calimero/sdk';
import { UnorderedMap, Counter } from '@calimero/sdk/collections';
import * as env from '@calimero/sdk/env';
import { State, Logic, Init, Event, emitWithHandler } from '@calimero-network/calimero-sdk-js';
import { UnorderedMap, Counter } from '@calimero-network/calimero-sdk-js/collections';
import * as env from '@calimero-network/calimero-sdk-js/env';

@Event
export class ItemAdded {
Expand Down Expand Up @@ -842,12 +847,12 @@ merobox bootstrap run workflows/counter-js.yml --log-level=trace

For detailed JavaScript SDK documentation:

- **Repository**: [`calimero-network/calimero-sdk-js`](https://github.com/calimero-network/calimero-sdk-js) - Full source code
- **Getting Started**: [`docs/getting-started.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/getting-started.md) - Step-by-step guide
- **Architecture**: [`docs/architecture.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/architecture.md) - Build pipeline and runtime
- **Collections**: [`docs/collections.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/collections.md) - CRDT usage guide
- **Events**: [`docs/events.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/events.md) - Event patterns and handlers
- **Troubleshooting**: [`docs/troubleshooting.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/troubleshooting.md) - Common issues
- **Repository**: [`calimero-network/calimero-sdk-js`](https://github.com/calimero-network/calimero-sdk-js){:target="_blank"} - Full source code
- **Getting Started**: [`docs/getting-started.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/getting-started.md){:target="_blank"} - Step-by-step guide
- **Architecture**: [`docs/architecture.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/architecture.md){:target="_blank"} - Build pipeline and runtime
- **Collections**: [`docs/collections.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/collections.md){:target="_blank"} - CRDT usage guide
- **Events**: [`docs/events.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/events.md){:target="_blank"} - Event patterns and handlers
- **Troubleshooting**: [`docs/troubleshooting.md`](https://github.com/calimero-network/calimero-sdk-js/blob/master/docs/troubleshooting.md){:target="_blank"} - Common issues

## Related Topics

Expand Down
6 changes: 3 additions & 3 deletions docs/builder-directory/sdk-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ calimero-abi extract \

For detailed SDK documentation:

- **Application SDK**: [`core/crates/sdk/README.md`](https://github.com/calimero-network/core/blob/master/crates/sdk/README.md) - Complete API reference
- **Storage Collections**: [`core/crates/storage/README.md`](https://github.com/calimero-network/core/blob/master/crates/storage/README.md) - CRDT types and semantics
- **Examples**: [`core/apps`](https://github.com/calimero-network/core/tree/master/apps) - Working application examples
- **Application SDK**: [`core/crates/sdk/README.md`](https://github.com/calimero-network/core/blob/master/crates/sdk/README.md){:target="_blank"} - Complete API reference
- **Storage Collections**: [`core/crates/storage/README.md`](https://github.com/calimero-network/core/blob/master/crates/storage/README.md){:target="_blank"} - CRDT types and semantics
- **Examples**: [`core/apps`](https://github.com/calimero-network/core/tree/master/apps){:target="_blank"} - Working application examples

## Related Topics

Expand Down
Loading