📄️ Controller
Controllers in Serapha handle HTTP requests and generate responses. They act as the intermediary between the client and the backend logic.
📄️ Service
Services in Serapha encapsulate business logic and operations, providing a clean and organized way to interact with models and handle application logic. They are designed to be used by controllers and can manage multiple models if needed.
📄️ Model
Models in Serapha handle the data layer of your application, encapsulating the logic for creating, reading, updating, and deleting records in the database. They are designed to be used by services, providing a clean and organized way to interact with your database.
📄️ Middleware
Middleware in Serapha allows you to filter and manipulate HTTP requests entering your application. They are commonly used for tasks such as authentication, logging, and request modification.
📄️ Provider
In Serapha, Providers are used to register and manage shared services and resources within your application. These services can include, but are not limited to, database connections, caching systems, configuration managers, etc. Providers allow you to easily inject these resources into other parts of the application such as Controllers and Services.
📄️ Routing
Routing in Serapha maps URLs to specific controllers and actions. It allows you to define how different URL paths should be handled by your application.
📄️ View
Views in Serapha handle the presentation layer of your application. They are responsible for rendering the HTML output that is sent to the client's browser. Serapha uses a template engine to facilitate flexible and efficient template rendering. You can find more examples and use cases of this template engine at TemplateEngine.
📄️ Rewrite Rule
To optimize your URLs for better readability and SEO purposes, you can transform URLs of the format example.com/public/?/user/123 to example.com/user/123. Below are the necessary rewrite rules for both Nginx and Apache servers.