feat: Setup projet Classeo avec infrastructure Docker et architecture DDD
Configure l'environnement de développement complet avec Docker Compose, structure DDD 4 Bounded Contexts, et pipeline CI/CD GitHub Actions. Corrections compatibilité CI: - Symfony 8 nécessite monolog-bundle ^4.0 (la v3.x ne supporte que jusqu'à Symfony 7) - ESLint v9 nécessite flat config (eslint.config.js) - le format .eslintrc.cjs est obsolète
This commit is contained in:
0
backend/src/Administration/Domain/Event/.gitkeep
Normal file
0
backend/src/Administration/Domain/Event/.gitkeep
Normal file
0
backend/src/Administration/Domain/Model/.gitkeep
Normal file
0
backend/src/Administration/Domain/Model/.gitkeep
Normal file
0
backend/src/Administration/Domain/Policy/.gitkeep
Normal file
0
backend/src/Administration/Domain/Policy/.gitkeep
Normal file
0
backend/src/Administration/Domain/Service/.gitkeep
Normal file
0
backend/src/Administration/Domain/Service/.gitkeep
Normal file
0
backend/src/Communication/Application/Port/.gitkeep
Normal file
0
backend/src/Communication/Application/Port/.gitkeep
Normal file
0
backend/src/Communication/Domain/Event/.gitkeep
Normal file
0
backend/src/Communication/Domain/Event/.gitkeep
Normal file
0
backend/src/Communication/Domain/Exception/.gitkeep
Normal file
0
backend/src/Communication/Domain/Exception/.gitkeep
Normal file
0
backend/src/Communication/Domain/Model/.gitkeep
Normal file
0
backend/src/Communication/Domain/Model/.gitkeep
Normal file
0
backend/src/Communication/Domain/Policy/.gitkeep
Normal file
0
backend/src/Communication/Domain/Policy/.gitkeep
Normal file
0
backend/src/Communication/Domain/Service/.gitkeep
Normal file
0
backend/src/Communication/Domain/Service/.gitkeep
Normal file
13
backend/src/Kernel.php
Normal file
13
backend/src/Kernel.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||
|
||||
final class Kernel extends BaseKernel
|
||||
{
|
||||
use MicroKernelTrait;
|
||||
}
|
||||
0
backend/src/Scolarite/Application/Command/.gitkeep
Normal file
0
backend/src/Scolarite/Application/Command/.gitkeep
Normal file
0
backend/src/Scolarite/Application/Port/.gitkeep
Normal file
0
backend/src/Scolarite/Application/Port/.gitkeep
Normal file
0
backend/src/Scolarite/Application/Query/.gitkeep
Normal file
0
backend/src/Scolarite/Application/Query/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Event/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Event/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Exception/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Exception/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Model/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Model/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Policy/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Policy/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Repository/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Repository/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Service/.gitkeep
Normal file
0
backend/src/Scolarite/Domain/Service/.gitkeep
Normal file
0
backend/src/Scolarite/Infrastructure/Api/.gitkeep
Normal file
0
backend/src/Scolarite/Infrastructure/Api/.gitkeep
Normal file
0
backend/src/Shared/Contracts/.gitkeep
Normal file
0
backend/src/Shared/Contracts/.gitkeep
Normal file
25
backend/src/Shared/Domain/AggregateRoot.php
Normal file
25
backend/src/Shared/Domain/AggregateRoot.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Domain;
|
||||
|
||||
abstract class AggregateRoot
|
||||
{
|
||||
/** @var DomainEvent[] */
|
||||
private array $domainEvents = [];
|
||||
|
||||
protected function recordEvent(DomainEvent $event): void
|
||||
{
|
||||
$this->domainEvents[] = $event;
|
||||
}
|
||||
|
||||
/** @return DomainEvent[] */
|
||||
public function pullDomainEvents(): array
|
||||
{
|
||||
$events = $this->domainEvents;
|
||||
$this->domainEvents = [];
|
||||
|
||||
return $events;
|
||||
}
|
||||
}
|
||||
12
backend/src/Shared/Domain/Clock.php
Normal file
12
backend/src/Shared/Domain/Clock.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Domain;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
interface Clock
|
||||
{
|
||||
public function now(): DateTimeImmutable;
|
||||
}
|
||||
35
backend/src/Shared/Domain/CorrelationId.php
Normal file
35
backend/src/Shared/Domain/CorrelationId.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Domain;
|
||||
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
final readonly class CorrelationId
|
||||
{
|
||||
private function __construct(
|
||||
private string $value,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function generate(): self
|
||||
{
|
||||
return new self(Uuid::uuid4()->toString());
|
||||
}
|
||||
|
||||
public static function fromString(string $value): self
|
||||
{
|
||||
return new self($value);
|
||||
}
|
||||
|
||||
public function value(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
15
backend/src/Shared/Domain/DomainEvent.php
Normal file
15
backend/src/Shared/Domain/DomainEvent.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Domain;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
interface DomainEvent
|
||||
{
|
||||
public function occurredOn(): DateTimeImmutable;
|
||||
|
||||
public function aggregateId(): UuidInterface;
|
||||
}
|
||||
39
backend/src/Shared/Domain/EntityId.php
Normal file
39
backend/src/Shared/Domain/EntityId.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Domain;
|
||||
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
/**
|
||||
* @phpstan-consistent-constructor
|
||||
*/
|
||||
abstract readonly class EntityId
|
||||
{
|
||||
protected function __construct(
|
||||
public UuidInterface $value,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function generate(): static
|
||||
{
|
||||
return new static(Uuid::uuid4());
|
||||
}
|
||||
|
||||
public static function fromString(string $value): static
|
||||
{
|
||||
return new static(Uuid::fromString($value));
|
||||
}
|
||||
|
||||
public function equals(EntityId $other): bool
|
||||
{
|
||||
return $this->value->equals($other->value);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value->toString();
|
||||
}
|
||||
}
|
||||
16
backend/src/Shared/Infrastructure/Clock/SystemClock.php
Normal file
16
backend/src/Shared/Infrastructure/Clock/SystemClock.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Shared\Infrastructure\Clock;
|
||||
|
||||
use App\Shared\Domain\Clock;
|
||||
use DateTimeImmutable;
|
||||
|
||||
final readonly class SystemClock implements Clock
|
||||
{
|
||||
public function now(): DateTimeImmutable
|
||||
{
|
||||
return new DateTimeImmutable();
|
||||
}
|
||||
}
|
||||
0
backend/src/Shared/Infrastructure/Tenant/.gitkeep
Normal file
0
backend/src/Shared/Infrastructure/Tenant/.gitkeep
Normal file
0
backend/src/VieScolaire/Application/Port/.gitkeep
Normal file
0
backend/src/VieScolaire/Application/Port/.gitkeep
Normal file
0
backend/src/VieScolaire/Application/Query/.gitkeep
Normal file
0
backend/src/VieScolaire/Application/Query/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Event/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Event/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Exception/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Exception/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Model/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Model/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Policy/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Policy/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Repository/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Repository/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Service/.gitkeep
Normal file
0
backend/src/VieScolaire/Domain/Service/.gitkeep
Normal file
0
backend/src/VieScolaire/Infrastructure/Api/.gitkeep
Normal file
0
backend/src/VieScolaire/Infrastructure/Api/.gitkeep
Normal file
Reference in New Issue
Block a user