Osm Admin: GitPod
2 years ago ∙ 2 minutes read
I waited for this day too long. Today, I've tried out GitPod, and made it work for a project based on Osm Admin.
2 years ago ∙ 2 minutes read
I waited for this day too long. Today, I've tried out GitPod, and made it work for a project based on Osm Admin.
2 years ago ∙ 2 minutes read
Today, I reiterated on what's left in this iteration, and finished the side menu view, and created a trivial home page for the admin area.
2 years ago ∙ 2 minutes read
After getting the main branch all-green (tests pass, CLI and UI works as expected), I decided that from now on, I'll keep it always green, and use feature branches for all major development.
Then, I started implementing the main menu of the admin area.
2 years ago ∙ 1 minute read
Yesterday, I created a template for new projects powered by Osm Admin.
This way, you can create and publish a project in minutes, just follow the README
. Yay!
2 years ago ∙ 5 minutes read
Implemented in Osm Admin:
2 years ago ∙ 4 minutes read
This time, I tackled adding an explicit property to an existing table, and then making it non-nullable.
It raised the need for data conversions - additional handling of the existing data - or otherwise, the database engine fails, or the data becomes invalid.
And it made me split migrations in two parts - the one that runs before the data conversion, and the other one that runs afterwards.
2 years ago ∙ 3 minutes read
While working on diff algorithm I noticed a certain pattern that I use over an over again.
Using this pattern, I implemented notification table diff.
Finally, I rearranged diff/migration code for better code readability.
2 years ago ∙ 3 minutes read
Yesterday, I moved the table creation code into new schema diff migration engine.
Now, working on notification table migrations.
2 years ago ∙ 2 minutes read
This time:
2 years ago ∙ 1 minute read
Before digging into property diff algorithm, let's dig into how exactly it's used, and what other property-related logic is there.
2 years ago ∙ 2 minutes read
Yesterday, I continued working on schema migrations:
2 years ago ∙ 2 minutes read
After a system update, I've got some problem with my laptop, and one thing to check was system log files.
This got me thinking: what makes a good log for my own application? And I think that application logs are as useful as they are able to answer potential questions I may have when an application is in production.
Let's think what kind of questions I might have, and what information might be useful to answer them.
2 years ago ∙ 4 minutes read
Recently, I fixed numerous issues to make the first migration tests work.
Then, I started implementing the schema diff algorithm - the basis for schema migrations.
2 years ago ∙ 1 minute read
More dots got connected in the schema migration design, see this post for details.
Then, I tried to return to TDDing it, but strange errors met me there, so I left them to be resolved in the next piece.
2 years ago ∙ 2 minutes read
Schema migrations are going to be generated and executed automatically under gulp watch
. It will result in lots of tiny migrations: add a column, change its type, make it not nullable, and so on.
It's convenient during development, but it might be not optimal to reapply in production. Indeed, it's better to convert a large table to new structure all at once rather than running a conversion for each of the tiny migration.
This observation contradicts the previously stated migration workflow, so let's update it.
2 years ago ∙ 4 minutes read
In spirit of TDD, I started with a meaningful, but failing test that is reasonably fast. Then, I worked to make it green:
2 years ago ∙ 1 minute read
After drafting some ideas of how the schema migrations should actually work, let's start implementing it in TDD way.
2 years ago ∙ 3 minutes read
The goal of the current iteration is to adjust the database schema and preserve/convert existing data according to any changes in schema classes, grids, forms or indexers.
This post presents some thoughts how it might work with class definitions.
2 years ago ∙ 2 minutes read
After finishing the iteration "#17 Minimum UI", I revisited the goals and the scope of the minimum viable product, and picked the most pressing task for the next iteration - "#18 Database Schema Changes".
2 years ago ∙ 1 minute read
I implemented the last user action that is typical to a CRUD application - object deletion.
2 years ago ∙ 3 minutes read
Done:
INSERT INTO ... SELECT ...
statements2 years ago ∙ 1 minute read
Yesterday, I identified the need to have some syntax in a formula query to join a notification table.
I'm still working on new Query::joinInsertNotifications()
and Query::joinUpdateNotifications()
methods.
2 years ago ∙ 2 minutes read
I wanted to implement incremental indexing in one go.
Not so quick.
I hit some major roadblocks, and I'm working on removing them, one by one.
2 years ago ∙ 2 minutes read
Yesterday, indexers started listening to query inserted
, updated
and deleted
notifications and creating records in notification tables.
Now, saving a product complains:
Table 'admin2.zi9__products__inserts' doesn't exist
Fair enough. Let's create it.
2 years ago ∙ 4 minutes read
Yesterday results:
POST /create
route handles the input of new object form.2 years ago ∙ 3 minutes read
I've got a little more organized, then fixed an error in selecting all products, and implemented filtered URL generation in the browser.
2 years ago ∙ 1 minute read
A list of references to the most useful blog posts about Osm Admin and Osm Framework. One day, they'll be a part of the official documentation.
2 years ago ∙ 1 minute read
Progress messages stopped working, and I fixed that. Then, I implemented a safety measure that prevent accidental deletion (or other operations) on all objects.
2 years ago ∙ 3 minutes read
In Osm Admin, I've finished implementing editing behavior of input and select controls.
For other control types, a step-by-step guide is prepared.
2 years ago ∙ 3 minutes read
In Osm Admin, object editing form is used not only for a single object editing, but also for editing multiple objects, and for creating a new object.
I also created the osmphp/extras
package as an easy way of adding Font Awesome icons to a project. Later, I'll add more optional reusable goodies to this package.
2 years ago ∙ 2 minutes read
On the list page, grid columns are implemented as control views. On the editing page, form fields are also implemented as control views.
The form Blade templates are completely migrated to Osm Admin v0.2
.
2 years ago ∙ 1 minute read
I redesigned control rendering on list and edit pages. From now, a control contains view prototypes for a grid column, a form field, and other.
2 years ago ∙ 2 minutes read
After getting the list page to work, I returned to the editing page.
Done:
2 years ago ∙ 3 minutes read
Yesterday, I polished the product color
facet, and, starting now, you can create a facet with a list of string options very quickly, just by marking a property as #[Faceted]
.
/**
* @property string $color #[Option(Color::class), Faceted]
*/
class Product extends Record
{
2 years ago ∙ 2 minutes read
In the product editing form, I implemented the id
filter, and made the UI query work in database-only mode, too.
2 years ago ∙ 4 minutes read
Three days ago, I started rendering faceted navigation, and namely, color
facet on the product list page.
Yesterday, I continued working on it and got the first render of the faceted navigation, defined URL action syntax, and the first facet filter applied on the product list page.
2 years ago ∙ 1 minute read
Yesterday, I optimized search responses, made search hit limit explicit, and decided not to obfuscate ID in URL.
2 years ago ∙ 1 minute read
In my opinion, obfuscating object ID in a URL is not worth the effort, and here is why.
2 years ago ∙ 4 minutes read
My current goal is a minimum list page, a form page and a faceted navigation for a Product
data class.
Today, I've:
2 years ago ∙ 5 minutes read
Today, I finished indexing design, described typical indexing logic, implemented full search reindexing.
2 years ago ∙ 6 minutes read
Starting today, I'll write a daily blog post about how the Osm Admin development goes.
This is the first one. It reviews where I am today, covers creation of a search index, and revisits the design of the indexing engine and how queries orchestrate the indexing.
2 years ago ∙ 3 minutes read
I came with an idea of much cleaner Osm Admin data class "markup", and more straightforward architecture, and I decided to give it a go in a separate experimental branch v0.2
, and to see if it's viable.
After three weeks of implementation effort, I can say that it is viable, and it's so much better! And it's not a completely new effort, I mostly copy code from v0.1
and some parts of osmphp/framework:old_v4
, and adapt it.
You can already define data classes using new markup, generate the database tables, and query it using new formula syntax. I really wanted to come with some UI working, but there wasn't enough time for that. It stays my priority for the next iteration.
2 years ago ∙ 2 minutes read
My current goal is to get some minimum Osm Admin user interface and API working - just for one property, one data type, one UI control type, and then improve.
And there is a lot of space for improvement. The main areas are listed in this document.
I'd really appreciate a helping hand, so if you are into this sort of things, DM me on Twitter.
2 years ago ∙ 4 minutes read
I feel that both attributes decorating data classes, and object model parsed from it are too complex.
Let's have a fresh look at Osm Admin. If I had to start from scratch, how would it be?
2 years ago ∙ 2 minutes read
In Osm Admin, I've finished indexing. It means that whenever you modify an object in the database, the changes are automatically propagated to all dependent indexed properties in the database.
I've also introduced a grid/form pair as the main user interface concept that is optimized for performing operations on multiple objects. There is also a programming interface (API) that will internally work in the same way, but without visuals. I implemented a part of this interface - an object creation form.
Osm Framework and all projects built with it - including this website and Osm Admin - are upgraded to TailwindCSS 3.0.
2 years ago ∙ 2 minutes read
Today, I finished implementing an object creation form.
It works according to the specs on Interfaces and Forms. Currently, it only supports string and integer input fields; later, there will be a lot more.
Let's review how it works.
2 years ago ∙ 3 minutes read
In Osm Admin, a form is an integral part of the class user interface. It's a very specific kind of HTML form.
In this article, I'll review what's in a class form, and how it's reflected from the application code.
2 years ago ∙ 2 minutes read
Yesterday, I described a user interface pattern for managing data of a certain data class using a grid/form pair. Let's call this grid/form pair class interface in the admin
area.
In this article, I'll examine what moving parts are inside a class interface.
2 years ago ∙ 1 minute read
So far, I've been concerned about how application data is modeled, stored and handled internally.
Yet, the final objective a user interface for viewing and editing it visually.
Let's dream a bit about how it might look like.
2 years ago ∙ 5 minutes read
Yay, indexing works!
It's changed quite a bit, so let's review how it works from the very beginning.
2 years ago ∙ 3 minutes read
For the last two weeks, I figured out two core features that will allow Osm Admin to stand out from other CRUD applications:
The foundation for the mass editing feature is data queries. Data propagation will be ensured via indexing.
I've been working on the Osm Admin indexing engine, and it's still in progress. While working on it, I reworked the inner working of data queries. Finally, I've achieved a very clear separation of various Osm Admin concerns, and documented it.
In Osm Core, I added reflection over class methods.
2 years ago ∙ 1 minute read
I'm still working on indexing, and it seems to get one more refactoring. But more on that later.
Meanwhile, let's review Osm Admin modules, their responsibilities and dependencies.
2 years ago ∙ 3 minutes read
After 3 days of intensive work, I've got dot syntax working!
Along the way, I refactored the query internals once again, which reminds me a heuristics saying that you've got to implement something three times to get it right :)
New query implementation uses the concept of formulas - SQL-like expressions used for selecting, filtering and sorting data. Currently, formulas are quite limited, but with time, they should be a really powerful feature.
2 years ago ∙ 1 minute read
I decided to support selecting, filtering and ordering by properties of a related object using dot syntax: product.price
, parent.level
. This syntax will automatically join the table that stored related objects.
I realized that implementing joins requires a better query model than my current naive wrapper around Laravel query. This article describes the new query model.
2 years ago ∙ 2 minutes read
This article is about running SELECT and INSERT queries on data objects stored in the database.
In short, use the query()
function. It runs on top of Laravel Query\Builder
. It handles the mapping of data class properties onto table columns, and initiates the computation of indexed properties.
Currently, you can only SELECT and INSERT, other operations are coming soon.
2 years ago ∙ 3 minutes read
Today, I implemented computation of indexed properties during insert. The implementation dictated some changes in indexed property definitions compare to the initial design, and how indexers are reflected into the data schema.
Also, I implemented a table query class working on the top of Laravel Query\Builder
. More about it next time, for now I'll review how indexed properties are computed during INSERT operation.
2 years ago ∙ 3 minutes read
I had two weeks full of meaningful, productive work. I started with sketching Osm Admin grid and form pages, and implemented a very basic, but working home page, and success/error messages. To enable that, Osm Framework now have extensible Blade templates, and a nice JavaScript solution for capturing user input into a modal dialog box, or into some picker component.
Then, I undertook a major refactoring of Osm Admin, including moving lots of pieces of code to their new places, stabilizing the underlying object model, rewriting database migrations and sketching future effort on data indexing. During this effort, I implemented generic object hydration and reflection over named subtypes.
I've already shared most of this information on Twitter, so if you are reading this, consider following me on Twitter and getting daily updates.
2 years ago ∙ 3 minutes read
It's often needed to compute, or index, data in database tables based on data in other tables.
This article is the first sketch of a consistent indexing solution.
2 years ago ∙ 3 minutes read
I've finished refactoring how Osm Admin stores data objects in the database. Also, in order to support multi-website, multi-vendor, multi-language applications, I've introduced the concept of scopes.
Most reasoning from the first version is still valid, so let's take a fresh look of what's changed.
2 years ago ∙ 3 minutes read
I developed dehydrate()/hydrate()
functions for a very practical need - storing the data class schema:
This article describes the information stored in the schema, and unit tests that I prepared in order to be sure that schema classes are property hydrated.
2 years ago ∙ 2 minutes read
I had two very productive weeks. #buildinpublic works wonders.
Most effort went into my new project, Osm Admin. I sketched how data classes look like, generated database tables from class attributes, and started working on the Admin UI. It's very fulfilling to see how an abstract idea gains shape.
2 years ago ∙ 1 minute read
As described in Migrations, most data objects of the same class will be stored in a database table.
But what about subclasses? In an e-commerce application, bags, dresses, and digital products, collectively known as subclasses, are all products stored in products
table, and they may have bad-specific, dress-specific or digital product specific properties that should also be stored there.
This article describes how subclasses are defined and stored in Osm Admin.
2 years ago ∙ 1 minute read
Different data classes have repeating structural patterns. For example, most data classes stored in database tables have the auto-incremented id
property. Use PHP traits to effectively introduce the same properties to different data classes over and over again.
2 years ago ∙ 2 minutes read
I partly implemented data schema migration. It takes data class definitions, and incrementally creates or alters underlying database tables.
The article below describes how schema migration works, and what's not implemented yet, but most probably will be.
Note. This topic is continued in the new article.
3 years ago ∙ 2 minutes read
The project repository, osmphp/admin
, follows a typical Osm Framework-based project structure. However, this repository is going to be a reusable Composer package, and has important structural differences presented in this article.
3 years ago ∙ 2 minutes read
This article introduces the core project concepts: data object, data class, data query, and data schema.
3 years ago ∙ 1 minute read
I'm super-excited to announce that I'm starting a new project codenamed "The Big Red Button". It's about defining application data structures and logic in PHP code, pressing the big red button (hence the codename), and getting fully functioning Admin Panel and API.
3 years ago ∙ 1 minute read
This sprint was dedicated to writing Osm Framework documentation, and indeed, there are 8 new in-depth documentation articles, 4-5 minutes long each.
Despite documentation focus, I kept improving the website. From now on, you can assign a canonical URL to a blog post or a documentation page, and use GitHub friendly relative URLs in documentation.
But the most important thing - I started sharing progress and insights daily on Twitter.
3 years ago ∙ 4 minutes read
osm.software
website. From now on, Osm Framework documentation resides in the docs/
directory of the osmphp/framework
repository, and it is displayed in a separate section of osm.software
website. New data source indexing engine allows running complex interdependent data synchronization with a single command, osm index
. New Placeholder
class simplifies dynamic Markdown content generation.
Osm Framework. Apply dynamic traits within the same file using #[UseIn]
attribute. Implement fast dynamic routing using new DynamicRoute
class. Generate URLs using new $osm_app->base_url
property.
3 years ago ∙ 2 minutes read
This website got a completely new look. There are new blog posts diving into core Osm Framework features. Osm Framework itself offers more convenient page layout, website-wide header, footer and <head>
, customizable error pages. The themes support theme-specific CSS styles and JS scripts not bound to any module. New projects come with a handy bin/install.sh
script that simplifies installation on Linux. From now on, run osmh
without any parameters.
3 years ago ∙ 2 minutes read
From now on, this website is deployed on push, and by the way, you can easily play with the website copy locally. In the Osm framework, new Osm_Project
application allows reflecting over modules and classes regardless to which application they belong. New experimental project is aimed at quick creation of the Admin UI.
3 years ago ∙ 3 minutes read
New Osm Framework version comes with improved, configurable and easily
customizable Gulp script, modular NPM dependencies, standard page layout Blade
component and brand new README
. osm.software website
contains an easy-to-follow new project installation instruction.
3 years ago ∙ 1 minute read
The first osm.software blog articles have been written, edited and revised. Content changes are deployed in semi-automated way. The website got some SEO improvements, and now it scores 100% in Google Lighthouse.
3 years ago ∙ 1 minute read
Osm Framework introduced production mode and maintenance mode. osm.software website went live.
3 years ago ∙ 1 minute read
Osm Framework introduced JS controllers, and JS unit tests. osmcommerce.com website project was renamed to osm.software, it finalized the post rendering, and introduced a tool for checking broken links.
3 years ago ∙ 2 minutes read
osmcommerce.com (now osm.software) blog got multi-select layered navigation, category management, FontAwesome icons, Tailwind CSS Typography. Osm Core allows debugging accidental assignments of the computed properties.