# Foundry

As forge shapes metal, the foundry casts and molds prototypes.

The Foundry contains sample projects and experimental implementations for exploring new technologies, prototyping features, and demonstrating integration patterns across the Forge platform.

## 📋 Purpose

| Use Case                  | Description                                                  |
| ------------------------- | ------------------------------------------------------------ |
| 🧪 **Experimentation**     | Test new libraries, frameworks, or architectural patterns    |
| 🏗️ **Prototyping**         | Build proof-of-concepts before implementing in main codebase |
| 📚 **Learning**            | Explore new technologies in a sandboxed environment          |
| 🔗 **Integration Testing** | Test interactions between different platform components      |

## 📂 Structure

```
foundry/
├── dotnet/                    # .NET examples and experiments
│   ├── aspire-blobstorage/    # Azure Blob Storage file upload with Aspire
│   ├── aspire-config/         # Aspire publish-time configuration generation
│   ├── aspire-playwright/     # Playwright integration testing with Aspire
│   ├── aspire-wiremockcli/    # WireMock CLI with Aspire & Kiota
│   ├── devtunnels-simple-webhook/  # DevTunnels webhook receiver
│   ├── event-orchestration/   # Saga pattern with Durable Functions
│   └── events-with-cosmos/    # Event-driven architecture with Cosmos DB
└── terraform/                 # Terraform examples
    └── azure-apim-policy/     # API Management policy patterns
```

## 🎯 Examples

### .NET Examples

| Example                                       | Status                                      | Description                               | Key Technologies                          |
| --------------------------------------------- | ------------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| [Aspire Blob Storage](aspire-blobstorage.md)  | <span class="status preview">Preview</span> | File upload with Azure Blob Storage       | Aspire 13, Azure Storage, React, .NET 10  |
| [Aspire Config](aspire-config.md)             | <span class="status preview">Preview</span> | Publish-time security configuration       | Aspire 13, Security Extensions, .NET 10   |
| [Aspire Playwright](aspire-playwright.md)     | <span class="status preview">Preview</span> | Browser-based integration testing         | Aspire 13, Playwright, React, Kiota       |
| [Aspire WireMock CLI](aspire-wiremockcli.md)  | <span class="status preview">Preview</span> | API mocking with Kiota client generation  | Aspire, WireMock CLI, Kiota               |
| [DevTunnels Webhook](devtunnels-webhook.md)   | <span class="status preview">Preview</span> | Public webhook receiver with DevTunnels   | Aspire, DevTunnels, React                 |
| [Event Orchestration](event-orchestration.md) | <span class="status preview">Preview</span> | Saga pattern for distributed transactions | Durable Functions, Service Bus, Cosmos DB |
| [Events with Cosmos](events-with-cosmos.md)   | <span class="status preview">Preview</span> | Event-driven architecture patterns        | Azure Functions, Service Bus, Cosmos DB   |

### Terraform Examples

| Example                                   | Status                                      | Description                    | Key Technologies      |
| ----------------------------------------- | ------------------------------------------- | ------------------------------ | --------------------- |
| [Azure APIM Policy](azure-apim-policy.md) | <span class="status preview">Preview</span> | API Management policy patterns | Terraform, Azure APIM |

## ⚠️ Guidelines

!!! forge "Foundry Experiments"
Code in foundry is **temporary and experimental**. These examples demonstrate patterns and possibilities, not production-ready implementations.

**Key rules:**

- **No production dependencies** on foundry code
- Clean up experiments when completed
- Use descriptive folder names for experiments
- Document the purpose and learnings

## 🚀 Getting Started

To create a new experiment:

```bash
mkdir foundry/{domain}/{experiment-name}
cd foundry/{domain}/{experiment-name}
# Start your experiment
```

## 📍 Code Location

All Foundry code lives at the repository root under `/foundry/`. This documentation provides overviews and guidance, while the actual implementations are in the source directories.

| Documentation   | Source Code                                |
| --------------- | ------------------------------------------ |
| `docs/foundry/` | `foundry/dotnet/` and `foundry/terraform/` |

---

## 📚 Related Documentation

- [Contributing to Forge](../about/contributing/index.md) - Guidelines for platform contributors
- [Development Guides](../guides/development/index.md) - Building and testing applications
- [Aspire Reference](../reference/tools/aspire.md) - Aspire orchestration fundamentals
