<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saad Ahmed</title>
    <description>The latest articles on DEV Community by Saad Ahmed (@saad_ahmed_69441a812d950d).</description>
    <link>https://dev.to/saad_ahmed_69441a812d950d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4213815%2Fa0ebf774-4cb7-4bc7-ac24-19b1199eb70a.jpg</url>
      <title>DEV Community: Saad Ahmed</title>
      <link>https://dev.to/saad_ahmed_69441a812d950d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saad_ahmed_69441a812d950d"/>
    <language>en</language>
    <item>
      <title>Introducing Corevia 2.0 — A Modular PHP Runtime and Full-Stack Framework</title>
      <dc:creator>Saad Ahmed</dc:creator>
      <pubDate>Wed, 28 Oct 2026 20:13:53 +0000</pubDate>
      <link>https://dev.to/saad_ahmed_69441a812d950d/introducing-corevia-20-a-modular-php-runtime-and-full-stack-framework-4jl1</link>
      <guid>https://dev.to/saad_ahmed_69441a812d950d/introducing-corevia-20-a-modular-php-runtime-and-full-stack-framework-4jl1</guid>
      <description>&lt;p&gt;I've been working on Corevia, an open-source PHP framework and application runtime designed around modular applications, durable workflows, isolated failures, realtime communication, and cross-language interoperability.&lt;/p&gt;

&lt;p&gt;Today, I'm making Corevia 2.0 publicly available.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/corevia-framework/corevia" rel="noopener noreferrer"&gt;https://github.com/corevia-framework/corevia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Corevia requires PHP 8.2+, and its PHP core has no mandatory third-party runtime dependencies.&lt;/p&gt;

&lt;p&gt;You don't need Node.js, Python, Redis, a message broker, Docker, or even a database just to start an application.&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/corevia-framework/corevia.git" rel="noopener noreferrer"&gt;https://github.com/corevia-framework/corevia.git&lt;/a&gt; myapp&lt;br&gt;
cd myapp&lt;/p&gt;

&lt;p&gt;composer install&lt;br&gt;
php corevia serve&lt;/p&gt;

&lt;p&gt;Then open:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://127.0.0.1:8081" rel="noopener noreferrer"&gt;http://127.0.0.1:8081&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's enough to run the database-free starter application.&lt;/p&gt;

&lt;p&gt;Why build another PHP framework?&lt;/p&gt;

&lt;p&gt;That's probably the first reasonable question.&lt;/p&gt;

&lt;p&gt;Corevia isn't intended to replace every existing PHP framework or compete by providing another variation of MVC.&lt;/p&gt;

&lt;p&gt;The project started around a different question:&lt;/p&gt;

&lt;p&gt;What if workflows, failure handling, idempotency, realtime communication, modular boundaries, and external workers were first-class runtime concepts instead of application-specific plumbing?&lt;/p&gt;

&lt;p&gt;A lot of applications eventually need things like:&lt;/p&gt;

&lt;p&gt;multi-step business processes&lt;/p&gt;

&lt;p&gt;retries&lt;/p&gt;

&lt;p&gt;partial failure handling&lt;/p&gt;

&lt;p&gt;idempotent operations&lt;/p&gt;

&lt;p&gt;background or remote execution&lt;/p&gt;

&lt;p&gt;realtime updates&lt;/p&gt;

&lt;p&gt;service/module isolation&lt;/p&gt;

&lt;p&gt;external workers&lt;/p&gt;

&lt;p&gt;execution tracing&lt;/p&gt;

&lt;p&gt;These often get implemented separately at the application level.&lt;/p&gt;

&lt;p&gt;Corevia attempts to provide a consistent runtime model for them.&lt;/p&gt;

&lt;p&gt;Actions, Modules and Flows&lt;/p&gt;

&lt;p&gt;The main runtime concepts are intentionally explicit.&lt;/p&gt;

&lt;p&gt;An Action performs a unit of work.&lt;/p&gt;

&lt;p&gt;A Module owns and exposes actions and flows.&lt;/p&gt;

&lt;p&gt;A Flow coordinates multiple actions.&lt;/p&gt;

&lt;p&gt;A minimal example looks like this:&lt;/p&gt;

&lt;p&gt;use Corevia\Core{&lt;br&gt;
    Corevia,&lt;br&gt;
    Action,&lt;br&gt;
    ExecutionContext,&lt;br&gt;
    State,&lt;br&gt;
    Flow,&lt;br&gt;
    Module,&lt;br&gt;
    ModuleContext&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;final class Increment implements Action&lt;br&gt;
{&lt;br&gt;
    public function handle(&lt;br&gt;
        State $state,&lt;br&gt;
        ExecutionContext $context&lt;br&gt;
    ): State {&lt;br&gt;
        $state-&amp;gt;data['count'] =&lt;br&gt;
            ($state-&amp;gt;data['count'] ?? 0) + 1;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    return $state;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;final class CounterModule implements Module&lt;br&gt;
{&lt;br&gt;
    public function name(): string&lt;br&gt;
    {&lt;br&gt;
        return 'counter';&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function dependencies(): array
{
    return [];
}

public function register(ModuleContext $context): void
{
    $context-&amp;gt;actions([
        'counter.increment' =&amp;gt; Increment::class,
    ]);

    $context-&amp;gt;flows([
        Flow::define('count')
            -&amp;gt;step('counter.increment')
            -&amp;gt;critical(),
    ]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;$app = Corevia::create(basePath: &lt;strong&gt;DIR&lt;/strong&gt;);&lt;/p&gt;

&lt;p&gt;$app-&amp;gt;modules([&lt;br&gt;
    CounterModule::class,&lt;br&gt;
]);&lt;/p&gt;

&lt;p&gt;$app-&amp;gt;boot();&lt;/p&gt;

&lt;p&gt;$result = $app-&amp;gt;run(&lt;br&gt;
    'count',&lt;br&gt;
    ['count' =&amp;gt; 0],&lt;br&gt;
    key: 'operation-1'&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Modules explicitly declare their dependencies.&lt;/p&gt;

&lt;p&gt;A flow can only execute actions owned by its module or by dependencies it has explicitly declared.&lt;/p&gt;

&lt;p&gt;This makes module boundaries part of the runtime rather than just a directory convention.&lt;/p&gt;

&lt;p&gt;Durable workflows&lt;/p&gt;

&lt;p&gt;Corevia flows can express behavior such as:&lt;/p&gt;

&lt;p&gt;Flow::define('checkout')&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt;step('cart.validate')
-&amp;gt;critical()

-&amp;gt;step('payment.charge')
-&amp;gt;critical()
-&amp;gt;retry(
    2,
    delayMs: 100,
    exponential: true
)

-&amp;gt;step('email.send')
-&amp;gt;nonCritical()
-&amp;gt;retry(5)

-&amp;gt;step('audit.write')
-&amp;gt;when(
    fn (State $state) =&amp;gt;
        $state-&amp;gt;data['audit'] ?? false
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;A failed critical step stops the flow.&lt;/p&gt;

&lt;p&gt;A failed non-critical step can allow later steps to continue.&lt;/p&gt;

&lt;p&gt;Flows can retain information including:&lt;/p&gt;

&lt;p&gt;execution state&lt;/p&gt;

&lt;p&gt;step status&lt;/p&gt;

&lt;p&gt;timing&lt;/p&gt;

&lt;p&gt;retry attempts&lt;/p&gt;

&lt;p&gt;errors&lt;/p&gt;

&lt;p&gt;trace IDs&lt;/p&gt;

&lt;p&gt;request IDs&lt;/p&gt;

&lt;p&gt;timestamps&lt;/p&gt;

&lt;p&gt;Corevia 2.0 also adds support for concepts such as:&lt;/p&gt;

&lt;p&gt;durable pause and resume&lt;/p&gt;

&lt;p&gt;human or event checkpoints&lt;/p&gt;

&lt;p&gt;retry policies&lt;/p&gt;

&lt;p&gt;compensation&lt;/p&gt;

&lt;p&gt;execution timelines&lt;/p&gt;

&lt;p&gt;output contracts&lt;/p&gt;

&lt;p&gt;This is intended for processes where simply throwing an exception and restarting the whole request isn't enough.&lt;/p&gt;

&lt;p&gt;Idempotency is part of the runtime&lt;/p&gt;

&lt;p&gt;Flows can be executed with an idempotency key:&lt;/p&gt;

&lt;p&gt;$result = $app-&amp;gt;run(&lt;br&gt;
    'checkout',&lt;br&gt;
    $input,&lt;br&gt;
    key: 'checkout-123'&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;Submitting the same flow and input with the same key can return the existing run instead of duplicating the operation.&lt;/p&gt;

&lt;p&gt;If the input changes while reusing the same key, Corevia can report an idempotency conflict.&lt;/p&gt;

&lt;p&gt;This becomes particularly useful around operations such as:&lt;/p&gt;

&lt;p&gt;payments&lt;/p&gt;

&lt;p&gt;order creation&lt;/p&gt;

&lt;p&gt;external APIs&lt;/p&gt;

&lt;p&gt;webhooks&lt;/p&gt;

&lt;p&gt;retries&lt;/p&gt;

&lt;p&gt;distributed requests&lt;/p&gt;

&lt;p&gt;Actions can also derive operation-specific keys for protecting side effects.&lt;/p&gt;

&lt;p&gt;Failure isolation&lt;/p&gt;

&lt;p&gt;One of the design goals of Corevia is that one broken module should not necessarily take down unrelated healthy modules.&lt;/p&gt;

&lt;p&gt;Module registration is explicit and isolated.&lt;/p&gt;

&lt;p&gt;The runtime can detect problems such as:&lt;/p&gt;

&lt;p&gt;missing dependencies&lt;/p&gt;

&lt;p&gt;disabled dependencies&lt;/p&gt;

&lt;p&gt;dependency cycles&lt;/p&gt;

&lt;p&gt;duplicate identifiers&lt;/p&gt;

&lt;p&gt;duplicate public names&lt;/p&gt;

&lt;p&gt;while allowing unrelated modules to continue booting where possible.&lt;/p&gt;

&lt;p&gt;Realtime communication&lt;/p&gt;

&lt;p&gt;Corevia includes its own realtime layer with WebSocket support.&lt;/p&gt;

&lt;p&gt;You can start it separately:&lt;/p&gt;

&lt;p&gt;php corevia realtime:start&lt;/p&gt;

&lt;p&gt;and run the HTTP application with:&lt;/p&gt;

&lt;p&gt;php corevia serve&lt;/p&gt;

&lt;p&gt;The runtime supports concepts including:&lt;/p&gt;

&lt;p&gt;public channels&lt;/p&gt;

&lt;p&gt;private channels&lt;/p&gt;

&lt;p&gt;presence channels&lt;/p&gt;

&lt;p&gt;authorization&lt;/p&gt;

&lt;p&gt;heartbeat handling&lt;/p&gt;

&lt;p&gt;reconnection metadata&lt;/p&gt;

&lt;p&gt;rooms&lt;/p&gt;

&lt;p&gt;authenticated local IPC&lt;/p&gt;

&lt;p&gt;Realtime execution stays separate from PHP-FPM or the normal HTTP process.&lt;/p&gt;

&lt;p&gt;PHP communicating with other runtimes&lt;/p&gt;

&lt;p&gt;Corevia also includes CVP, its protocol layer for communication between runtimes.&lt;/p&gt;

&lt;p&gt;For example, a PHP application can invoke an action implemented in a Python worker.&lt;/p&gt;

&lt;p&gt;A worker can expose an action like:&lt;/p&gt;

&lt;p&gt;from corevia import Worker&lt;/p&gt;

&lt;p&gt;worker = Worker(&lt;br&gt;
    '&lt;a href="http://127.0.0.1:8090" rel="noopener noreferrer"&gt;http://127.0.0.1:8090&lt;/a&gt;',&lt;br&gt;
    token='development-shared-secret'&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/worker"&gt;@worker&lt;/a&gt;.action('ai.analyze')&lt;br&gt;
def analyze(payload):&lt;br&gt;
    return {&lt;br&gt;
        'characters': len(payload['text'])&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;worker.run()&lt;/p&gt;

&lt;p&gt;The PHP runtime can then invoke the remote action through Corevia rather than requiring the Python implementation to become part of the PHP process.&lt;/p&gt;

&lt;p&gt;Corevia currently includes protocol support and SDK work across:&lt;/p&gt;

&lt;p&gt;PHP&lt;/p&gt;

&lt;p&gt;JavaScript&lt;/p&gt;

&lt;p&gt;Python&lt;/p&gt;

&lt;p&gt;Dart&lt;/p&gt;

&lt;p&gt;There is also thin integration for React and React Native.&lt;/p&gt;

&lt;p&gt;Database support without making a database mandatory&lt;/p&gt;

&lt;p&gt;A database is not required to boot the Corevia starter.&lt;/p&gt;

&lt;p&gt;When persistence is needed, Corevia 2.0 includes support for named PDO connections including:&lt;/p&gt;

&lt;p&gt;MySQL / MariaDB&lt;/p&gt;

&lt;p&gt;PostgreSQL&lt;/p&gt;

&lt;p&gt;SQLite&lt;/p&gt;

&lt;p&gt;There are also optional connectors for:&lt;/p&gt;

&lt;p&gt;MongoDB&lt;/p&gt;

&lt;p&gt;local JSON document storage&lt;/p&gt;

&lt;p&gt;The runtime and persistence layers remain separated so the core doesn't directly depend on PDO or a specific database implementation.&lt;/p&gt;

&lt;p&gt;Corevia can also behave like a normal web framework&lt;/p&gt;

&lt;p&gt;V2 includes a web application layer with familiar concepts:&lt;/p&gt;

&lt;p&gt;app/&lt;br&gt;
routes/web.php&lt;br&gt;
resources/views/&lt;br&gt;
public/assets/&lt;br&gt;
config/settings/&lt;/p&gt;

&lt;p&gt;The web layer includes functionality such as:&lt;/p&gt;

&lt;p&gt;routing&lt;/p&gt;

&lt;p&gt;controllers&lt;/p&gt;

&lt;p&gt;middleware&lt;/p&gt;

&lt;p&gt;named routes&lt;/p&gt;

&lt;p&gt;route groups&lt;/p&gt;

&lt;p&gt;constraints&lt;/p&gt;

&lt;p&gt;redirects&lt;/p&gt;

&lt;p&gt;resource routes&lt;/p&gt;

&lt;p&gt;PHP views&lt;/p&gt;

&lt;p&gt;signed CSRF forms&lt;/p&gt;

&lt;p&gt;So Corevia isn't limited to workflow execution or backend services.&lt;/p&gt;

&lt;p&gt;It can also host the application using those runtime capabilities.&lt;/p&gt;

&lt;p&gt;CLI tooling&lt;/p&gt;

&lt;p&gt;Corevia includes a CLI for development and runtime inspection.&lt;/p&gt;

&lt;p&gt;Some available commands include:&lt;/p&gt;

&lt;p&gt;php corevia serve&lt;/p&gt;

&lt;p&gt;php corevia doctor&lt;/p&gt;

&lt;p&gt;php corevia modules&lt;/p&gt;

&lt;p&gt;php corevia routes&lt;/p&gt;

&lt;p&gt;php corevia flow:list&lt;/p&gt;

&lt;p&gt;php corevia flow:run checkout \&lt;br&gt;
    --input=examples/checkout.json \&lt;br&gt;
    --key=demo-checkout&lt;/p&gt;

&lt;p&gt;php corevia flow:show &lt;/p&gt;

&lt;p&gt;php corevia flow:retry  &lt;/p&gt;

&lt;p&gt;php corevia realtime:start&lt;/p&gt;

&lt;p&gt;php corevia realtime:stop&lt;/p&gt;

&lt;p&gt;php corevia make:module Example&lt;/p&gt;

&lt;p&gt;php corevia make:action Example&lt;/p&gt;

&lt;p&gt;php corevia make:flow Example&lt;/p&gt;

&lt;p&gt;The goal is to make runtime behavior inspectable rather than hiding everything behind application code.&lt;/p&gt;

&lt;p&gt;Architecture&lt;/p&gt;

&lt;p&gt;At a high level:&lt;/p&gt;

&lt;p&gt;HTTP / CLI / event / scheduled invocation&lt;br&gt;
                 |&lt;br&gt;
                 v&lt;br&gt;
          Module Registry&lt;br&gt;
                 |&lt;br&gt;
                 v&lt;br&gt;
            Flow Engine&lt;br&gt;
                 |&lt;br&gt;
                 v&lt;br&gt;
           Action Runner&lt;br&gt;
                 |&lt;br&gt;
                 v&lt;br&gt;
         Explicit Result&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Flow Engine
         |
         v
      RunStore

    Action Runner
         |
         v
    EventBus Contract
         |
         v
 Realtime Broadcaster
         |
         v
   WebSocket Clients
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Remote runtimes can connect through CVP:&lt;/p&gt;

&lt;p&gt;PHP Runtime&lt;br&gt;
    |&lt;br&gt;
    | CVP&lt;br&gt;
    v&lt;br&gt;
Python Worker&lt;/p&gt;

&lt;p&gt;JavaScript / React Native&lt;br&gt;
    |&lt;br&gt;
    | HTTP + WebSocket&lt;br&gt;
    v&lt;br&gt;
Corevia&lt;/p&gt;

&lt;p&gt;No mandatory infrastructure just to get started&lt;/p&gt;

&lt;p&gt;One thing I wanted to keep deliberate was the initial dependency footprint.&lt;/p&gt;

&lt;p&gt;The basic PHP runtime does not require:&lt;/p&gt;

&lt;p&gt;Database   -&amp;gt; No&lt;br&gt;
Redis      -&amp;gt; No&lt;br&gt;
Node.js    -&amp;gt; No&lt;br&gt;
Python     -&amp;gt; No&lt;br&gt;
Broker     -&amp;gt; No&lt;br&gt;
Docker     -&amp;gt; No&lt;/p&gt;

&lt;p&gt;Start with PHP.&lt;/p&gt;

&lt;p&gt;Add infrastructure when the application actually requires it.&lt;/p&gt;

&lt;p&gt;Testing&lt;/p&gt;

&lt;p&gt;The project includes automated testing across:&lt;/p&gt;

&lt;p&gt;PHP 8.2&lt;br&gt;
PHP 8.3&lt;br&gt;
PHP 8.4&lt;/p&gt;

&lt;p&gt;It also includes integration coverage involving:&lt;/p&gt;

&lt;p&gt;HTTP&lt;/p&gt;

&lt;p&gt;WebSockets&lt;/p&gt;

&lt;p&gt;PHP/Python workers&lt;/p&gt;

&lt;p&gt;SDK contracts&lt;/p&gt;

&lt;p&gt;idempotency&lt;/p&gt;

&lt;p&gt;failure handling&lt;/p&gt;

&lt;p&gt;reconnect behavior&lt;/p&gt;

&lt;p&gt;MySQL&lt;/p&gt;

&lt;p&gt;PostgreSQL&lt;/p&gt;

&lt;p&gt;MongoDB&lt;/p&gt;

&lt;p&gt;database-free execution&lt;/p&gt;

&lt;p&gt;Current status&lt;/p&gt;

&lt;p&gt;Corevia 2.0.0 is the current stable V2 release.&lt;/p&gt;

&lt;p&gt;V1 remains available through the v1.0.0 tag.&lt;/p&gt;

&lt;p&gt;There are still intentional boundaries.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;some in-process deadlines are cooperative&lt;/p&gt;

&lt;p&gt;offline realtime events aren't replayed automatically&lt;/p&gt;

&lt;p&gt;external pub/sub requires an adapter&lt;/p&gt;

&lt;p&gt;some single-node facilities require external infrastructure when scaling horizontally&lt;/p&gt;

&lt;p&gt;I prefer documenting those limits rather than pretending the framework magically solves distributed systems.&lt;/p&gt;

&lt;p&gt;Also, the packages have not yet been published to Packagist, npm, PyPI or Dart package registries.&lt;/p&gt;

&lt;p&gt;For now, Corevia is installed directly from the repository/source.&lt;/p&gt;

&lt;p&gt;Open source&lt;/p&gt;

&lt;p&gt;Corevia is released under the MIT License.&lt;/p&gt;

&lt;p&gt;The repository includes documentation covering the kernel, flows, web layer, databases, protocol, deployment, migration, and contribution process.&lt;/p&gt;

&lt;p&gt;If you work with PHP and any of these areas interest you:&lt;/p&gt;

&lt;p&gt;workflow engines&lt;/p&gt;

&lt;p&gt;modular architecture&lt;/p&gt;

&lt;p&gt;resilient applications&lt;/p&gt;

&lt;p&gt;realtime systems&lt;/p&gt;

&lt;p&gt;distributed application runtimes&lt;/p&gt;

&lt;p&gt;PHP/Python interoperability&lt;/p&gt;

&lt;p&gt;framework internals&lt;/p&gt;

&lt;p&gt;I'd genuinely like technical feedback.&lt;/p&gt;

&lt;p&gt;Especially criticism.&lt;/p&gt;

&lt;p&gt;If something in the architecture looks unnecessary, unsafe, overly complicated, or could be expressed in a better PHP-native way, I'd like to hear it.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/corevia-framework/corevia" rel="noopener noreferrer"&gt;https://github.com/corevia-framework/corevia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Issues, discussions, tests, documentation improvements, and contributions are welcome.&lt;/p&gt;

&lt;p&gt;Corevia 2.0&lt;/p&gt;

&lt;p&gt;Build modular applications. Keep failures explicit. Connect runtimes when you need them.&lt;/p&gt;

</description>
      <category>php</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
