Platform introduction

Part VI covers application platform capabilities: unified platform services, observability, data access, API boundaries, and the application host.

This portfolio extends the core Effect runtime and Part V functional patterns toward a full-stack Rust platform (compare .NET, Spring Boot, Rails, Django, Next.js capability trees).

id_effect_platform

The id_effect_platform crate is the Rust analogue of @effect/platform. Each capability is a service in the typed environment R (Part II), provided by a Layer:

ModuleTraitCapability / envLayers
httpHttpClient (execute, execute_stream)HttpClientService, HttpClientEnvReqwestHttpClientProvider::layer(), provide_http_client(client)
fsFileSystemFileSystemService, FileSystemEnvLiveFileSystemProvider::layer(), provide_file_system(fs)
commandProcessRuntime (spawn, wait, kill OS children)ProcessRuntimeService, ProcessRuntimeEnvTokioProcessRuntimeProvider::layer(), provide_process_runtime(rt)
uri———
auth (feature auth)SessionStore, OAuthClient—MemorySessionStore; MemoryOAuthClient needs feature test-util

The live implementations (reqwest, tokio::process) need a tokio runtime with its IO driver, so run them with id_effect_tokio::TokioRuntime:

#![allow(unused)]
fn main() {
use id_effect_platform::http::{HttpClientEnv, HttpRequest, ReqwestHttpClientProvider, execute};
use id_effect_tokio::TokioRuntime;

async fn demo() {
let program = execute::<HttpClientEnv, _>(HttpRequest::get("https://example.com"))
    .provide_layer(ReqwestHttpClientProvider::layer());
let exit = TokioRuntime::current().expect("tokio runtime").run(program).await;
}
}

In tests, provide a double directly: execute(req).provide_all(http_client_env(canned)).block_on(). Streaming responses expose an HttpBody read on demand (next_chunk(), collect()); build test bodies with HttpBody::from_chunks / from_bytes. Example: cargo run -p id_effect_platform --example 010_platform_http_get.

Prefer platform HTTP over a raw reqwest::Client in application R types. See Reqwest migration.

Portfolio map

ChapterMissionCrate
ch27Observabilityid_effect_opentelemetry
ch28Dataid_effect_sql
ch29API boundariesid_effect_rpc (labs, unpublished)
ch30Application hostid_effect_axum + id_effect_platform::auth (feature auth)
ch31Jobs, messaging, mailid_effect_jobs, id_effect_messaging, id_effect_mail
ch32Workflowid_effect_workflow
ch35AIid_effect_ai (labs, unpublished)

Mission index: docs/platform/ROADMAP.md.

Prerequisites

  • Part II (capabilities and layers)
  • Part V functional patterns (recommended)