Ein vollständiges Symfony-Bundle für das CompanyOS-System mit Plugin-Architektur, Authentifizierung, Benutzerverwaltung und API-First-Design.
**Dies ist eine Alpha-Version (0.1.152-alpha
Das CoreBundle folgt einer API-First-Architektur:
composer require companyos/core:^0.1.152-alpha
// config/bundles.php
return [
// ... andere Bundles
CompanyOS\CompanyOSCoreBundle::class => ['all' => true],
];
# config/packages/companyos_core.yaml
companyos_core:
plugin:
directories: 'custom/plugins,custom/static-plugins'
auth:
oauth2:
enabled: true
client_id: 'your-client-id'
client_secret: 'your-client-secret'
Das Plugin-System funktioniert vollständig über Services und erfordert keine Kernel-Erweiterung:
<?php
namespace MyPlugin;
use CompanyOS\Bundle\CoreBundle\Domain\Plugin\Domain\AbstractPlugin;
class MyPlugin extends AbstractPlugin
{
public function getPluginName(): string
{
return 'my-plugin';
}
public function getVersion(): string
{
return '0.1.152-alpha
}
public function getAuthor(): string
{
return 'Your Name';
}
public function getRoutes(): array
{
return [
'my_plugin_route' => '/my-route'
];
}
}
{
"name": "my/plugin",
"type": "companyos-plugin",
"autoload": {
"psr-4": {
"MyPlugin\\": "src/"
}
},
"extra": {
"companyos-plugin": {
"plugin-class": "MyPlugin\\MyPlugin"
}
}
}
POST /api/auth/login - Benutzer-LoginPOST /api/auth/refresh - Token erneuernPOST /api/auth/logout - LogoutGET /api/auth/profile - Benutzer-ProfilGET /api/users - Benutzer auflistenPOST /api/users - Benutzer erstellenGET /api/users/{id} - Benutzer abrufenPUT /api/users/{id} - Benutzer aktualisierenDELETE /api/users/{id} - Benutzer löschenGET /api/plugins - Plugins auflistenPOST /api/plugins/{name}/install - Plugin installierenPOST /api/plugins/{id}/activate - Plugin aktivierenPOST /api/plugins/{id}/deactivate - Plugin deaktivierenDELETE /api/plugins/{id} - Plugin löschenparameters:
companyos.plugin.directories: 'custom/plugins,custom/static-plugins'
companyos_core:
auth:
oauth2:
enabled: true
access_token_ttl: 3600
refresh_token_ttl: 1209600
companyos_core:
webhook:
enabled: true
max_retries: 3
timeout: 30
CompanyOSCoreBundle/
├── Domain/ # Domain-Logik (Entities, Value Objects, Events)
│ ├── Auth/Domain/
│ ├── User/Domain/
│ ├── Role/Domain/
│ ├── Plugin/Domain/
│ ├── Webhook/Domain/
│ ├── Settings/Domain/
│ └── Shared/Domain/
├── Application/ # Use Cases, Commands, Queries, DTOs
│ ├── Auth/
│ ├── User/
│ ├── Role/
│ ├── Plugin/
│ ├── Webhook/
│ ├── Settings/
│ └── Shared/
├── Infrastructure/ # Persistence, Eventing, Services
│ ├── Auth/
│ ├── User/
│ ├── Role/
│ ├── Plugin/
│ ├── Webhook/
│ ├── Settings/
│ └── Shared/
├── DependencyInjection/
├── Resources/
└── ...
# Unit Tests (noch nicht implementiert)
vendor/bin/phpunit
# Frontend Tests (noch nicht implementiert)
npm test
Das Bundle erweitert nicht den Symfony-Kernel. Die Plugin-Funktionalität wird vollständig über Services bereitgestellt. Siehe KERNEL_INTEGRATION.md für Details.
Dieses Bundle verwendet verschiedene Open-Source-Bibliotheken und Frameworks. Hier sind die wichtigsten Dependencies und deren Lizenzen:
Für eine vollständige Liste aller verwendeten Pakete und deren Lizenzen siehe:
composer.json für PHP-Dependenciespackage.json für JavaScript-DependenciesAlle verwendeten Pakete sind Open-Source und unter permissiven Lizenzen (hauptsächlich MIT) verfügbar.
MIT License - siehe LICENSE Datei.
Bei Fragen oder Problemen erstellen Sie ein Issue im Repository oder kontaktieren Sie das Entwicklungsteam.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Das Bundle stellt automatisch alle Core-Entities für Doctrine bereit. Um die Entities in die Datenbank zu schreiben:
Füge folgende Konfiguration in dein config/packages/doctrine.yaml hinzu:
doctrine:
dbal:
types:
uuid: CompanyOS\Bundle\CoreBundle\Infrastructure\Persistence\Doctrine\UuidType
email: CompanyOS\Bundle\CoreBundle\Infrastructure\Persistence\Doctrine\EmailType
orm:
mappings:
CompanyOSCore:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain'
alias: CompanyOS
CompanyOSUser:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/User/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\User\Domain\Entity'
alias: CompanyOSUser
CompanyOSAuth:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Auth/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Auth\Domain\Entity'
alias: CompanyOSAuth
CompanyOSRole:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Role/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Role\Domain\Entity'
alias: CompanyOSRole
CompanyOSPlugin:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Plugin/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Plugin\Domain\Entity'
alias: CompanyOSPlugin
CompanyOSWebhook:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Webhook/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Webhook\Domain\Entity'
alias: CompanyOSWebhook
CompanyOSSettings:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Settings/Domain/Entity'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Settings\Domain\Entity'
alias: CompanyOSSettings
CompanyOSEvent:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/vendor/companyos/core/src/Domain/Event'
prefix: 'CompanyOS\Bundle\CoreBundle\Domain\Event'
alias: CompanyOSEvent
# Schema erstellen
bin/console doctrine:schema:create
# Oder Schema aktualisieren
bin/console doctrine:schema:update --force
# Oder Migrationen generieren
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
Das Bundle stellt folgende Entities bereit:
users Tabelle)roles Tabelle)user_roles Tabelle)oauth_clients Tabelle)oauth_access_tokens Tabelle)oauth_refresh_tokens Tabelle)plugins Tabelle)webhooks Tabelle)company_settings Tabelle)stored_events Tabelle)How can I help you explore Laravel packages today?