2017 © Pedro Peláez
 

project frontend

Dotkernel Frontend Application

image

dotkernel/frontend

Dotkernel Frontend Application

  • Thursday, June 28, 2018
  • by dotkernel
  • Repository
  • 7 Watchers
  • 5 Stars
  • 140 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 20 Versions
  • 1 % Grown

The README.md

frontend

Dotkernel web starter package suitable for frontend applications., (*1)

OSS Lifecycle PHP from Packagist (specify version), (*2)

GitHub issues GitHub forks GitHub stars GitHub license, (*3)

Continuous Integration codecov Qodana PHPStan, (*4)

Installing DotKernel frontend

Tools

DotKernel Frontend interface has been tested with npm v10.0.4 and Node.js v20.11.0., (*5)

Composer

Installation instructions:, (*6)

If you have never used composer before make sure you read the Composer Basic Usage section in Composer's documentation, (*7)

Choosing an installation path for DotKernel frontend

Example:, (*8)

  • absolute path /var/www/dk
  • or relative path dk (equivalent with ./dk)

Installing DotKernel frontend

After you choose the path for DotKernel Frontend (dk will be used for the remainder of this example), let's move onto installation., (*9)

Note

The installation uses the PHP extension ext-intl that may not be enabled by default in your web server. If the installation returns a similar error to the below, check the extension=intl extension in your php.ini., (*10)

Your requirements could not be resolved to an installable set of packages.

Problem 1
 - laminas/laminas-i18n 2.10.3 requires ext-intl * -> the requested PHP extension intl is missing from your system.

To enable an extension, remove the semicolon (;) in front of it., (*11)

Installing DotKernel frontend using git clone

This method ensures that the default branch is installed, even if it is not released. Run the following command:, (*12)

git clone https://github.com/dotkernel/frontend.git .

The dependencies have to be installed separately, by running this command:, (*13)

composer install

The setup script prompts for some configuration settings, for example the lines below:, (*14)

Please select which config file you wish to inject 'Laminas\Diactoros\ConfigProvider' into:
  [0] Do not inject
  [1] config/config.php
  Make your selection (default is 1):

Simply select [0] Do not inject, because DotKernel includes its own configProvider which already contains the prompted configurations., (*15)

If you choose [1] config/config.php Laminas's ConfigProvider from session will be injected., (*16)

The next question is:, (*17)

Remember this option for other packages of the same type? (y/N), (*18)

Configuration - First Run

  • duplicate config/autoload/development.local.php.dist as config/autoload/development.local.php
  • duplicate config/autoload/local.php.dist as config/autoload/local.php
  • duplicate config/autoload/mail.local.php.dist as config/autoload/mail.local.php
  • Edit config/autoload/local.php according to your dev machine and fill in the database configuration.

Configuration - Mail (optional)

If you want your application to send mails on registration, contact etc. add valid credentials to the following keys in config/autoload/mail.local.php, (*19)

Under message_options key:, (*20)

  • from - email address that will send emails (required)
  • from_name - organization name for signing sent emails (optional)

Under smtp_options key:, (*21)

  • host - hostname or IP address of the mail server (required)
  • connection_config - add the username and password keys (required)

In config/autoload/local.php edit the key contact => message_receivers => to with string values for emails that should receive contact messages., (*22)

Note: Please add at least 1 email address in order for contact message to reach someone, (*23)

Also feel free to add as many CCs as you want under the contact => message_receivers => cc key., (*24)

Configuration - reCAPTCHA (optional)

reCAPTCHA is used to prevent abusive activities on your website. DotKernel frontend uses the Google reCAPTCHA for its contact us form. You must first generate a siteKey and secretKey in your Google account - Google reCAPTCHA, (*25)

Update the recaptcha array in config/autoload/local.php with the siteKey and secretKey from Google reCAPTCHA., (*26)

Note: you need to whitelist localhost in the reCAPTCHA settings page during development. When in production do not forget to either remove localhost from the reCAPTCHA whitelist, or have a separate reCAPTCHA, (*27)

Database migration

Running the database migration is done with this command, (*28)

php vendor/bin/doctrine-migrations migrate

Note: if you have already run the phinx migrations, you may get this message, (*29)

WARNING! You have x previously executed migrations in the database that are not registered migrations.
  {migration list}
Are you sure you wish to continue? (y/n)

After submitting y, you will get this confirmation message., (*30)

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)

Again, submit y to run all the migrations in chronological order. Each migration will be logged in the migrations table to prevent running the same migration more than once, which is often not desirable., (*31)

Seeding the database (Fixtures)

Seeding the database is done with the help of our custom package dotkernel/dot-data-fixtures built on top of doctrine/data-fixtures. To execute all fixtures, run:, (*32)

php bin/doctrine fixtures:execute

Development mode

Run this command to enable dev mode by turning debug flag to true and turning configuration caching to off. It will also make sure that any existing config cache is cleared., (*33)

composer development-enable
  • If not already done, remove the .dist extension from config/autoload/development.global.php.dist.

NPM Commands

To install dependencies into the node_modules directory run this command., (*34)

npm install
  • If npm install fails, this could be caused by user permissions of npm. Recommendation is to install npm through Node Version Manager.

The watch command compiles the components then watches the files and recompiles when one of them changes., (*35)

npm run watch

After all updates are done, this command compiles the assets locally, minifies them and makes them ready for production., (*36)

npm run prod

Running the application

We recommend running your applications in WSL:, (*37)

  • make sure you have WSL installed on your system
  • currently we provide a distro implementations for AlmaLinux9
  • install the application in a virtualhost as recommended by the chosen distro
  • set $baseUrl in config/autoload/local.php to the address of the virtualhost
  • run the application by opening the virtualhost address in your browser

You should see the DotKernel Frontend welcome page., (*38)

NOTE:, (*39)

  • If you are getting exceptions or errors regarding some missing services, try running the following command:
sudo php bin/clear-config-cache.php

If config-cache.php is present that config will be loaded regardless of the ConfigAggregator::ENABLE_CACHE in config/autoload/mezzio.global.php, (*40)

  • Development only: session.cookie_secure does not work locally so make sure you modify your local.php, as per the following:
# other code

return [
    # other configurations...
    'session_config' => [
        'cookie_secure' => false,
    ],
];

Do not change this in local.php.dist as well because this value should remain true on production., (*41)

The Versions

28/06 2018

dev-master

9999999-dev

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax
by DotKernel Team

28/06 2018

dev-migration

dev-migration

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by DotKernel Team

30/05 2018

v1.0.0

1.0.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by DotKernel Team

26/09 2017

dev-lock-table-removed

dev-lock-table-removed

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

11/08 2017

dev-webpack-integration

dev-webpack-integration

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

17/07 2017

dev-develop

dev-develop

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

26/05 2017

0.5.0

0.5.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

03/05 2017

0.4.1

0.4.1.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

02/05 2017

0.4.0

0.4.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

21/04 2017

dev-develop2

dev-develop2

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

11/04 2017

dev-ui-develop

dev-ui-develop

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

07/04 2017

0.3.2

0.3.2.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

07/04 2017

0.3.1

0.3.1.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

07/04 2017

0.3.0

0.3.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

23/03 2017

0.2.2

0.2.2.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

22/03 2017

0.2.1

0.2.1.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

22/03 2017

0.2.0

0.2.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

12/03 2017

0.1.2

0.1.2.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

12/03 2017

0.1.1

0.1.1.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax

11/03 2017

0.1.0

0.1.0.0

Dotkernel Frontend Application

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax