Osm Admin: Stopping The Project
2 years ago ∙ 2 minutes read
I stopped working on the Osm Admin project, for financial reasons. Did it hurt? A lot. Was it necessary? Unfortunately, yes. This post is a short retrospection on this matter.
2 years ago ∙ 2 minutes read
I stopped working on the Osm Admin project, for financial reasons. Did it hurt? A lot. Was it necessary? Unfortunately, yes. This post is a short retrospection on this matter.
2 years ago ∙ 1 minute read
2 years ago ∙ 1 minute read
2 years ago ∙ 1 minute read
2 years ago ∙ 1 minute read
Before diving into what should be in the docs, let's define what you should more or less know before using Osm Admin.
There are four types of people who will read the docs: power users, developers, vendors and contributors.
2 years ago ∙ 1 minute read
Here are my thoughts on product backlog and roadmap.
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 ∙ 1 minute read
Yesterday, I tested the instructions for installing Osm Admin locally as a contributor.
2 years ago ∙ 2 minutes read
Yesterday:
git push
.2 years ago ∙ 2 minutes read
Yesterday started as usual, planning new iteration, and then BAM! - one folk - Saif - joined the project. It made me correct the course a bit, and take care of potential contributors:
README
explains what the project is about, and how to get started as a contributor;2 years ago ∙ 3 minutes read
Yay! After implementing invalid data conversion, I finished the iteration #18 dedicated to diff-based migrations!
2 years ago ∙ 4 minutes read
I must say, it's a bit disturbing to implement the same thing for the third time. Still, the goal is to get it finished, and have it sustainable.
After the effort, the code has become su much easier to read!
2 years ago ∙ 1 minute read
I continued working on property diff algorithm that plans all the migration details.
2 years ago ∙ 3 minutes read
Yesterday, I finished implementing data conversion for int
and string
property types.
Then, I started refactoring it.
2 years ago ∙ 1 minute read
Last time, I pushed through string
property migrations and created a migration log.
Today, I continued solving data conversion issues.
2 years ago ∙ 4 minutes read
string
property migrations.2 years ago ∙ 3 minutes read
Yesterday, I finished writing int
property migrations. True, testing it is still a todo.
The major part of the code (type change, nullability and other attribute handling) will be reused in other property types.
2 years ago ∙ 3 minutes read
I refactored Property::migrate()
using additional Migration
classes. It's so much more convenient to compare property definition versions and generate migration SQLs!
New code structure already handles property explicitness changes.
2 years ago ∙ 7 minutes read
After enumerating what kind of changes can happen to a property, I started implementing the most hard one - changing property type.
2 years ago ∙ 3 minutes read
The Query::bulkUpdate()
method is implemented in the TDD way.
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
Last two weeks were about implementing initial version of an Osm Admin grid, integrating it seamlessly with the editing form, and enabling mass-editing of multiple objects.
After finishing it, I realized that Osm Admin had become bigger than Osm Framework! To keep up, I started writing docs for it.
And now, you have a step-by-step guide for creating a project, adding Osm Admin to it and a practical example of an admin area that you can copy to your project and try it out locally.
2 years ago ∙ 2 minutes read
Recently, I implemented mass-editing in Osm Admin. It allows you to view and edit multiple objects in a single operation.
This article describes mass-editing of products in a typical e-commerce application.
2 years ago ∙ 3 minutes read
The last 4 weeks were mostly a vacation. It's been a time for reflection, but still, I delivered some new features.
In Osm Admin, forms already allow creating new objects and saving them to the database, and editing one or several existing objects.
I've also implemented URL query filters that are applied to the underlying database query and that can be displayed in the user interface.
From now on, Osm Framework and all projects built with it - can be installed and developed under Apache and on Windows.
2 years ago ∙ 3 minutes read
In the user interface, you can narrow displayed data using grid column filters, or filters displayed in the sidebar. To enable that, apply #[Filter\*]
attributes to class properties.
Applied filters appear in the URL query parameters, for example, .../edit?id=5+16+19
, and on the page.
You can apply filters not only to a grid page, but also to a form page - to mass edit all matching objects, or to an action URL (edit, delete, or custom) - to perform the action on all matching objects.
In the same way, you can apply filters to the API URLs in order to retrieve or modify matching objects in a script.
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.