# kisscore **Repository Path**: wfdaj/kisscore ## Basic Information - **Project Name**: kisscore - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-14 - **Last Updated**: 2024-08-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # KISSCore ## What is it? KISSCore Microframework on PHP 8+ is the lightweight single file packed end-project framework for rapid development of very fast projects. 1. Single core file in project you create 2. Simple and very fast template engine that allows you to use only blocks and iterations (easy to learn for designers) 3. Fast routes that convert to nginx rewrite on init. Live route table in action files just with a single comment 4. Minimum dependency and maximum profit 5. Plugins with a nice approach for easy extension 6. Deploy script to production servers in parallel! ## Installation guide ### Get KISS Core package Just clone it from git: ```bash git clone git@github.com:muvon/kisscore.git ``` ### New application First you should update your php-fpm and nginx global config to include projects files. Add the following lines to php-fpm config: ```bash include = /home/*/*/env/etc/php-fpm.conf ``` And the following lines for nginx config: ```bash include /home/*/*/env/etc/nginx.conf; ``` Now you can create application with single command in KISS Core dir: ```bash ./create-app ~/Work/myproj ``` That will create your application in folder myproj under home dir, prepare all it environment in local machine and restart php-fpm and nginx. So be sure that you correctly configured your php-fpm and nginx on your server like I wrote before. Setup domain for local test: ```bash sudo echo '127.0.0.1 myproj.lo' >> /etc/hosts ``` Restart services nginx and php-fpm and enjoy in you browser opening your project http://myproj.lo ## Running using Docker containers You can simple run newly created project using [Yoda](https://github.com/muvon/yoda) with [Docker](https://docker.com). Just install Yoda, change dir of your current project and run in your bash shell: ```bash yoda start ``` ## Update core in existing application You also can update compiled KISSCore file in your application. Just run install-core and enjoy! ```bash ./install-core [arguments] ~/Work/myproj Where arguments are: --with-plugins - Install core plugins ``` ## Folder structure ### Root folders structure | Folder | Description | |--------|----------------------------------------------------------------------------------------| | app | Main project folder with source code, libraries, static and KISSCore | | docker | This folder contains Yoda configs to start project using docker containers | | env | Environment folder with tmp files, generated maps, configs and other special env stuff | ### app skeleton | Folder | Description | Namespace | |----------------|----------------------------------------------------------------|-------------------------------| | actions | Action dir, it contains of action files that includes on route | | | bin | Special bash scripts and bin files | | | config | Config folder with all configs templates and main: app.yml.tpl | | | core.php | Core file with merged KISSCore classes and functions | | | frontend.php | That files handle all nginx dynamic requests (front point) | | | lib | Library sources that does not depend on KISSCore | Lib | | main.php | Thats is type of front controller, but just a simple flat file | | | src | All your source code, structured as you want | App | | static | Root nginx dir for static files | | | triggers | Special triggers. It contains flat files with some annotation | | | vendor | Thrird party libraries namespaced with PSR-4 | All other not included before | | views | Templates for rendering from action | | ### env skeleton | Folder | Description | |--------|--------------------------------------------------------------------------| | bin | Symlink to app/bin | | etc | Generated configs that uses by application and services | | files | Static files. You can use it just a like storage | | log | All logs go here | | run | Pid files with running processes, some special files that depends on run | | tmp | It contains temporary files | | var | Some application data, configured maps and so on | ## Environment variables Must be set by you: - $APP_ENV - current environment And this is autodetected by KISSCore: - $APP_DIR - application dir with code - $ENV_DIR - environment dir - $RUN_DIR - run directory (pid files of running processes and so on) - $VAR_DIR - Var dir - $TMP_DIR - for temp files - $LOG_DIR - all logs from project collect here - $CONFIG_DIR - configuration files - $BIN_DIR - for special bin files and scripts - $STATIC_DIR - public directory for static files ## Plugins There are core plugins that may be purged at the stage of installing core. You can simply pass the `--with-plugins` flag to the install-core script to install them. We are working on making them more modular and easy to use. ## Libs Libs are independent and lightweight modules with no direct coupling to kisscore. These can be installed separately using the `--with-libs` flag during the installation process. Unlike plugins, libs are designed to be more versatile and can be used across different projects without heavy dependencies on the core system. ## Actions All actions are in app/actions folder. You should just create any file, for example test.php and put code in it. ```php that will execute this action. ## Triggers There are special functionality to trigger some event, catch it and do something. It works like hooks. First you call trigger_event('test', ['var' => 'test']) in any place of your code. Then you create special trigger file in app/triggers folder. Annotate trigger with special comments, for example: ```php