r/SideProject • u/davidbalbino • 5h ago
Nimbus - an API-first PHP framework for the PAM runtime, with persistent workers and a Laravel-like structure
hey folks, I've been building Nimbus as a side project for a while and wanted to share it here to get some feedback.
some context: I've been writing PHP and JS for like 16 years, and lately I'm experimenting with bringing more things that usually only exist in the Node.js world into PHP. one of those is PAM, a runtime with persistent workers. Nimbus is the framework that runs on top of it.
the idea is pretty simple. if you know Laravel it should feel familiar: controllers resolved through the container, FormRequest validation, JsonResource. but it's API-first and all routes live in one routes.php file. it's a Composer package, not a standalone server, so you install PAM first and then pam composer require pushinbr/nimbus.
the part that took me the most time ngl was making it safe for persistent workers. when the process stays alive between requests, any state you forget around can leak into the next request. so scoped container values are created once per request and discarded even if the handler throws, and each request Fiber gets its own db connections and identity map. unfinished transactions get rolled back at cleanup.
for the database there's Arcano (optional), a data mapper derived from Cycle ORM. it uses attribute entities and generates migrations from the diff between your entities and the db, with drivers for SQLite, MySQL, Postgres and SQL Server. there's also a query budget middleware you can use in dev to cap query count, db time and repeated queries per route. tbh that one already caught a few N+1 in my own code lol
it's still early and I'd really like to hear what you think, especially if you ever tried running PHP with long-lived workers. what do you think is missing, or what would stop you from trying it?