Introduction to FOSSBilling
Relevant source files
The following files were used as context for generating this wiki page:
FOSSBilling is a free and open-source billing and client management solution specifically designed for online service providers, such as web hosting businesses, software licensing firms, and digital download stores. It provides a comprehensive platform for automating invoicing, payment processing, and client communication within a modular and extensible framework.
Sources: README.md:16-19, AGENTS.md:6-10
The project is built using modern PHP standards and a decoupled frontend architecture, allowing for high customizability through themes and modules. It aims to modernize legacy billing software by providing a cleaner codebase, professional governance, and a community-driven development model.
Sources: AGENTS.md:12-15, GOVERNANCE.md:7-14
Core Technical Stack
FOSSBilling utilizes a robust stack of backend and frontend technologies to ensure performance and maintainability.
Backend Technologies
The backend is powered by PHP 8.3+ and leverages several industry-standard libraries:
- Symfony Components: Used for core functionalities including Console, Cache, Filesystem, and HTTP Client.
- Twig: The primary template engine for rendering admin, client, and email views.
- Doctrine DBAL/ORM: The modern standard for database interactions, currently replacing legacy RedBeanPHP implementations.
- Monolog: Handles logging through the
$di['logger']service. - Pimple: Acts as the Dependency Injection (DI) container, configured in
src/di.php.
Sources: AGENTS.md:17-48, composer.json:44-84
Frontend Technologies
The frontend avoids heavy frameworks like jQuery in favor of modern vanilla JavaScript (ES6+) and optimized CSS:
- Tabler.io & Bootstrap 5: Provide the UI framework for admin and client themes.
- esbuild: Used as a fast bundler and minifier for JavaScript and CSS assets.
- Sass: CSS preprocessing for theme styles.
Sources: AGENTS.md:53-70, package.json:34-42
Application Architecture
The project follows a modular architecture where the core logic is separated from specific business functionalities implemented as modules.
High-Level Architecture Flow
This diagram illustrates the request lifecycle from the web server through the FOSSBilling loader to the response.
The application lifecycle begins in src/load.php, which handles environment checks, paths, and initialization of the DI container.
Sources: src/load.php:143-294, AGENTS.md:91-105
Directory Structure
| Path | Description |
|---|---|
src/library/ | Core application logic and internal libraries. |
src/modules/ | Modular components (50+ modules) extending functionality. |
src/themes/ | UI templates and assets for Admin and Client areas. |
src/public/ | Publicly accessible assets, branding, and gateway icons. |
src/data/ | Runtime data including cache, logs, and user uploads. |
frontend/ | Source code for core frontend tools and esbuild helpers. |
| Sources: AGENTS.md:94-106, src/load.php:191-209 |
Module System
FOSSBilling is built on a "module-first" philosophy. Functionality is categorized into two primary types of modules.
Module Categories
- Service Modules: Represent specific products available for sale (e.g.,
Servicehosting,Servicedownloadable). These manage product-specific configurations and actions. - Extension Modules: General-purpose modules that extend the FOSSBilling API with custom logic or integrations.
Sources: CONTRIBUTING.md:77-90, AGENTS.md:96-100
Diagram showing how both Service and Extension modules interact with the Core API and Event system.
Sources: CONTRIBUTING.md:88-90, src/modules/Support/Service.php:97-154
API and Frontend Interaction
FOSSBilling provides a seamless way to interact with the backend via Twig injections and a dedicated JavaScript wrapper.
Twig API Injection
Data can be read directly in Twig templates without AJAX calls using injected roles:
guest: Always available for public data.client: Available when a client is authenticated.admin: Available when a staff member is authenticated.
Example:{{ admin.support_ticket_get_list({ 'status': 'active' }) }}
Sources: AGENTS.md:139-147
JavaScript API Wrapper
For state-changing operations (POST, PUT, DELETE), the application uses a JS wrapper located in frontend/core/api.js.
Sequence diagram of the JavaScript API interaction, highlighting CSRF protection and role-based namespacing.
Sources: frontend/core/api.js:154-203, AGENTS.md:148-152
Governance and Community
The project is governed by a Steering Committee (SC) and a group of Maintainers. Decisions are primarily made through Lazy Consensus, where a proposal is accepted if no objections are raised within 5-7 days.
Sources: GOVERNANCE.md:71-74, GOVERNANCE.md:113-117
- Steering Committee: Responsible for long-term health and sustainability.
- Maintainers: Trusted contributors who review code, triage issues, and improve documentation.
- Transparency: All non-sensitive discussions occur in public GitHub issues or Discord channels.
Sources: GOVERNANCE.md:46-60, GOVERNANCE.md:85-92
Installation Requirements
| Requirement | Minimum Version / Detail |
|---|---|
| PHP | 8.3 or higher |
| Database | MySQL or MariaDB 10.11+ |
| Required Extensions | curl, intl, mbstring, openssl, pdo_mysql, xml, dom, gd, zlib |
| Web Server | Apache (with mod_rewrite) or Nginx |
| Sources: src/library/FOSSBilling/Requirements.php:23-35, AGENTS.md:73-81, src/install/install.php:260-265 |
Conclusion
FOSSBilling represents a modern, modular approach to billing and client management. By utilizing a dependency-injected PHP backend and a lean vanilla JavaScript frontend, it offers developers a flexible platform for building online service businesses. Its governance model ensures transparency and project longevity, while the module-based architecture allows for virtually unlimited extensibility.
Sources: README.md:21-30, AGENTS.md:173-181