Giter VIP home page Giter VIP logo

webengine's Introduction

Rapid development engine.

PHP.Gt logo

Welcome to PHP.Gt webengine โ€” an application development toolkit aimed at streamlining development and respecting web technologies.

Web frameworks offer many features, but often come with steep learning curves or imposing rules. The motivation behind this project is the belief that what a framework can offer can be achieved by eliminating code rather than adding more.

Head over to the Github Wiki for documentation.


PHP.Gt build status PHP.Gt code coverage PHP.Gt code quality PHP.Gt Composer version PHP.Gt download stats PHP.Gt Website

Features at a glance

  • Simple routing: A page's view in page.html has optional logic separated within page.php
  • Pages made dynamic via server-side DOM Document access
  • HTML templates
  • Database organisation
  • Create web pages or web services (APIs) with the same code
  • Inbuilt client side script building (SCSS, ES6, etc.)
  • Web security as standard
  • Strong separation of concerns over PHP, HTML, SQL, JavaScript, CSS
  • Preconfigured PHPUnit and Behat test environment
  • Workflow tools to quickly create, integrate and deploy projects

Essential concepts

Static first

To increase development speed and lower the barrier to getting an idea prototyped, the technique of developing a static prototype first is promoted, dropping in logic when and where necessary to turn prototypes into fully functional production code with as few steps as possible.

Build using tech you already know

The main idea is to provide a platform where you can get as much done, using standard tech you've already learnt. Technologies that make up the world wide web, such as HTML and HTTP, are respected and enhanced by bringing useful tools and techniques to you, the developer.

Drop in tools without any fuss

There are a lot of useful tools included as standard, such as SCSS parsing, HTML templating and CSRF handling, but the highly modularised architecture keeps compatibility high. Packages from Packagist can be installed and loaded with zero configuration.

Develop locally or virtually

Preconfigured scripts are available to automatically set up local servers or virtualisation environments to get you going as quickly as possible, without having to change existing computer configuration.

Community of blueprints

To get projects going with full momentum, blueprint projects are available to base your projects off. Blueprints come with just enough level of design and functionality to get a prototype out the door as quickly as possible, without prescribing anything.

Getting started

Getting started developing WebEngine applications

If you are new to WebEngine development, check out the Quick Start guide in the documentation, or jump straight into the tutorials.

Getting started contributing to WebEngine

If you are looking to contribute to WebEngine itself, please read the Contribution guidelines document.

How to get help

Submit an issue

The Github issue tracker is used to submit bug reports, feature requests or certain types of technical support requests. If you think something is not working correctly, or the documentation doesn't cover your issue, feel free to open a new issue, describing what you have tried, what you expect, and what went wrong.

Ask on Stack Overflow

If you have more of a "How do I do X in WebEngine?" question, it is preferred to ask this publically on Stack Overflow. If you tag your question with phpgt-webengine, or the area of PHP.Gt that the question referrs to, a WebEngine contributor will answer your question as soon as possible.

webengine's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar g105b avatar j4m3s avatar peter279k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

webengine's Issues

FileOrganiser & Injector bugs

All necessary information regarding what scripts and styles are used is calculated in the Injector - why do this again in the FileOrganiser?

There seems to be a few problems with the FO anyway, so having a simple copy/compile action in the Injector seems logical.

Concatenating multiple DOM attributes

$dom["a.link"]->href .= "test";

All links' href attribute will be set to the value of the last in the DomElCollection. They should concatenate each attribute with "test".

PageTool system

Implement re-usable chunks of code that can fully interact with the APIs and DOM that are outside of the PageCode. Implementing the "blog" PageTool is a separate milestone.

Directory or file style URLs

Within the config file should be a flag to declare if the application is served using directory or file URLs.

For directory style:
example.com/Index.html >301> example.com
example.com/About.html >301> example.com/About

For file style:
example.com >301> example.com/Index.html
example.com/About >301> example.com/About.html

And this must include the case-matching:
example.com/About >301> example.com/About.html

DOM element creation via CSS selector

This is an advanced feature, will be required for final release but isn't high priority.

Example:

$newDiv = $dom->create("div#newDiv.withClassName[attribute='attributeValue']");

Github wiki

The wiki needs to give a good overview of the project, with as much deployment information as is humanly possible!

Nested PageCodes

Allow nested PageCodes to all trigger, in order of their nesting.

A protected method should be added to the PageCode class to stop any further nested PageCodes from being triggered.

Translatable content

The Content PageTool requires translatable versions of text stored in the database.

Content will be stored in the default language in the database, with optional translations stored along side.

To change the website's language, either a 'special' directory should be added to the start of the URL, or a 'special' extension prefix should be added to the file name.

For example:

example.com/MyContent.html // defaults to English.
example.com/_de/MyContent.html // German version, if available. ... will set all links to 301 or 302 to the German versions.

Alternative (possibly preferred...)

example.com/MyContent.html // defaults to English.
example.com/MyContent.de.html // German version, if available ... will set all links to 301 or 302 to the German versions.

DOM auto-value function

The main DOM object needs to have a function that takes a database result or associative array and loops over all elements, assigning their values according to the assoc array's key-value-pair.

The function should also take into account different Dom element types and provide their values accordingly I.e. a textarea should have its innerText set, where as an input should have its value attribute set.

Error Pages

404 pages need creating and giving the ability to expand upon. Also, PageCodes should be able to be created for error pages, so major error pages can send out emails or other useful actions.

Error handling

All errors extend Error class, which throws Http 500 error if not declared otherwise.

URL case matching

Nice feature to "fix" mis-cased URLs by 301-redirecting them.

Examples:
example.com/index.html => example.com/Index.html
EXAMPLE.COM/TEST => example.com/test

Error handling

There are a LOT of todos in code where an error should be handled properly. Must be complete for release.

Debug bar (Xdebug)

Add debug functionality to the framework that collects xdebug output and provides a debug bar at the top of the page.

Nice treeview of call stack/declared variables, doesn't break flow of app.

Client side CMS

For the already developed PageTools, an inline CMS needs to be created.

DomElCollection OffsetSet

DomElCollection's offsetSet function should be a shorthand method to set the inner text of the items.

$dom["span#something"] = "Here is some text";

Browser's back button broken

On some pages in some projects, the back button's functionality is completely broken. Chromium browser just sits there spinning - no network activity.

May be client-side cache issue when experimenting with or the like.

Cache handler

A singleton pattern is to be used for the handling of cache:

In page code, allow singleton object for caching

$thing = new CacheObject("nameOfCache", $dataObject);

Does data object have to be serialised before caching???????

FileOrganiser copying

Directories such as Script, Style and Asset need their content copying to /Web when there is a change (all changes need to be purged). This could be done in a Linux command or via PHP.

CSS selection with context too specific

To access any element within the DOM with a class of "foo", simply $dom[".foo"] but to do the same thing with a context, it requires to specify the entire CSS nesting $el["div h1 span.foo"]

Auto deployment of database tables

  • Deployment of tables that reference other tables is not handled in all situations (see next comment).
  • Database auto deployment should complete 100%, or not at all - perform within a transaction.

Markdown

Ready for when the framework is used to drive public websites, a markdown solution needs implementing as a utility class.

Need to discuss how content should be stored in the database - html? markdown? something else?

Optional PageCode class suffix

The _PageCode part of the class name should be made optional. This means that a page called "Test.html" would have a PageCode that looks like this:

class Test extends PageCode {}

which is easier to type and remember, but if there is a page called "Explode.html", you can't have a class called "Explode" because it is a PHP function - so you can then add the _PageCode suffix again to look like this:

class Explode_PageCode extends PageCode {}

Nice.

Blog PageTool

A fully functional blog PageTool. The server-side functionality should be completed in Alpha 1, and client-side editing capabilities should be completed in Alpha 2.

Rename ambiguous Web directory

The Web directory should be renamed throughout the framework to Public - web is too ambiguous with how the projects are stored on servers.

Gt.js support for PUT and DELETE methods

This limitation was uncovered during the initial prototype design for Slingshot.

HTTP PUT for uploading files asynchronously is required to be able to handle very large (10GB+) file uploads via PHP sockets.

Gt JS reverse selector

GT(".someClass", searchElement, true)

Adding a boolean to the last parameter keeps this feature backwards compatible, but can be used to look up the tree for the given selector, rather than in the child elements.

GtJs GT.typeof

A better typeof function. Not only for better coding, but sometimes instanceof kills IE.

User PageTool updated with UUID

Because PHP's sessions expire when browsers exit, unless a user authenticates, their session is lost.

A cookie system needs to be put in place that associates a UUID to the PHP session and uses that to retrieve the correct userdata.

Auto deployment of tables

Not all insert data scripts are executed. Example in BbCrm app, Quotation::InsertData-001-Quotation_Defaults.

Make config files not required

The app, security and database files are required in the bootstrapper.

For really simple projects, it is tedious to create the files each time even if there is no need for them.

Cache linked to database triggers

Cache expiring over time is so last decade!

Expire the cache for each page depending whether certain database tables have changed!!!

GtJs DOM overloading

Overload Node, rather than Object.

At the moment, all objects have addClass, even strings...

Gt.js Array.ensure()

Can be used to ensure data is in an array.

Example:

var data = Array.ensure(fromWebservice);

fromWebservice may be an object, or an array of objects, in which case it will always be made into an array of objects after "ensuring".

Database creation order

In the database config, some properties need to be added to show what database tables need to be created and in which order.

There should be a shared and app_specific array.

All tables within the arrays are to be created, even if they are not used - this just simplifies everything a lot.

Catch-all error page

An _Error.html page that acts for any Http Error.

Placeholders (#code, #message) can be used to output the relevant HTTP code/message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.