Prerequisites
Before you begin, ensure you have the following installed:Docker
Install Docker for running containerized services
Docker Compose
Install Docker Compose for multi-container orchestration
FlexPrice supports Linux, macOS (Darwin), and WSL under Windows.
Setup FlexPrice
Start All Services
Run the complete development environment setup with a single command:This command will:
- Start all required infrastructure (PostgreSQL, Kafka, ClickHouse, Temporal)
- Build the FlexPrice application image
- Run database migrations and initialize Kafka
- Start all FlexPrice services (API, Consumer, Worker)
The setup process may take a few minutes on first run as it downloads Docker images and builds the application.
Verify Services are Running
Once setup is complete, verify all services are running:You should see the following services running:
postgres- PostgreSQL databasekafka- Apache Kafka message brokerclickhouse- ClickHouse analytics databasetemporal- Temporal workflow enginetemporal-ui- Temporal web interfaceflexprice-api- FlexPrice API serverflexprice-consumer- Event consumer serviceflexprice-worker- Temporal worker service
Access the Services
Once running, you can access the following services:
FlexPrice API
http://localhost:8080Main API endpoint for ingesting events and managing billing
Temporal UI
http://localhost:8088Monitor workflow executions and debug workflows
Kafka UI
http://localhost:8084View Kafka topics and messages (requires
--profile dev)ClickHouse
http://localhost:8123Query analytics and event data
Ingest Your First Event
Now that FlexPrice is running, let’s send your first usage event to track customer activity.Get Your API Key
For local development, use the default API key:
This is a development API key. In production, you’ll generate unique API keys per environment.
Verify Event Ingestion
Check that your event was processed successfully:View in Kafka UI:Check API Logs:
- Navigate to http://localhost:8084
- Click on the
eventstopic - View the latest messages
Using the SDKs
For production applications, use one of our official SDKs:SDK documentation and examples are available in the API Reference section.
Useful Commands
Here are some helpful commands for managing your local FlexPrice installation:Next Steps
Architecture Overview
Learn about FlexPrice’s system architecture and technology stack
Create Pricing Plans
Set up pricing plans for your customers
Configure Meters
Define what usage metrics to track
API Reference
Explore all available API endpoints
Troubleshooting
Services fail to start
Services fail to start
Ensure Docker has enough resources allocated (at least 4GB RAM recommended).Check Docker daemon status:View detailed logs:
Database connection errors
Database connection errors
Check database service health:View database logs:Verify database is accepting connections:
Kafka connection issues
Kafka connection issues
Verify Kafka is running:List Kafka topics:Reinitialize Kafka topics:
Events not appearing in ClickHouse
Events not appearing in ClickHouse
Check consumer service logs:Verify Kafka consumer group status:Check ClickHouse for recent events:
For more help, join our Slack community or open an issue on GitHub.