Skip to content

Prezly Application

Native MacOS installation

  1. Clone the project

  2. Make sure you have nvm and pnpm installed

  3. Configure PostgreSQL:

    • Install by running brew install postgresql
    • Open PostgreSQL CLI: psql postgres
    • Crate user and database by running:
      sql
      CREATE DATABASE prezlydb;
      CREATE USER prezly WITH PASSWORD 'secret';
      GRANT ALL PRIVILEGES ON DATABASE prezlydb TO prezly;
    • Close connection by typing \q + Enter
  4. Install Redis by running pecl install redis

  5. Install Meilisearch: brew install meilisearch + brew services start meilisearch

  6. Configure Apache and PHP (article)

    • brew install httpd php

    • Edit /opt/homebrew/etc/httpd/httpd.conf

      1. Change Listen 8080 -> Listen 80

      2. Uncomment following lines

        • #Include /opt/homebrew/etc/httpd/extra/httpd-vhosts.conf
        • #LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
      3. Add following lines to the end of the config file

        LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
        
        <IfModule php_module>
            <FilesMatch \.php$>
                SetHandler application/x-httpd-php
            </FilesMatch>
        
            <IfModule dir_module>
                DirectoryIndex index.html index.php
            </IfModule>
        </IfModule>
      4. Create /opt/homebrew/etc/httpd/extra/httpd-php.conf with following contents:

        <VirtualHost *:80>
            ServerName rock.prezly.test
            DocumentRoot /[path to project]/web
        
            <Directory /[path to project]/web>
                Require all granted
        
                # Enable rewrite engine and set base directory (adjust if needed)
                RewriteEngine On
                RewriteBase /
        
                # Don't rewrite existing files or directories
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
        
                # Rewrite all other requests to index.html
                RewriteRule ^ index.php [L]
            </Directory>
        </VirtualHost>
  7. Start services

    • brew services start httpd
  8. Copy .env.dist file and rename to .env, and set:

    • PREZLY_WEBPACK_LIVERELOAD=true
    • PREZLY_DEBUG_EMAIL_ADDRESS=xxxxx@prezly.com
  9. Open project root directory and run commands:

    • make hosts + add following lines to /etc/hosts
      127.0.0.1 postgres
      127.0.0.1 redis
      127.0.0.1 meilisearch
    • make wipe
  10. Install Composer: brew install composer

  11. Create a symlink (see Slack thread)

    • Run in a root project directory ln -fs $(realpath vendor/rock-symphony/propel-orm-plugin) plugins/propelOrmPlugin
  12. Install dependencies: composer install + composer update

  13. Run Webpack watch server: cd apps/backend + make watch