Skip to main content

Configuration Reference

All configuration is managed via appsettings.json and can be overridden with environment variables using the __ (double-underscore) convention.

Connection Strings

{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5432;Database=HeadlessEcommerce;Username=postgres;Password=postgres123"
}
}
KeyDescription
DefaultConnectionPostgreSQL connection string

JWT Authentication

{
"Jwt": {
"SecretKey": "YourSuperSecretKeyHere12345678901234567890",
"Issuer": "HeadlessEcommerceApi",
"Audience": "HeadlessEcommerceClient",
"ExpirationMinutes": 60
}
}
KeyDescriptionDefault
SecretKeyHMAC signing key (min 32 chars)
IssuerToken issuer claimHeadlessEcommerceApi
AudienceToken audience claimHeadlessEcommerceClient
ExpirationMinutesAccess token lifetime60
danger

Use a strong, random SecretKey in production. Never reuse the development key.

RabbitMQ

{
"RabbitMQ": {
"Host": "localhost",
"Port": 5672,
"VirtualHost": "/",
"Username": "guest",
"Password": "guest",
"QueuePrefix": "quark",
"EnableOutbox": true,
"OutboxDeliveryIntervalSeconds": 5,
"MaxRetryCount": 5,
"RetryIntervalSeconds": 5
}
}
KeyDescriptionDefault
HostRabbitMQ server hostnamelocalhost
PortAMQP port5672
VirtualHostRabbitMQ virtual host/
QueuePrefixPrefix for queue namesquark
EnableOutboxEnable transactional outboxtrue
OutboxDeliveryIntervalSecondsPolling interval for outbox publisher5
MaxRetryCountMax delivery attempts before marking failed5

The outbox publisher writes events to the database in the same transaction as business operations, then a background service polls and publishes them to RabbitMQ via a topic exchange (quark.events).

Storage

{
"Storage": {
"Provider": "Local",
"BaseUrl": "http://localhost:8080/media",
"MaxFileSizeMB": 50,
"AllowedExtensions": [".jpg", ".png", ".webp", "..."],
"Local": {
"RootPath": "wwwroot/media",
"RequestPath": "/media"
},
"NetworkShare": {
"RootPath": "//nas01/commerce-media",
"BaseUrl": "https://cdn.example.com"
},
"S3": {
"Bucket": "my-commerce-assets",
"Region": "eu-central-1",
"BaseUrl": "https://cdn.example.com",
"UsePresignedUrls": false
}
}
}
KeyDescriptionDefault
ProviderStorage backend: Local, NetworkShare, or S3Local
BaseUrlPublic base URL for media fileshttp://localhost:8080/media
MaxFileSizeMBMaximum upload file size50
tip

In production, set Storage.BaseUrl to your public domain (e.g., https://quarkapi.yourdomain.com/media). This URL is stored in the database and used to construct media URLs returned by the API.

Rate Limiting

{
"RateLimiting": {
"Enabled": true,
"Fixed": {
"PermitLimit": 100,
"WindowSeconds": 60,
"QueueLimit": 10
},
"Search": {
"PermitLimit": 60,
"WindowSeconds": 60,
"QueueLimit": 5
},
"Sliding": {
"PermitLimit": 20,
"WindowSeconds": 10,
"SegmentsPerWindow": 2,
"QueueLimit": 5
}
}
}

Three rate limit policies are applied:

  • Fixed — global rate limit for all endpoints
  • Search — stricter limit for search endpoints
  • Sliding — burst protection with sliding window

Licensing

{
"Licensing": {
"PublicKeyBase64": "base64-encoded-rsa-4096-public-key",
"LicenseFilePath": "/path/to/license.lic",
"LicenseFileBase64": "base64-encoded-license-file",
"PhoneHomeUrl": "https://license-server.yourdomain.com/api/phone-home"
}
}
KeyDescription
PublicKeyBase64RSA-4096 public key for signature verification
LicenseFilePathPath to license file on disk (local dev)
LicenseFileBase64Base64-encoded license file (production, via env var)
PhoneHomeUrlOptional URL for periodic license validation callbacks

For production, prefer environment variables:

Licensing__PublicKeyBase64=...
Licensing__LicenseFileBase64=...

Stripe

{
"Stripe": {
"SecretKey": "sk_test_..."
}
}

Caching

{
"Caching": {
"Enabled": true
}
}

When enabled, storefront endpoints use response caching (300s default) with Vary on store/language/currency headers.

Logging

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

Standard ASP.NET Core logging configuration. Adjust log levels per namespace as needed.

Environment Variable Mapping

The __ convention maps to JSON nesting:

Environment VariableJSON Path
ConnectionStrings__DefaultConnectionConnectionStrings.DefaultConnection
Jwt__SecretKeyJwt.SecretKey
RabbitMQ__HostRabbitMQ.Host
Storage__BaseUrlStorage.BaseUrl
Licensing__PublicKeyBase64Licensing.PublicKeyBase64