Watch Aspire live streamsDocumentationEssayer Aspire

Get started with the Posta integration

Ce contenu n’est pas encore disponible dans votre langue.

⭐ Community Toolkit

Posta is a self-hosted email delivery platform. The Community Toolkit provides an AppHost integration that configures Posta with PostgreSQL and Redis, plus a .NET client integration for its application-facing HTTP APIs.

  • An Aspire AppHost project
  • PostgreSQL and Redis resources for Posta’s data and queueing

Install the 📦 CommunityToolkit.Aspire.Hosting.Posta package in the AppHost. Add Posta with references to its database and Redis resources:

Terminal
aspire add CommunityToolkit.Aspire.Hosting.Posta
apphost.mts
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
const postgres = await builder.addPostgres('postgres');
const database = await postgres.addDatabase('posta-db', 'posta');
const redis = await builder.addRedis('redis');
const posta = await builder.addPostaWithReferences('posta', database, redis);
const api = await builder.addProject('api', '../Api/Api.csproj');
await api.withReference(posta);
await builder.build().run();

The Posta container runs its worker in the main container by default. See Set up Posta in the AppHost for secrets, storage, SMTP settings, and optional endpoints. To register the .NET client, see Connect to Posta.