Skip to main content

Prerequisites

Before you begin, make sure you have the following installed:
One of these supported platforms:
  • Linux-based environment
  • macOS (Darwin)
  • WSL under Windows

Quick Setup with Docker Compose

The easiest way to get started is using our Docker Compose setup:
# Clone the repository
git clone https://github.com/flexprice/flexprice
cd flexprice

# Set up the complete development environment
make dev-setup
This single command takes care of everything you need to get started:
  1. Starting all required infrastructure (PostgreSQL, Kafka, ClickHouse, Temporal)
  2. Building the Flexprice application image
  3. Running database migrations and initializing Kafka
  4. Starting all Flexprice services (API, Consumer, Worker)

Accessing Services

Once setup is complete, you can access:

Useful Commands

Here are some common commands you might need during development:
make restart-flexprice
make down
make clean-start
make build-image
make start-flexprice

Running Without Docker

If you prefer to run the application directly:
# Start the required infrastructure
docker compose up -d postgres kafka clickhouse temporal temporal-ui

# Run the application locally
go run cmd/server/main.go

Connection Details

Use these credentials to connect to the various services:
  • Host: localhost
  • Port: 5432
  • Database: flexprice
  • Username: flexprice
  • Password: flexprice123
  • Host: localhost
  • Port: 9000
  • Database: flexprice
  • Username: flexprice
  • Password: flexprice123

API Documentation

Flexprice provides comprehensive API documentation in OpenAPI 3.0 format.

Setting up Postman

  1. Open Postman
  2. Click on “Import” in the top left
  3. Select “Import File”
  4. Choose docs/swagger/swagger-3-0.json
  5. Click “Import”
  6. Create a new environment for local development:
    • Name: Local
    • Variable: baseUrl
    • Value: http://localhost:8080/v1
    • Variable: apiKey
    • Value: 0cc505d7b917e0b1f25ccbea029dd43f4002edfea46b7f941f281911246768fe

Troubleshooting

If you encounter issues during setup or operation, try these troubleshooting steps:
  1. Ensure Docker is running properly:
docker info
  1. Check the status of all containers:
docker compose ps
  1. View logs for a specific service:
docker compose logs [service_name]
  1. Check database logs:
docker compose logs postgres
docker compose logs clickhouse
  1. Verify the database is running:
docker compose ps postgres
docker compose ps clickhouse
  1. Verify Kafka is running:
docker compose logs kafka
  1. Check topic list:
docker compose exec kafka kafka-topics --bootstrap-server kafka:9092 --list
  1. View Kafka UI at http://localhost:8084

Need Help?

If you’re still experiencing issues after trying the troubleshooting steps, please:

Additional Resources