Introduction
Since I started working with RESTful architectures, I realized that the front-end and back-end can be sharply isolated from each other. When I saw that both sides had their own workloads, I began looking for solutions to minimize the load on the web side of the back-end.
After working in areas such as corporate, individual, blog, forum, and e-commerce, PHP had taken a back seat for me on the web side. Because moving forward with JavaScript and only manipulating the incoming data made my job easier, just like for every developer.
Therefore, I developed a model on the PHP side that only outputs the data and presents it to the web side.
Solution
I can't describe the excitement of implementing this model for the first time with PHP. Today, I want to talk about an open-source project that I developed based on this model and the RESTful API architecture.
The main thing I wanted to do was build a system based on certain core modules. These modules act as the foundational building blocks for the project. Although the system consists of different parts, these parts communicate with each other through common components, working together as a single cohesive module.
This structure allows each module to operate independently within its responsibility area while enabling integration and collaboration with other modules when needed. Thus, modularity and flexibility are ensured throughout the project. Each module performs a specific function and works in harmony with other modules using a common infrastructure.
This model serves as a bridge between package programming and the project. If we operated solely on the principle of package programming, we would handle all parts separately and in isolation. However, in this model, each module can be developed independently and can also work integratively with other modules.
I establish a logic-based, rather than code-based, relationship between any project developed with OOP programming. When I base this principle, the areas that should be present in a system can be listed as follows:
Components of the System
→ Error Management
Error management should be done both on the client side and the server side. This part, one of the most important topics, is not a standard in many projects. Error management should be sharply divided into front-end and back-end parts.
→ Localization Management
Providing multi-language support on all dynamic parts of the system. Developing the system with a language infrastructure from the ground up allows it to behave according to both single and multiple languages.
→ Module Management
Preparing the infrastructure for the modules used in the system and building the modules to be developed on this infrastructure.
→ Database Management
Ensuring database management based on OOP and integrating it within modular structures throughout the system.
→ Option Management
The most used parts of a system are the customizable features. Increasing and grouping the optional areas and managing them from a single place.
→ Setting Management
Creating a default settings mechanism.
→ Input and Context Management
Input and context areas mainly concern request and response topics, involving the processing of the request mechanism received from the front-end based on the REST API architecture.
Conclusion
As a result, a PHP project that processes requests based on files has emerged :) With the current method and controller structure, I aim to handle all incoming HTTP requests on the server side as desired.
Although it does not yet provide all features, I developed a slim version of an API project. You can access the details and documentation of the project below.
Github Repository - UltraFastApi - Ultra Fast API Based on PHP
🔥 Comments