Introduction

Setup Feedier BX in Local

Install with Docker (Approx. 20 Minutes)

Prerequisites

  • Clone the repository from Bitbucket
  • Copy the environment file:
    cp .env.example .env

Install Dependencies

Run the following command to install Composer dependencies using Docker:

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php84-composer:latest \
    composer install --ignore-platform-reqs

Edit the configuration in the /etc/hosts of your local machine, and add the following settings:

127.0.0.1 dashboard.feedier.test api.feedier.test feedback.feedier.test bx.feedier.test api.bx.feedier.test survey.feedier.test

Start the Application

  1. Start the containers:
    ./vendor/bin/sail up -d
  2. Generate a secure Laravel key:
    ./vendor/bin/sail artisan key:generate
  3. Create and migrate the database:
    ./vendor/bin/sail artisan migrate
  4. Install NPM dependencies:
    ./vendor/bin/sail npm install
  5. Start the Vite watcher for frontend assets:
    ./vendor/bin/sail npm run dev

Install Feedier-survey

This section covers setting up Feedier Survey (V2) to work alongside Feedier V4 (BX) independently on Docker.

Prerequisites

  • Clone the Feedier Survey repository from Bitbucket
  • Copy the environment file:
    cp .env.example .env
  • Configure the .env file with your local settings (the env.example is usually already set up for local development)
  • Run the Docker containers:
    docker compose up -d
  • Clone database from staging and dump it in your SQL container

Install Dependencies

  1. Install Composer dependencies:

    docker compose exec application composer install
  2. Generate a secure Laravel key (ONLY needed if you want to run V2 in standalone mode):

    docker compose exec application php artisan key:generate
  3. Create and migrate your database:

    docker compose exec application php artisan migrate
  4. Install NPM dependencies:

    docker compose exec application npm install
  5. Compile the frontend assets:

    docker compose exec application gulp

Start the Application

Start Feedier Survey & Feedier V4 independently on Docker:

  1. Make sure to have 2 distinct databases:

    • One for Feedier Survey in feedier-dashboard-v2-mysql-1 container
    • One for Feedier V4 in feedier-bx-mysql-1 container
  2. Run the migrations for each application

  3. Create a new passport:client on V4:

    sail artisan passport:client --name="feedier-local" --redirect_uri="http://survey.feedier.test:8888/auth/feedier/callback"
    
    sail php artisan passport:keys
  4. Configure Feedier Survey environment variables:

    Add the following to your Feedier Survey .env:

    SESSION_SECURE_COOKIE=false
    SESSION_DOMAIN=.feedier.test
    
    APP_URL=http://bx.feedier.test:8889
    APP_API_URL=http://api.feedier.test:8888
    FORWARD_APP_PORT=8888
    
    FEEDIER_BX=http://bx.feedier.test:8889
    FEEDIER_WEBHOOK_URL=http://api.bx.feedier.test/v3/import/webhook/feedier_survey
    
    FEEDIER_URL_V2_API=http://api.feedier.test/v1
    FEEDIER_URL_V2_DASHBOARD=http://survey.feedier.test/#/
    
    FEEDIER_BASE_URL=http://bx.feedier.test:8889
    FEEDIER_CLIENT_ID=<generated_client_id>
    FEEDIER_CLIENT_SECRET=<generated_client_secret>
    FEEDIER_REDIRECT_URI=http://survey.feedier.test:8888/auth/feedier/callback
  5. Configure V4 environment variables:

    Add the following to your V4 .env:

    FEEDIER_URL_V2_API=http://api.feedier.test/v1
    FEEDIER_URL_V2_DASHBOARD=http://survey.feedier.test/#/
  6. Clear configuration cache:

    docker compose exec application php artisan config:clear
    docker compose exec application php artisan cache:clear
  7. Compile assets:

    docker compose exec application gulp
  8. Connect to the application:

    • Dashboard: http://survey.feedier.test:8888
    • Feedback: http://feedback.feedier.test:8888
    • API: http://api.feedier.test/docs#/ && http://api.feedier.test/v1

Troubleshooting

If the connection doesn't work, try accessing the application in incognito mode (clean your cache + cookies).


Services

Mailpit

Mailpit is a local email testing tool, similar to Mailtrap but free and local.

Redis

Redis is an in-memory data store used for caching and message brokering.

  • Host: 127.0.0.1
  • User: (leave blank)
  • Password: Check .env${REDIS_PASSWORD}
  • Port: Check .env${FORWARD_REDIS_PORT}
  • Documentation: https://redis.io/documentation

MySQL

MySQL is the relational database used for storing application data.

  • Host: 127.0.0.1
  • User: Check .env${DB_USERNAME}
  • Password: Check .env${DB_PASSWORD}
  • Database: Check .env${DB_DATABASE}
  • Port: Check .env${FORWARD_DB_PORT}
  • Documentation: https://dev.mysql.com/doc/

Selenium

Selenium is a browser automation tool used for capturing screenshot of our application.

Keycloak

Keycloak is an open-source identity and access management system for Single Sign-On (SSO) authentication.

MinIO

MinIO is an S3-compatible object storage service for storing files and assets.

  • API URL: http://localhost:9500
  • Console URL: http://localhost:8900
  • Default Credentials:
    • User: sail
    • Password: password
  • Documentation: https://min.io/docs

Access the Container via SSH

For running Composer, NPM, Artisan, etc., execute:

./vendor/bin/sail shell

Create an Alias for Convenience

echo "alias sail='./vendor/bin/sail'" >> ~/.bashrc && source ~/.bashrc

Now, you can use sail as a shortcut.

Do not run npm, composer, or artisan commands outside the Sail environment. Always use:

sail {npm, composer, artisan...}

Synchronize Your Feedback with Elasticsearch

  1. Run the following command:
    ./vendor/bin/sail artisan scout:update
  2. Then, process the pending jobs on Horizon:
    ./vendor/bin/sail php artisan horizon

Configure PHPStorm for Development

Follow these steps in order to ensure your pull requests pass pipeline checks:

  1. Use Docker's PHP
  2. Use Docker's Node
  3. Install ESLint
  4. Install Laravel Pint

This setup ensures a consistent development environment across all team members.

Previous
Getting Started