Configuration
rCommerce is configured via a TOML file. Every option has a sensible default.
Loading config
Section titled “Loading config”Config is loaded from (in priority order):
- Path specified in
RCOMMERCE_CONFIGenvironment variable ./config/default.toml./config/production.toml/etc/rcommerce/config.toml
Server
Section titled “Server”[server]host = "0.0.0.0" # Bind addressport = 8080 # Listen portworker_threads = 0 # 0 = use CPU core count
[server.cors]enabled = trueallowed_origins = ["*"]allowed_methods = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]allowed_headers = ["Content-Type", "Authorization"]Database
Section titled “Database”[database]db_type = "Postgres"host = "localhost"port = 5432database = "rcommerce"username = "rcommerce"password = "password"pool_size = 20[cache]cache_type = "Memory" # or "Redis"max_size_mb = 100redis_url = "redis://localhost:6379"Security
Section titled “Security”[security]api_key_prefix_length = 40api_key_secret_length = 40
[security.jwt]secret = "change-this-in-production"expiry_hours = 24Payment
Section titled “Payment”[payment]default_gateway = "stripe" # or "airwallex"test_mode = true
[payment.stripe]enabled = truesecret_key = "sk_test_..."publishable_key = "pk_test_..."
[payment.airwallex]enabled = falseclient_id = ""api_key = ""demo = trueShipping
Section titled “Shipping”[shipping]default_provider = "weight_based"
[shipping.weight_based]# Zone rates are configured in code# See Shipping guide for detailsNotifications
Section titled “Notifications”[notifications]enabled = true
[notifications.email]# Option 1: Postmarkpostmark_token = "your-server-token"from_email = "shop@example.com"from_name = "Your Store"
# Option 2: SMTPsmtp_host = "smtp.example.com"smtp_port = 465smtp_user = "user@example.com"smtp_pass = "password"smtp_tls = trueFeatures
Section titled “Features”[features]debug_api = true # Enable debug endpointsmetrics = true # Prometheus metricshealth_check = true # /health endpoint[tls]enabled = falsecert_path = "/path/to/cert.pem"key_path = "/path/to/key.pem"