Why Extend FacturaScripts?
FacturaScripts is a powerful open-source ERP and accounting software designed with extensibility at its core. Built in PHP, it provides a robust foundation for business management while allowing developers to customize and extend functionality through its plugin architecture.Key Benefits for Developers
Plugin Architecture
Create modular extensions without modifying core code. Plugins are isolated, version-controlled, and can be distributed independently.
MVC Pattern
Clean separation of concerns with Models, Views (Twig templates), and Controllers makes code maintainable and testable.
Database Abstraction
Support for MySQL and PostgreSQL with automatic schema management and migrations handled by the framework.
Modern PHP
Built with PHP 8.1+, leveraging namespaces, traits, and modern object-oriented programming practices.
What You Can Build
FacturaScripts’ extensibility allows you to create:- Custom Controllers: Add new pages and administrative interfaces
- Models: Extend the data layer with new business entities
- API Endpoints: Build RESTful APIs for integrations
- Business Logic: Implement custom calculations, workflows, and automation
- UI Components: Create reusable widgets and form elements
- Reports: Generate custom PDF documents and exports
- Integrations: Connect with external services and third-party APIs
Development Philosophy
FacturaScripts follows these core principles:1. Plugin-Based Extensions
The core system remains untouched. All customizations happen in plugins located in the/Plugins directory. This ensures:
- Easy updates without losing custom code
- Modular development and testing
- Distribution and reuse across installations
2. Dynamic Loading
The framework uses a “Dinamic” layer that merges core functionality with plugin overrides:Dinamic folder is automatically generated during deployment and combines:
- Core classes from
/Core - Plugin extensions from
/Plugins/{PluginName}
3. Convention Over Configuration
FacturaScripts uses naming conventions to reduce boilerplate:- Controllers in
/Controllerdirectory - Models in
/Modeldirectory - Views in
/Viewdirectory - Tables named after model classes (e.g.,
Clientemodel →clientestable)
Request Lifecycle Overview
Understanding the request flow is crucial for development:Kernel Initialization
Kernel::init() sets up constants, loads language, registers workers, and prepares the environment.Core Technologies
FacturaScripts is built with:| Technology | Purpose |
|---|---|
| PHP 8.1+ | Backend language |
| MySQL / PostgreSQL | Database layer |
| Twig | Template engine for views |
| Composer | Dependency management |
| PSR-4 | Autoloading standard |
Development Requirements
Before starting development, ensure you have:System Requirements
System Requirements
- PHP 8.1 or higher
- MySQL 5.7+ or PostgreSQL 9.6+
- Composer (for dependencies)
- Web server (Apache/Nginx)
- Git (recommended for version control)
PHP Extensions
PHP Extensions
- curl
- gd
- intl
- mbstring
- pdo_mysql or pdo_pgsql
- xml
- zip
Development Tools
Development Tools
- Code editor (VS Code, PHPStorm recommended)
- Xdebug (for debugging)
- PHPUnit (for testing)
- Browser developer tools
Project Structure
Understanding the directory layout:Next Steps
System Architecture
Learn about the MVC pattern, core components, and how the framework operates.
Development Setup
Set up your development environment and create your first plugin.
Creating Plugins
Build your first plugin from scratch with step-by-step guidance.
API Reference
Explore the complete API documentation for core classes.
Community and Support
Join the FacturaScripts developer community:- GitHub: https://github.com/NeoRazorX/facturascripts
- Documentation: Official docs and guides
- Forum: Community support and discussions
- Issues: Bug reports and feature requests

