Build lightning-fast and feature-rich websites with ProcessWire.

Overview

WIREKIT Core

Build lightning-fast and feature-rich websites with ProcessWire.

GitHub release (latest by date including pre-releases)

WireKit is processwire site profile, it provides modules, layouts, helpers and basic structure as a starting point for building any kind of websites.
Primary focus is on building front-end, rather then providing APIs. It is, i would say "html first".

Some principals that wirekit try to follow:

  • Plug and play features
  • Reusable components (layouts).
  • Keep workflow in templates folder
  • HTML first! Use php in html not other way around.
  • Separation of concerns.
  • Easy to edit and customize markup.
  • All front-end logic should be ajax based.

Starters

WireKit should provide quick start for your projects, so idea is to have starters for different purposes and usecases. WireKit Core is the first minimal starter, and more will come. There is a WireKit PRO starter in works, the premium one, but more about that some other time. Starters with different front-end frameworks should also be expected, Boostrap Starter for example...

Navigation

You can build your website navigation as traditional (page reload) way, or take advantage of SPA (single page app) type of navigation that wirekit provides out of the box. In both ways, we are keeping all of the SEO benifits that MPA (multi page apps), SSR (server side rendering), "traditional" websites provide.

Menu Manager

WireKit comes with menu manager built in. It is based on processwire templates and pages, which gives us much flexibility... With custom admin UI, you can manage all site navigation and menus in one place.

System and Site Settings

Site settings in wirekit are handled with system page and custom field that will generate settings fields from the json file. This way we can define site settings based on a project.
Json file is located at /vendor/json/system.json. To change it, and add your own options, just copy system.json file to the /templates/assets/json/ folder, and do your changes there. This way your settings will not be overwritten during the updates.
$system is a global variable in wirekit, so you can access the system page via api from anywhere as $system in template files, $this->system in modules, and wire("system") from anywhere. To get the site settings use $system->settings("field_name").

_init.php

This file is automatically included in all template files. We are using it to include our functions and manage wirekit settings using setting() function. Along with settings, here you can add js and css files that will be loaded in , add less files to the parser, define google font etc...

Style

WireKit provides less and scss compiler out of the box, so you can choose which preprocessor (if any) will be used on front-end. I would recommend using less, if there is a choice, as the compiler is more flexible at the moment.

Less

If you are using less preprocessor, you can pass less files to the compiler from any folder. Not just files, but also variables...
Less files and variables can be set in _init.php setting() function:

"less", // less or scss ... // less files to compile "less_files" => [ $config->paths->lib . "less/svg.less", $config->paths->lib . "less/htmx.less", $config->paths->templates . "less/style.less", ], /** * Override Less variables... * @example ["global-font-family" => $system->font_family] */ "less_vars" => [ "wk-font" => "Jost, Sans Serif", "wk-font-base" => "Jost, Sans Serif", ], ... ]);">
setting([
  "preprocessor" => "less", // less or scss

  ...

  // less files to compile
  "less_files" => [
    $config->paths->lib . "less/svg.less",
    $config->paths->lib . "less/htmx.less",
    $config->paths->templates . "less/style.less",
  ],

  /**
   *  Override Less variables...
   *  @example ["global-font-family" => $system->font_family]
   */
  "less_vars" => [
    "wk-font" => "Jost, Sans Serif",
    "wk-font-base" => "Jost, Sans Serif",
  ],

  ...

]);

If you want to use wirekit less compiler "manually", you can do so:

"blue", ]; // helper is global variable in wirekit $helper->less($less_files, $less_vars, "output-file-name");">
$less_files = [
  "my_file_1.less",
  "my_file_2.less",
];

$less_vars = [
  "wk-bg-prmary" => "blue",
];

// helper is global variable in wirekit
$helper->less($less_files, $less_vars, "output-file-name");

scss

When usign scss preprocessor, you need to create style.scss file in /templates/scss/ folder, and it will be automatically picked up by the parser. All files and folders in /templates/scss/ will be tracked for changes, so parser will run only if there is a change detected. There is nothing to define in _init.php setting() for the scss compiler, except to set the preprocessor option to scss:

"scss", // less or scss ... ]);">
setting([
  "preprocessor" => "scss", // less or scss
  ...
]);

If you want to use wirekit less compiler "manually", you can do so:

paths->templates}scss/", "style.scss");">
$helper->scss($folder, $file_name);
$helper->scss("{$config->paths->templates}scss/", "style.scss");

head() and foot()

Each page needs to have header and footer, right!? As wirekit is using direct output method, we need to add them manually to each template file. To make it easier and more flexible, wirekit have head() and foot() functions for this purpose. Template file:






This will be the output:

">

  
    
   
    
   

In head() function we can add js and css files to be included in the , but also we can specify/override meta tags for our pages.

"css_file_url.css", "js" => "js_file_url.js", "meta" => [...] ]); ?> ">
 "css_file_url.css",
  "js" => "js_file_url.js",
  "meta" => [...]
]); 
?>




Meta

WireKit has simple way of managing meta tags. You can define defaults in _init.php setting() function, but can also set meta tags individually for each page in head() function.

[ "title" => $page->title, "description" => $sanitizer->truncate($page->body, 150), "image" => !empty($page->img) ? $page->img->url : "", "generator" => "wirekit.dev", ], ... ]);">
setting([
  ...

  /**
   *  Meta Tags
   *  Set default meta tags here
   */
  "meta" => [
    "title" => $page->title,
    "description" => $sanitizer->truncate($page->body, 150),
    "image" => !empty($page->img) ? $page->img->url : "",
    "generator" => "wirekit.dev",
  ],

  ...
]);

Override/set meta tags in template file:

[ "title" => !empty($page->headline) ? $page->headline : $page->title, "description" => $sanitizer->truncate($page->text, 150), "image" => !empty($page->cover) ? $page->cover->url : "", ] ]); ">
head([
  "meta" => [
    "title" => !empty($page->headline) ? $page->headline : $page->title,
    "description" => $sanitizer->truncate($page->text, 150),
    "image" => !empty($page->cover) ? $page->cover->url : "",
  ]
]); 

HTMX

HTMX (htmx.org) is the first class citizen in wirekit. It's used for SPA like navigation, rendering dynamic content etc... It's a very powerful tool, easy and real joy to use, it fits perfect into wirekit "html first" idea and workflow...
Wirekit uses "layouts" as reusable components, and they are exposed at the htmx end-point by default on /system/htmx/. This way you can fetch any content, any time, anywhere using simple htmx request with any html element. Example:
hx-get="/system/htmx/layout/product/card/"
or
hx-get="url ?>layout/product/card/"
This will call for /templates/layout/product/card.php file. And this way we can for example lazy load product card using htmx... More about htmx integration will be in the docs.

Ajax

All front-end logic in wirekit is imagined to be handled with ajax. Wirekit provides /system/ajax/ end-point where you can send request and handle your logic. For example:
Http request to /system/ajax/contact/ will call for /templates/ajax/contact.php file. This way you can create unlimited number of end-points, some can be just json responses, some business logic, up to you...
Up to two url segments are suported for now: /ajax/file-name/ and /ajax/folder/file-name/.
Simple fetch request:


In /tempates/ajax/text.php

"success", "message" => "Ajax test is OK", "id" => $input->get->id ]; header('Content-type: application/json'); echo json_encode($response); exit();">
 "success",
  "message" => "Ajax test is OK",
  "id" => $input->get->id
];

header('Content-type: application/json');
echo json_encode($response);

exit();

WireKit UI

Wirekit UI is minimal css/less library used in WireKit Core by default. It is a work in progress, and im planing to work on it more in the future. It's mostly utility classes with flex and grid that can help you build quick layouts and prototypes. More about it will be avalable in official docs, for now if you are interested, take a look at /vendor/lib/wkui-dev/ folder and this example

What's next?

I will continue working on this project, and have many ideas for it, but no timeline and road map for now. Definitly first on the list is official wirekit website and documentation.

Here's some ideas:

  • WireKit PRO
  • UIkit Starter
  • Boostrap Starter
  • Customizer for UIkit, WireKit UI and/or other framworks. To manage colors/fonts/backgrounds/ etc... from the admin UI
  • User management on front-end. Login, registration, user profile
  • UI Library. One click install layouts, pages, structured content etc...
You might also like...
Utilities for the Contentful Rich Text

rich-text.php This library is built to help you with the parsing and rendering of the rich text field type in Contentful. It requires PHP 7.2 and up o

This package is considered feature-complete, and is now in security-only maintenance mode

laminas-soap This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering

Issue trackers, feature requests, and translation for all of my NamelessMC products
Issue trackers, feature requests, and translation for all of my NamelessMC products

NamelessMC Products In this repository you can find current issues for each of my NamelessMC products, progress on solving them, feature requests, and

A PHP implementation of the Unleash protocol aka Feature Flags in GitLab.

A PHP implementation of the Unleash protocol aka Feature Flags in GitLab. This implementation conforms to the official Unleash standards and implement

Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.

Switchover Laravel Integration Switchover Switchover is a Software-As-A-Service for managing feature toggles (aka switches, flags or feature flips) in

EmoteSimple is a Feature or API for PocketMine-MP 4.0+

EmoteSimple EmoteSimple is a Feature or API for PocketMine-MP 4.0+ Permission This feature next update.. Support You can use minecraft bedrock profile

WordPress Feature Project: Plugin Dependencies

WordPress Feature Project: Plugin Dependencies Contributors: afragen, costdev Description: Parses 'Requires Plugins' header, add plugin install depend

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.

Admidio Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it

Doogle is a search engine and web crawler which can search indexed websites and images
Doogle is a search engine and web crawler which can search indexed websites and images

Doogle Doogle is a search engine and web crawler which can search indexed websites and images, and then use keywords to be searched later. Written pri

Comments
  • Config salt fixation + possible credential leakage in _dev.php

    Config salt fixation + possible credential leakage in _dev.php

    @kreativan Hi, just stumbled on this repo and wanted to say thank you for creating it. I've taken a quick look around and created a couple of PRs to flag up what might be small issues.

    The config file has a fixed salt. I'm not sure if PW regenerates the salt on initial installation or if your code does elsewhere? Also, there might be a little credential leakage in one of the files too - but again, I'm not sure.

    Thanks again.

    opened by netcarver 1
  • Media svg() function style attribute output

    Media svg() function style attribute output

    It would be nice to be able to support SVGs with aspect ratios where the width != height more easily.

    Whilst we can add a "style" option, which will override the "size" option, the size option is still inserted into the svg's style attribute:

    <?php svg('name', ['style' => 'width:200px;height:100px']) ?>
    

    Leads to a style attribute as follows:

    style="width:28px;height:28px; width:200px;height:100px"
    
    opened by netcarver 0
Releases(v0.0.3-alpha)
Owner
Ivan Milincic
Web Developer
Ivan Milincic
Lightning Fast, Minimalist PHP User Agent String Parser.

Lightning Fast, Minimalist PHP User Agent String Parser.

Jesse Donat 523 Dec 21, 2022
A Symfony Feature Flag Bundle which easily allows you to configure and use your favorite feature flag provider.

Metro Markets FF Metro Markets FF is a Feature Flag Symfony Bundle. It easily allows you to configure and use your favorite feature flag provider. Ins

METRO Markets 14 May 23, 2022
Demo of symfony/console features to build rich command line utilities

Symfony Console Demo This project is a demonstration of symfony/console features. To run the project with Docker. With bash: docker build -t myconsole

Jérôme Tamarelle 3 Jun 16, 2022
Demo Silverstripe and JavaScript sources for Lightning Talk "FormField Mini Apps" at StripeCon EU 2022

Watch the Lightning Talk on Youtube ?? Demo repository for Lightning Talk "FormField Mini Apps with the JavaScript framework/lib/style of your choice"

Julian Scheuchenzuber 2 Sep 20, 2022
Provides Bitcoin-Lightning payment gateway powered by Strike

Bitcoin Payments - Powered by Strike Drupal module to allow user to pay with bitcoin on your Commerce website using Strike API. Strike Js is used for

Rahul Bile 2 Apr 17, 2022
Manifest is a ProcessWire module that bridges between Twig and Webpack.

Manifest is a ProcessWire module that bridges between Twig and Webpack.

Rudy Affandi 4 Nov 12, 2022
Migrations module for ProcessWire

ProcessDbMigrate Introduction This module is designed to ease the problem of migrating database changes from one PW environment to another.

Mark Evens 9 Nov 3, 2022
A measurement field for ProcessWire

Fieldtype Measurement This fieldtype allows a measurement unit to be stored with a corresponding measurement value ('magnitude'). The relevant details

Mark Evens 2 Aug 6, 2022
Multi-language field export/import tool for ProcessWire

Language field export/import for ProcessWire Typically the way you translate page field values in ProcessWire is to edit a page, view the text in one

Ryan Cramer 3 Aug 19, 2022
RRR makes structured data for WordPress really rich, and really easy.

Really Rich Results - JSON-LD Structured Data (Google Rich Results) for WordPress Search engines are putting more weight on structured data than ever

Pagely 22 Dec 1, 2022