Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dotkernel Frontend Application. Based on Mezzio microframework using Laminas components.

License

NotificationsYou must be signed in to change notification settings

dotkernel/frontend

Repository files navigation

Dotkernel Frontend is an application (skeleton) based on Mezzio microframework using Laminas components.It's designed as a web starter package suitable for frontend applications.The current functionality is included as a proof of concept and to showcase Frontend's file architecture:

  • Contact us page
  • Generic page with copy
  • User accounts

Use these building blocks as an example for your own custom code.

Check out ourdemo.

Documentation

Documentation is available at:https://docs.dotkernel.org/frontend-documentation/

Version History

BranchReleasePSR-11OSS LifecyclePHP Version
5.0>= 5.01OSS LifecyclePHP from Packagist (specify version)
4.0< 5.01OSS LifecyclePHP from Packagist (specify version)
3.0< 4.01OSS LifecyclePHP from Packagist (specify version)

Badges

OSS LifecyclePackagist Dependency Version

GitHub issuesGitHub forksGitHub starsGitHub license

Continuous IntegrationcodecovQodanaPHPStan

Installing Dotkernelfrontend

Tools

Dotkernel Frontend interface has been tested with npm v10.0.4 and Node.js v20.11.0.

Composer

Installation instructions:

If you have never used composer before make sure you read theComposer Basic Usage section in Composer's documentation

Choosing an installation path for Dotkernelfrontend

Example:

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

Installing Dotkernelfrontend

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

Note

The installation uses the PHP extensionext-intl that may not be enabled by default in your web server. If the installation returns a similar error to the below, check theextension=intl extension in yourphp.ini.

Your requirements could not be resolved to an installableset 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.

Installing Dotkernelfrontend using git clone

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

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

The dependencies have to be installed separately, by running this command:

composer install

The setup script prompts for some configuration settings, for example the lines below:

Pleaseselectwhich 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.

If you choose[1] config/config.php Laminas'sConfigProvider fromsession will be injected.

The next question is:

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

Configuration - First Run

  • duplicateconfig/autoload/development.local.php.dist asconfig/autoload/development.local.php
  • duplicateconfig/autoload/local.php.dist asconfig/autoload/local.php
  • duplicateconfig/autoload/mail.local.php.dist asconfig/autoload/mail.local.php
  • Editconfig/autoload/local.php according to your dev machine and fill in thedatabase configuration.

Configuration - Mail (optional)

If you want your application to send mails on registration, contact etc. add valid credentials to the following keys inconfig/autoload/mail.local.php

Undermessage_options key:

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

Undersmtp_options key:

  • host - hostname or IP address of the mail server (required)
  • connection_config - add theusername andpassword keys (required)

Inconfig/autoload/local.php edit the keycontact =>message_receivers =>to withstring values for emails that should receive contact messages.

Note:Please add at least 1 email address in order for contact message to reach someone

Also feel free to add as many CCs as you want under thecontact =>message_receivers =>cc key.

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 asiteKey andsecretKey in your Google account -Google reCAPTCHA

Update therecaptcha array inconfig/autoload/local.php with thesiteKey andsecretKey from Google reCAPTCHA.

Note: you need to whitelistlocalhost in the reCAPTCHA settings page during development.When in production do not forget to either removelocalhost from the reCAPTCHA whitelist, or have a separate reCAPTCHA

Database migration

Running the database migration is done with this command

php vendor/bin/doctrine-migrations migrate

Note: if you have already run the phinx migrations, you may get this message

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

After submittingy, you will get this confirmation message.

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

Again, submity to run all the migrations in chronological order. Each migration will be logged in themigrations table to prevent running the same migration more than once, which is often not desirable.

Seeding the database (Fixtures)

Seeding the database is done with the help of our custom packagedotkernel/dot-data-fixtures built on top of doctrine/data-fixtures. To execute all fixtures, run:

php bin/doctrine fixtures:execute

Development mode

Run this command to enable dev mode by turning debug flag totrue and turning configuration caching tooff. It will also make sure that any existing config cache is cleared.

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

NPM Commands

To install dependencies into thenode_modules directory run this command.

npm install
  • Ifnpm install fails, this could be caused by user permissions of npm. Recommendation is to install npm throughNode Version Manager.

The watch command compiles the components then watches the files and recompiles when one of them changes.

npm run watch

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

npm run prod

Running the application

We recommend running your applications in WSL:

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

You should see theDotkernel Frontend welcome page.

NOTE:

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

Ifconfig-cache.php is present that config will be loaded regardless of theConfigAggregator::ENABLE_CACHE inconfig/autoload/mezzio.global.php

  • Development only:session.cookie_secure does not work locally so make sure you modify yourlocal.php, as per the following:
# other codereturn [# other configurations...'session_config' => ['cookie_secure' =>false,    ],];

Do not change this inlocal.php.dist as well because this value should remaintrue on production.

About

Dotkernel Frontend Application. Based on Mezzio microframework using Laminas components.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors11


[8]ページ先頭

©2009-2025 Movatter.jp