Skip to content

From Zero to Production

This page is a practical implementation path to build and ship a PURISTA application.

Phase 1: Foundation

  1. Create project and run quickstart flow.
  2. Create first service plus at least one command, subscription, stream, and—if you need pull-based async work—a queue + worker pair.
  3. If AI is in scope, add your first agent with purista add agent and keep it in the same test/lint flow.
  4. Add schema validation for payload/parameter/output.
  5. Add unit tests for service/command/subscription/stream.

Reference:

Phase 2: Integration-ready logic

  1. Add stores (config/secret/state) where required.
  2. Define resources (DB clients, external SDK wrappers).
  3. Expose required commands/streams through REST endpoints (JSON + SSE).
  4. Add invoke relations (canInvoke) explicitly.
  5. For agents, define model aliases in the builder and inject concrete provider instances at runtime (getInstance).

Reference:

Phase 3: Runtime architecture

  1. Choose event bridge based on delivery requirements.
  2. Choose queue bridge (default in-memory vs Redis or other providers) for pull-based workloads.
  3. Choose deployment model (monolith, microservice style, edge, serverless).
  4. Configure graceful shutdown and startup ordering.
  5. If using AI, tune both queue worker concurrency and agent poolConfig.maxConcurrencyPerInstance together.

Reference:

Phase 4: Production readiness

  1. Enable tracing and metrics with OpenTelemetry.
  2. Add endpoint protection/auth middleware.
  3. Validate error handling, timeout behavior, and stream cancellation behavior.
  4. Run integration tests against real broker/store setup (including delivery semantics).
  5. For AI, verify protocol consumers and token/duration telemetry in staging before rollout.

Reference:

Release checklist

  • schemas are explicit and stable
  • no accidental any/unknown in core paths
  • tests cover happy path, failure path, and cancellation/retry paths
  • streaming and event-bridge docs match implemented behavior
  • runtime config is documented
  • observability and shutdown behavior verified