This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Templafy Custom Content Connector - a reference implementation demonstrating how to build a DAM (Digital Asset Management) connector for Templafy. This API allows external asset management systems to integrate with Templafy by implementing OAuth authentication and content serving endpoints.
# Build
dotnet build
# Run locally (http://localhost:7225)
dotnet run
# Docker
docker build -t custom-content-connector .
docker run -p 7225:7225 custom-content-connectorNo tests exist - this is a reference implementation tested manually via Postman or Docker.
Stack: .NET 8.0 ASP.NET Core Minimal APIs (no controllers, no DI)
Pattern: Functional, static method handlers - all API classes are static with static methods.
Zero dependencies - uses only built-in ASP.NET Core libraries.
Program.cs → Endpoint routing (6 routes)
Constants.cs → Hard-coded demo credentials and MIME types
Api/ → HTTP handlers (TokenApi, ContentApi, AuthorizationApi, UserApi)
Utilities/ → Extensions (HtmlResponse)
FakeStorage/Images/ → Mock DAM storage (70+ sample images)
| Endpoint | Purpose |
|---|---|
POST /oauth/token |
OAuth token exchange (3 grant types) |
GET /oauth/authorize |
Login form for Authorization Code flows |
GET /content |
List assets with pagination |
GET /content/{id}/download-url |
Get download URL for asset |
All property names, query parameters, and MIME types are case-sensitive per Templafy specification. JSON uses [JsonPropertyName] attributes for exact casing.
- Client Credentials -
grant_type=client_credentialswithclient_id+client_secret - Authorization Code -
grant_type=authorization_codewith user login +client_secret - Authorization Code + PKCE -
grant_type=authorization_codewith code verifier (no secret)
Defined in Constants.cs - for testing only:
- User:
user/password - Client:
secure_client_id/secure_client_secret - Token:
secure_token
- CI/CD: Azure Pipelines (
azure-pipelines.yml) - Target: Azure Container Apps
- Registry:
customcontentconnectoracicontainerregistry - Branch: master (mainline versioning via GitVersion)
Subdirectories contain detailed CLAUDE.md files:
Api/CLAUDE.md- Endpoint handlers, OAuth flows, data modelsUtilities/CLAUDE.md- HTML response extensionFakeStorage/CLAUDE.md- Asset storage conventions