rybbit/docker-compose.yml
Bill Yang ca0faeb484
Add goal management functionality in analytics (#100)
* Add goal management functionality in analytics

- Introduced goal creation, deletion, and updating capabilities in the analytics API, allowing users to define conversion goals based on path or event types.
- Implemented corresponding React hooks for managing goals, including fetching, creating, updating, and deleting goals.
- Enhanced the UI with a dedicated Goals page and components for listing and managing goals, improving user experience in tracking conversions.
- Updated package dependencies to include necessary libraries for form handling and validation.

* Enhance goals management with pagination and sorting

- Added pagination and sorting capabilities to the goals fetching logic in the analytics API, allowing users to navigate through goals more efficiently.
- Updated the GoalsPage component to manage current page state and handle page changes, improving user experience.
- Modified the GoalsList component to display pagination metadata and navigation controls, facilitating better goal management.
- Adjusted the server-side getGoals function to support pagination and sorting parameters, ensuring accurate data retrieval.

* Refactor GoalsPage and GoalCard components for improved UI and functionality

- Updated GoalsPage to include a SubHeader component and adjusted layout for better responsiveness.
- Enhanced loading and empty state handling in GoalsPage for a smoother user experience.
- Modified GoalCard to use icons for goal types, improving visual clarity and consistency in the UI.

* Refactor CreateGoalButton and GoalCard components for improved modal handling

- Updated CreateGoalButton to utilize a trigger prop for the GoalFormModal, simplifying modal state management.
- Refactored GoalCard to integrate GoalFormModal for editing goals, enhancing user interaction and reducing state complexity.
- Removed unnecessary state management and modal handling from both components, streamlining the codebase.

* Refactor GoalCard and Clickhouse initialization for improved code clarity

- Removed unnecessary imports in GoalCard component, streamlining the code.
- Updated Clickhouse initialization to include a new 'props' JSON field alongside 'properties', enhancing data structure for analytics.
- Added a utility function in PageviewQueue to parse properties, improving error handling and data integrity.

* enable clickhouse

* fix ch build

* fix ch build

* fix ch build

* wip

* wip

* wip

* Enable json

* add network

* add network

* Refactor Clickhouse configuration and remove unused properties from data models

* Refactor property value handling in analytics queries to utilize native JSON types in ClickHouse, improving type safety and performance.
2025-04-28 20:58:43 -07:00

100 lines
2.7 KiB
YAML

services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp" # Needed for HTTP/3
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile # Mount Caddy config file
- caddy_data:/data # Mount persistent data volume for certs etc.
- caddy_config:/config # Mount persistent config volume
environment:
# Pass domain name for use in Caddyfile
# Email is configured via Caddyfile global options
- DOMAIN_NAME=${DOMAIN_NAME}
depends_on:
- backend
- client
clickhouse:
container_name: clickhouse
image: clickhouse/clickhouse-server:latest
ports:
- "8123:8123"
- "9000:9000"
volumes:
- clickhouse-data:/var/lib/clickhouse
- ./clickhouse_config:/etc/clickhouse-server/config.d
environment:
- CLICKHOUSE_DB=analytics
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=frog
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"]
interval: 3s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: frog
POSTGRES_PASSWORD: frog
POSTGRES_DB: analytics
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
backend:
container_name: backend
build:
context: ./server
dockerfile: Dockerfile
environment:
- NODE_ENV=production
- CLICKHOUSE_HOST=http://clickhouse:8123
- CLICKHOUSE_DB=analytics
- CLICKHOUSE_PASSWORD=frog
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=analytics
- POSTGRES_USER=frog
- POSTGRES_PASSWORD=frog
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- BASE_URL=${BASE_URL}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
- CLOUD=${CLOUD}
depends_on:
clickhouse:
condition: service_healthy
postgres:
condition: service_started
restart: unless-stopped
client:
container_name: client
build:
context: ./client
dockerfile: Dockerfile
args:
NEXT_PUBLIC_BACKEND_URL: ${BASE_URL}
environment:
- NODE_ENV=production
- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}
- CLOUD=${CLOUD}
depends_on:
- backend
restart: unless-stopped
volumes:
clickhouse-data:
postgres-data:
caddy_data: # Persistent volume for Caddy's certificates and state
caddy_config: # Persistent volume for Caddy's configuration cache (optional but good practice)