I made a PHP framework with AI capabilities.
The most important features: - Built on top of Swoole extension to support asynchronous features. - Opinionated, all-in-one solution for building web applications, particularly SaaS (it is not a boilerplate, though). - Integrates with llama.cpp to serve responses from open-source LLMs. - Uses minimal configuration and extensively relies on metaprogramming (binding related classes with attributes) and other in-language metadata. - Focused on providing easy integrations with different services (it has built-in OpenAPI schema, gRPC, and other tools to help with that). - Performant, optimized for memory management.
The future of PHP lies in Fibers, Coroutines, and libraries like Swoole. PHP is easier to maintain in certain scenarios and performs better than Node.js or Python (especially combined with Swoole). For example, it has transparent asynchronous features, and because of its stateless nature by design, it's great for things like AWS Lambda.
FAQ:
- How is it different from Hyperf or Symfony?
I built Resonance on top of Hyperf and Symfony components. I added all the features on top of those and provided a coherent experience based on class attributes and metaprogramming. It has a unique dependency injection container designed to maintain read-only class instances wherever possible so as not to overburden the garbage collector.
- What can I build with it?
Currently, I am building a conversational app builder with the framework. I designed Resonance to be able to both easily integrate with external APIs (including streaming ones, like the ones LLMs have) and to make it easy to integrate with Resonance (you can expose OpenAPI spec, and it has a built-in GraphQL and WebSocket servers, etc.).