Skip to main content

Configuration Methods

Flexprice can be configured using:
  1. Environment variables (recommended)
  2. Configuration files
  3. Command-line arguments (for specific overrides)

Environment Variables

Environment variables are the recommended way to configure Flexprice. All environment variables are prefixed with FLEXPRICE_. Here’s a comprehensive list of available variables:

Deployment Configuration

Authentication Configuration

Database Configuration

ClickHouse Configuration

Kafka Configuration

Temporal Configuration

Logging and Monitoring

DynamoDB Configuration

Webhook Configuration

Event Publishing

Using a .env File

For local development, you can use a .env file to set environment variables. Create a file named .env in the root directory of your project:
When using Docker Compose, you can specify environment variables in your docker-compose.yml file or use the .env file directly.

Configuration File

For more complex configurations, you can use a YAML configuration file. By default, Flexprice looks for a file named config.yaml in the internal/config directory:
Environment variables take precedence over configuration file settings. If an environment variable is set, it will override the corresponding value in the configuration file.

Production Best Practices

When configuring Flexprice for production, follow these best practices:

Security

  1. Use strong, unique passwords for all database users
  2. Enable SSL/TLS for all external connections
  3. Set up a firewall to restrict access to your servers
  4. Use a secure API key for authentication
  5. Rotate secrets regularly to maintain security

Performance

  1. Allocate sufficient resources to each component based on your expected load
  2. Monitor resource usage and scale as needed
  3. Configure appropriate Kafka settings for your message volume
  4. Adjust database connection pools based on your workload

High Availability

  1. Set up database replication for PostgreSQL and ClickHouse
  2. Deploy multiple API server instances behind a load balancer
  3. Configure Kafka with multiple brokers in a cluster
  4. Implement automated backups for all data stores