PHPackages                             tourze/server-application-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/server-application-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/server-application-bundle
================================

服务端应用管理系统，提供应用模板、实例管理、生命周期控制等功能

0.0.1(6mo ago)00MITPHPCI passing

Since Nov 15Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/server-application-bundle)[ Packagist](https://packagist.org/packages/tourze/server-application-bundle)[ RSS](/packages/tourze-server-application-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (41)Versions (2)Used By (0)

server-application-bundle
=========================

[](#server-application-bundle)

[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![Build Status](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)](https://github.com/tourze/php-monorepo)[![Code Coverage](https://camo.githubusercontent.com/32855e94577df9d0a30995653b17d33a5fbfdf644518f96ea0374313397d19b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e)](https://github.com/tourze/php-monorepo)

[English](README.md) | [中文](README.zh-CN.md)

Server application management bundle for managing application lifecycle, deployment, and monitoring.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Core Entities](#core-entities)
- [Services](#services)
- [Admin Interface](#admin-interface)
- [Testing](#testing)
- [License](#license)

Features
--------

[](#features)

- **Application Templates**: Define reusable templates for server applications
- **Instance Management**: Create and manage application instances from templates
- **Lifecycle Management**: Track application lifecycle events (install, health check, uninstall)
- **Port Configuration**: Manage application port mappings and configurations
- **Execution Steps**: Define and track custom execution steps for deployments
- **Logging**: Comprehensive logging of all lifecycle events and operations
- **Multi-node Support**: Deploy applications across multiple server nodes

Installation
------------

[](#installation)

```
composer require tourze/server-application-bundle
```

Configuration
-------------

[](#configuration)

No additional configuration is required. The bundle auto-configures itself using Symfony's autowiring.

Usage
-----

[](#usage)

### Core Entities

[](#core-entities)

#### AppTemplate

[](#apptemplate)

Defines reusable application templates with configuration, health checks, and execution steps.

```
use ServerApplicationBundle\Entity\AppTemplate;

$template = new AppTemplate();
$template->setName('Web Server');
$template->setDescription('Nginx web server template');
$template->setImage('nginx:latest');
```

#### AppInstance

[](#appinstance)

Represents an actual instance of an application deployed from a template.

```
use ServerApplicationBundle\Entity\AppInstance;

$instance = new AppInstance();
$instance->setTemplate($template);
$instance->setName('production-web-server');
$instance->setNode($serverNode);
```

#### AppLifecycleLog

[](#applifecyclelog)

Tracks all lifecycle events and operations performed on application instances.

### Services

[](#services)

- **AppTemplateService**: Manage application templates
- **AppInstanceService**: Handle application instance operations
- **AppLifecycleLogService**: Log and query lifecycle events
- **AppPortConfigurationService**: Manage port configurations
- **AppPortMappingService**: Handle port mappings between host and container
- **AppExecutionStepService**: Manage custom execution steps

### Admin Interface

[](#admin-interface)

The bundle integrates with EasyAdmin to provide a comprehensive admin interface:

```
// Access the admin interface at /admin
// Manage templates, instances, logs, and configurations
```

### Command Line Interface

[](#command-line-interface)

```
# List all application templates
bin/console app:template:list

# Deploy an application instance
bin/console app:instance:deploy

# Check application health
bin/console app:instance:health-check
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom Execution Steps

[](#custom-execution-steps)

Create custom execution steps for complex deployment scenarios:

```
use ServerApplicationBundle\Entity\AppExecutionStep;
use ServerApplicationBundle\Enum\ExecutionStepType;

$step = new AppExecutionStep();
$step->setTemplate($template);
$step->setSequence(1);
$step->setName('Install Dependencies');
$step->setType(ExecutionStepType::COMMAND);
$step->setContent('apt-get update && apt-get install -y nginx');
$step->setWorkingDirectory('/tmp');
$step->setUseSudo(true);
$step->setTimeout(300);
$step->setRetryCount(3);
```

### Health Check Configuration

[](#health-check-configuration)

Configure health checks for your applications:

```
use ServerApplicationBundle\Entity\AppPortConfiguration;
use ServerApplicationBundle\Enum\HealthCheckType;
use ServerApplicationBundle\Enum\ProtocolType;

$portConfig = new AppPortConfiguration();
$portConfig->setTemplate($template);
$portConfig->setPort(80);
$portConfig->setProtocol(ProtocolType::TCP);
$portConfig->setHealthCheckType(HealthCheckType::TCP_CONNECT);
$portConfig->setHealthCheckInterval(60);
$portConfig->setHealthCheckTimeout(5);
$portConfig->setHealthCheckRetries(3);
```

### Environment Variables

[](#environment-variables)

Manage environment variables for your applications:

```
$template->setEnvironmentVariables([
    'NODE_ENV' => 'production',
    'PORT' => '8080',
    'DATABASE_URL' => 'mysql://user:pass@localhost/db'
]);

$instance->setEnvironmentVariables([
    'NODE_ENV' => 'production',
    'PORT' => '8080'
]);
```

### Lifecycle Event Handling

[](#lifecycle-event-handling)

Track and respond to lifecycle events:

```
use ServerApplicationBundle\Entity\AppLifecycleLog;
use ServerApplicationBundle\Enum\LifecycleActionType;
use ServerApplicationBundle\Enum\LogStatus;

$log = new AppLifecycleLog();
$log->setInstance($instance);
$log->setAction(LifecycleActionType::INSTALL);
$log->setStatus(LogStatus::SUCCESS);
$log->setMessage('Application installed successfully');
$log->setExecutionTime(45.2);
```

Architecture
------------

[](#architecture)

The bundle follows a service-oriented architecture with:

- **Entities**: Domain models for templates, instances, logs, etc.
- **Repositories**: Data access layer with custom query methods
- **Services**: Business logic layer for operations
- **Controllers**: Admin interface controllers
- **Enums**: Type-safe enumerations for statuses and types

Dependencies
------------

[](#dependencies)

- Symfony 6.4+
- PHP 8.1+
- Doctrine ORM 3.0+
- EasyAdmin Bundle 4+
- tourze/server-node-bundle
- tourze/doctrine-timestamp-bundle
- tourze/doctrine-ip-bundle
- tourze/doctrine-track-bundle
- tourze/doctrine-user-bundle

Testing
-------

[](#testing)

Run the test suite:

```
./vendor/bin/phpunit packages/server-application-bundle/tests
```

License
-------

[](#license)

MIT License. See LICENSE file for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance72

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-server-application-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-server-application-bundle/health.svg)](https://phpackages.com/packages/tourze-server-application-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
