avoutic/web-framework

web-framework is a secure-by-default PHP framework for quickly making PHP sites and APIs

8.4.1 2024-11-04 10:05 UTC

README

Welcome to the WebFramework documentation. WebFramework is an add-on framework built on top of the Slim Framework, designed to provide a cohesive set of services around database management, caching, authentication, and middleware. Unlike traditional MVC frameworks, WebFramework follows the Model-Action-Responder (MAR) pattern, which influences where logic is located within your application.

Overview

WebFramework applications typically have the following directory structure:

  • actions: Contains files for each endpoint and related API functions.
  • config: Contains the configuration files for the application.
  • db_scheme: Contains the database migrations for the application.
  • definitions: Contains the PHP-DI definitions for the application.
  • htdocs: The location for the core index.php and external static files like images, CSS, and JavaScript.
  • scripts: Contains scripts for tasks, migrations, and other automation tasks.
  • src: Contains the core application/business logic and model files.
  • templates: Contains the templates used by the actions.
  • tests: Contains the tests for the application.
  • translations: Contains the translation files for the application.

Documentation Contents

This documentation is organized into several sections, each focusing on a specific aspect of WebFramework. Click on the links below to explore each section in detail:

  • Installation Guide: Instructions for installing WebFramework and setting up a base project.
  • Migration Guide: Guidance on migrating between different versions of WebFramework.
  • Configuration Management: How to manage and access configuration settings in your application.
  • Dependency Injection: How to use and configure dependency injection in WebFramework.
  • Database Usage: How to interact with the database, including executing queries and managing transactions.
  • Database Migrations: How to manage database schema changes using the DatabaseManager.
  • Entities and Repositories: Understanding the Entity and Repository pattern in WebFramework.
  • Creating New Entities: Step-by-step guide to creating new entities and repositories.
  • Input Validation: How to add input validation to your actions using the InputValidationService.
  • Routing: How to set up and manage routes in your WebFramework application.
  • Middleware Management: How to define and use middleware to process requests and responses.
  • Sanity Checks: How to use the sanity check system to ensure your application environment is correct.
  • Tasks: How to create and run tasks from the command line.
  • Templating: How to use the Latte templating engine to render templates.
  • Translations: How to deploy and configure multi-lingual support in your application.
  • Emitting Responses: How to generate responses in actions using the ResponseEmitter or via exceptions.
  • Caching: How to use caching to store and retrieve data efficiently.

Getting Started

To get started with WebFramework, follow the Installation Guide to set up your project. Once installed, explore the documentation to learn how to leverage the full capabilities of WebFramework in your application.

For any questions or further assistance, please refer to the documentation or reach out to the WebFramework community.

Happy coding!