pckg/skeleton

Directory structure, required files and suggestions for /pckg

dev-master 2022-12-09 19:39 UTC

README

A clean start for every pckg project.

Build status

Features

  • PHP 8.0 Framework with ORM, Migrations, Auth, Queue and I18n modules on the backend - pckg
  • Webpack with VueJS ecosystem integration on the frontend - pckg-app/frontend and pckg-app/frontend-dev
  • Plug'n'play Docker images for Dev and Prod environments - pckg/docker-images
  • CI & CD pipelines (Github Workflows) - ./github/workflows/
  • PHP Cloc, Stan, CS, Codeception and Mocha - composer.json and package.json

Dev environment

The whole dev environment with system dependencies and some services is available in schtr4jh/pckg:latest Docker image.

$ docker run \
-v $PWD:/var/www/html \
-i -p 8072:443 \
-t schtr4jh/pckg:latest \
--restart=always /bin/bash

See pckg/docker-images for more info on configuration, parameters and services.

Create a project

Create a project with composer and install all depencencies including dev.

# composer create-project pckg/skeleton . -s dev --prefer-dist

Install frontend dependencies.

# yarn install

Console

See what console provides.

# php console

Available commands:

help Displays help for a command list Lists commands\
app\
**app:create**        Create new application\
cache\
**cache:clear**       Clear cache\
migrator\
**migrator:install**  Install migrations from envirtonment\

Create new application

Create a directory structure for the new application.

# php console app:create

Answer to some questions and create a new app structure in the app directory.

Init the application

Create static storage directories for the application.

# php console project:init

This will create the storage folder with some mandatory subfolders not included in GIT.

Access the application

Open in web browser.

https://localhost:8072/

Directory structure

  • vendor, components and node_modules - dependency managers directories
  • www - directory that will be exposed to the internet
  • storage - directory for framework, cache, uploads, tmp and other private and public files
  • config - root project configuration
  • app/$app/config - app configuration
  • app/$app/src - app source files
  • app/$app/public - static assets (private, can be mounted to www)

Note: it is recommended to disable discovery of dependency manager directories, www and storage.

Test the application

Runs mocha + codeception tests + static code analysis.

# php console project:test

More

Backend

Frontend

More

Support

pckg/framework pckg.org