This guide details the methodologies for modifying or replacing entire components in the Neutral TS Starter Py framework. The system is designed to allow you to take control of any aspect of the application in a modular and external way.
In this framework, a component is managed as an atomic package containing Data (Schema), Routes (Endpoints), and Interface/Logic (Snippets). Overriding a component means taking control of this unit to alter its global behavior.
The architecture allows a “new” component to overlap a “base” one, inheriting and replacing its definitions transparently but decisively.
The component folder name (e.g., cmp_0100_default) determines the hierarchy and the order in which the system processes its resources.
schema.json files and snippets are processed in ascending alphabetical order.
cmp_0100_default → Base values (loads first)
cmp_0110_default → Overrides values from cmp_0100_default
Flask Blueprints are registered in reverse alphabetical order (from the highest number to the lowest).
cmp_0200_feature → Registered 1st (Highest priority)
cmp_0100_default → Registered 2nd
cmp_9100_catch_all → Registered last (Fallback)
cmp_9* Group (Fallbacks)Components starting with cmp_9 (e.g., cmp_9100_catch_all) are always registered at the very end of the process. This makes them the system’s “last resort”, ideal for 404 error handlers or last-level routing processes.
When you need a new component to functionally replace an existing one, you have two main methods:
This is the cleanest way to “overwrite” a component while keeping the original intact.
cmp_0110_default to replace cmp_0100_default).Useful for a total break or to prevent the original component from executing residual logic.
cmp_0100_default → _cmp_0100_default). The framework ignores any folder that does not strictly start with cmp_.Sometimes you only need to adjust specific pieces without replacing the entire unit.
custom.jsonAllows overriding a component’s manifest.json and schema.json. It is the standard method for a user to customize a component without modifying its source code.
custom.json in the component root..gitignore). This ensures that component updates do not overwrite user preferences.{
"manifest": {
"route": "/my-new-route"
},
"schema": {
"data": {
"current": {
"site": {
"title": "Custom Title"
}
}
}
}
}
config.dbAllows making changes without touching files, using the custom table of the config.db database.
config.db override those in custom.json and the original manifest/schema.custom table follows the same structure as a custom.json and is applied by looking up the component’s UUID.Any key defined in a component that loads later will replace the previous one in the global schema.
// In cmp_0110_custom/schema.json
{
"data": {
"current": {
"site": {
"title": "New Site Title"
}
}
}
}
If a base component defines an interface using {:snip; name >> ... :}, you can override it by defining another snippet with the same name in any .ntpl file of a component that loads later.
For changes that only affect a specific rendering within a template:
{:locale; file.json :}: Overrides translations (schema->inherit->locale).{:data; file.json :}: Overrides inherited data (schema->inherit->data).The combination process is cumulative and deep:
null in your override schema.component-init.ntpl)component-init.ntpl files are processed at application startup.