syntaxerrorllc / stromite
Adds a combination of Entity driven objects and configurable Workflows to deliver a uniquely customizable application
Requires
- php: ^8.2
- illuminate/support: ^11
Requires (Dev)
- orchestra/testbench: ^9
- phpunit/phpunit: ^11
This package is not auto-updated.
Last update: 2025-03-11 15:04:15 UTC
README
WORK IN PROGRESS - Recomended for demo purposes only.
This package adds a new way of thinking about Models and Functional Workflows. I intend to have companion package Stromite Filament that will add easy UI configuration using the Filament package.
High Level Concepts
Package Terminology:
- Entity
- Entity Type
- Entity Versions
- Settings
- Workflow
- Action
- Node
- Edge
- Instance
Entities
Often times while developing new projects it can be hard to know what the final form of your Models will be. It may be easier to not have to deal with migrations and DB edits. Stromite aims to help prototype faster by alleviating this headache.
Enter the Entity/Setting structure. A set of Models that are preconfigured to allow a developer to create dynamic "Entity Types".
Pretend that an "Entity Type" is synonymous with a "Laravel Model" or "DB Table".
For example, we'll create a new EntityType called "Movie"
Now typically you'd create a migration and add the columns/properties you think you'll need. In Stromite terms we will call these "Settings". Any named datapoint you want to associate with your entity type.
For example, let's say that our "Movie" will need the following fields: "Title", "Release Year", "Genre". We will create "Settings" for these three fields and attach them to our "Entity Type"
Now we have an equivalent table for "Movies" with the settings we now have our equivalent to columns. But we don't actually have any Rows of data.
To add Movies, we must create an instance of an Entity of Type "Movie" and fill in the allowed settings. This can be repeated as many times as needed to build your complete dataset.
Workflows
Workflows are a little harder to explain without the UI editor the Filament Package will have. Regardless, they will work without an editor so I included it here.
In simplest terms a Workflow is a collection/ordering of functions you would like to call on a specific Entity Type.
The functions themselves are contained within a class called an "Action" these actions are stored in the DB so once you create the actual file you'll need to register it in the DB before a Workflow can use it.
Example: Stromite ships with an Action that can be used to set a entity setting within a workflow. See setEntitySeting.
This provides a structure to setup something like Lego blocks of code that can be combined in any way within a workflow so that an end user can design their own business logic without needing to know how the black box works.
For instance, as a developer you can create an Action "SendEmail" that will send an email using the "EmailAddress" setting on whatever entity is passed in, with a parameter to set the email theme and any fillable details. Then an end user could create a workflow called "Send Welcome Email" and the add the Actions "SendEmail" then chain a "setEntitySetting" Action at the end to update a setting on the entity called "WelcomeEmailSent" = True. Then someone without any coding experience just effectively wrote a simple controller action.
If you have a library of these Actions then the possibilities for customizations are endless.
Installation
You can install the package via composer:
composer require syntaxerrorllc/stromite
Usage
// Usage description here
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email admin@syntaxerror-llc.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.