### Run local development setup commands Source: https://github.com/aialvi/openfunnels/blob/main/CONTRIBUTING.md Execute these commands to install dependencies, configure the environment, and start the development server. ```bash composer install pnpm install cp .env.example .env php artisan key:generate touch database/database.sqlite php artisan migrate composer run dev ``` -------------------------------- ### Setup Local Development Environment Source: https://github.com/aialvi/openfunnels/blob/main/README.md Commands to clone the repository, install dependencies, configure the environment, and initialize the database. ```bash git clone https://github.com/aialvi/openfunnels.git cd openfunnels composer install corepack enable pnpm install cp .env.example .env php artisan key:generate touch database/database.sqlite php artisan migrate --seed ``` -------------------------------- ### Install OpenFunnels dependencies and build assets Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md Commands to clone the repository, install PHP and Node.js dependencies, build frontend assets, and initialize the application environment. ```bash git clone https://github.com/aialvi/openfunnels.git cd openfunnels composer install --no-dev --classmap-authoritative pnpm install --frozen-lockfile pnpm run build cp .env.example .env php artisan key:generate php artisan migrate --force php artisan storage:link php artisan optimize ``` -------------------------------- ### Start the Docker Compose stack Source: https://github.com/aialvi/openfunnels/blob/main/docs/docker-evaluation.md Starts the OpenFunnels evaluation stack. Open http://localhost:8000 and choose Launch Demo or register a persistent local account. ```bash docker compose up --build ``` -------------------------------- ### Start Development Services Source: https://github.com/aialvi/openfunnels/blob/main/README.md Runs Laravel, the queue listener, log tailing, and Vite concurrently. ```bash composer run dev ``` -------------------------------- ### Run Application and Frontend Separately Source: https://github.com/aialvi/openfunnels/blob/main/README.md Starts the Laravel server and the frontend development server in separate processes. ```bash php artisan serve pnpm run dev ``` -------------------------------- ### Deploy OpenFunnels with Docker Compose Source: https://github.com/aialvi/openfunnels/blob/main/README.md Commands to clone the repository and start the evaluation stack. Requires Docker with Compose v2. ```bash git clone https://github.com/aialvi/openfunnels.git cd openfunnels docker compose up --build ``` -------------------------------- ### Development Commands for OpenFunnels Source: https://github.com/aialvi/openfunnels/blob/main/AGENTS.md Use these commands for dependency installation, development servers, builds, testing, and formatting. Note that pnpm run lint runs ESLint with --fix and may edit files; use pnpm run lint instead of the undefined pnpm run lint:fix. composer run dev internally uses npm run dev. ```bash # PHP dependencies composer install # JS dependencies pnpm install # One-command Laravel/Vite/queue/log development stack composer run dev # Separate frontend dev server pnpm run dev # Build frontend assets pnpm run build # SSR build pnpm run build:ssr # PHP tests composer test # or php artisan test # PHP formatting ./vendor/bin/pint # Frontend formatting/checks pnpm run format pnpm run format:check pnpm run lint pnpm run types ``` -------------------------------- ### Run supervised queue worker Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md Command to start the queue worker for processing automation tasks, with specified sleep, retry, and max-time limits. ```bash php artisan queue:work --sleep=3 --tries=3 --max-time=3600 ``` -------------------------------- ### Run Verification Commands Source: https://github.com/aialvi/openfunnels/blob/main/docs/prds/automation-studio.md Execute these commands to verify the implementation per slice and ensure project standards are met. ```bash composer test pnpm run test pnpm run types pnpm run lint pnpm run format:check ./vendor/bin/pint --test pnpm run build git diff --check ``` -------------------------------- ### Run project verification checks Source: https://github.com/aialvi/openfunnels/blob/main/CONTRIBUTING.md Execute these commands to run tests, linting, type checking, and formatting before submitting a pull request. ```bash composer test vendor/bin/pint --test pnpm run types pnpm run test pnpm run lint pnpm run format:check pnpm run build ``` -------------------------------- ### Project Directory Structure Source: https://github.com/aialvi/openfunnels/blob/main/README.md Mapping of key directories and files to their respective roles in the application, including controllers, models, frontend components, and testing. ```text app/Http/Controllers/ HTTP behavior for funnels, contacts, leads, and analytics app/Models/ Eloquent models and funnel publishing helpers app/Policies/FunnelPolicy.php Authorization for user-owned funnels resources/js/pages/ Inertia pages, including the primary editor resources/js/components/editor/ Drag-and-drop editor UI resources/js/stores/funnelStore.ts Zustand + Immer editor state and history resources/js/types/editor.ts Canonical funnel editor types resources/js/lib/exporters/ Funnel export implementations routes/web.php Public, authenticated, and custom-domain routes tests/ Pest feature/unit tests and Vitest frontend tests ``` -------------------------------- ### Configure custom domain DNS mapping Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md Environment variables for mapping custom domains to the OpenFunnels instance. ```env DOMAIN_MAPPING_CNAME_TARGET=funnels.example.com DOMAIN_MAPPING_A_RECORD_IP=203.0.113.10 FUNNEL_CUSTOM_DOMAIN_SCHEME=https ``` -------------------------------- ### Manage Docker Service Lifecycle Source: https://github.com/aialvi/openfunnels/blob/main/README.md Commands for monitoring logs and managing the lifecycle of the local Docker stack. ```bash # Follow service logs docker compose logs -f # Stop without deleting local data docker compose down # Remove the stack and its local data docker compose down --volumes ``` -------------------------------- ### Automation configuration settings Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md Environment variables to control automation queue behavior, retention, and webhook security policies. ```env AUTOMATION_QUEUE=default AUTOMATION_RUN_RETENTION_DAYS=90 AUTOMATION_STALE_RUN_AFTER_MINUTES=5 AUTOMATION_WEBHOOK_ALLOW_PRIVATE_NETWORKS=false AUTOMATION_WEBHOOK_ALLOW_HTTP=false ``` -------------------------------- ### Custom Domain Mapping Configuration Source: https://github.com/aialvi/openfunnels/blob/main/docs/prds/mvp-funnel-crm.md Environment variables for defining the CNAME target and A record IP address for custom domain mapping. ```env DOMAIN_MAPPING_CNAME_TARGET=cname.openfunnels.com DOMAIN_MAPPING_A_RECORD_IP= ``` -------------------------------- ### Lead Capture Notification Configuration Source: https://github.com/aialvi/openfunnels/blob/main/docs/prds/mvp-funnel-crm.md Environment variables for configuring the recipient email for lead notifications and the webhook URL for external integrations. ```env LEAD_CAPTURE_NOTIFICATION_EMAIL= LEAD_CAPTURE_WEBHOOK_URL= ``` -------------------------------- ### Add cron entry for scheduler Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md Cron configuration to execute the Laravel scheduler every minute. ```cron * * * * * cd /path/to/openfunnels && php artisan schedule:run >/dev/null 2>&1 ``` -------------------------------- ### Development Account Credentials Source: https://github.com/aialvi/openfunnels/blob/main/README.md Default credentials for the seeded development account. ```text Email: test@example.com Password: password ``` -------------------------------- ### Docker Compose operations for evaluation Source: https://github.com/aialvi/openfunnels/blob/main/docs/docker-evaluation.md Common operations for the evaluation stack: follow logs, stop while preserving data, reset all local evaluation data, and rebuild after pulling updates. ```bash # Follow logs docker compose logs -f # Stop while preserving data docker compose down # Reset all local evaluation data docker compose down --volumes # Rebuild after pulling updates docker compose up --build --detach ``` -------------------------------- ### OpenFunnels Architecture Data Flow Source: https://github.com/aialvi/openfunnels/blob/main/README.md Visual representation of the data flow from the React editor to the published funnel, and from public forms/events to analytics and notifications. ```text React editor ──> canonical sections/columns/blocks JSON ──> draft preview └─────> published funnel Public form ───> contact ──> submission timeline ──> notification/webhook Public events ─> attribution and conversion data ──> dashboard/experiments ``` -------------------------------- ### WorkflowAction Interface Source: https://github.com/aialvi/openfunnels/blob/main/docs/prds/automation-studio.md Defines the contract for workflow actions, requiring methods for type identification, configuration validation, execution, and simulation. ```php interface WorkflowAction { public function type(): string; public function validate(array $config, User $owner): array; public function execute(WorkflowExecutionContext $context, array $config): ActionResult; public function simulate(WorkflowExecutionContext $context, array $config): ActionResult; } ``` -------------------------------- ### Public funnel URL format Source: https://github.com/aialvi/openfunnels/blob/main/docs/self-hosting.md The default URL structure for published funnels when no custom domain is configured. ```text https://your-openfunnels-host/f/{slug} ``` -------------------------------- ### Funnel Definition JSON Contract Source: https://github.com/aialvi/openfunnels/blob/main/docs/prds/automation-studio.md The core JSON structure defining the schema version, trigger configuration, and the sequence of nodes within a funnel. ```json { "schema_version": 1, "trigger": { "type": "funnel.form_submitted", "config": { "funnel_id": 12 } }, "start_node_id": "01J_NODE_A", "nodes": [ { "id": "01J_NODE_A", "type": "send_email", "config": { "purpose": "marketing", "subject": "Thanks, {{ contact.name }}", "body": "Here is what happens next." }, "next_node_id": "01J_NODE_B" }, { "id": "01J_NODE_B", "type": "condition", "config": { "field": "contact.status", "operator": "equals", "value": "qualified" }, "yes_node_id": "01J_NODE_C", "no_node_id": "01J_NODE_D" } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.