-
Notifications
You must be signed in to change notification settings - Fork 0
Hexagonal Architecture
Pau F. Grau edited this page Jan 10, 2021
·
2 revisions
This repository follow the Ports and Adapters / Hexagonal Architecture pattern.
We organize the code with the follow structure:
src
βββ Bounded Context
β βββ Application
β β βββ Command
β β βββ Query
β βββ Domain
β β βββ Event // All Subscribers subscribed to events
β β βββ Model
β βββ Infrastructure
β βββ Ports And Adapters
β βββ UI
β βββ Command // CLI commands
β βββ Controller
Example of Quotes API:
src
βββ Api
β βββ Application
β β βββ Command
β β β βββ ImportAuthors
β β β β βββ ImportAuthorsCommand.php
β β β β βββ ImportAuthorsCommandHandler.php
β β β βββ ImportQuotes
β β β βββ ImportQuotesCommand.php
β β β βββ ImportQuotesCommandHandler.php
β β βββ Query
β β βββ GetShoutsByAuthor
β β βββ GetShoutsByAuthorQuery.php
β β βββ GetShoutsByAuthorQueryHandler.php
β β βββ GetShoutsByAuthorQueryResponse.php
β βββ Domain
β β βββ Event
β β β βββ Author
β β β β βββ CreateAuthorSubscriber.php
β β β βββ Quote
β β β β βββ CreateQuoteSubscriber.php
β β β βββ Shout
β β β βββ ShoutsByAuthorSubscriber.php
β β βββ Model
β β βββ Author
β β β βββ Author.php
β β β βββ AuthorCreatedV1.php
β β β βββ AuthorNotFound.php
β β β βββ AuthorProjection.php
β β β βββ AuthorRepository.php
β β βββ Quote
β β β βββ Quote.php
β β β βββ QuoteCreatedV1.php
β β β βββ QuoteProjection.php
β β β βββ QuoteRepository.php
β β βββ Shout
β β βββ Shout.php
β β βββ ShoutCollection.php
β β βββ ShoutsByAuthorRequestedV1.php
β βββ Infrastructure
β βββ Framework
β β βββ Symfony
β β βββ Kernel.php
β βββ Persistence
β β βββ Dbal
β β β βββ Author
β β β β βββ DbalAuthorProjection.php
β β β βββ Quote
β β β βββ DbalQuoteProjection.php
β β βββ Doctrine
β β βββ Author
β β β βββ DoctrineAuhorRepository.php
β β βββ Quote
β β β βββ DoctrineQuoteRepository.php
β β βββ mapping
β β βββ Author.Author.orm.xml
β β βββ Quote.Quote.orm.xml
β βββ UI
β βββ Command
β β βββ Author
β β β βββ ImportAuthorsCommand.php
β β βββ Quote
β β βββ ImportQuotesCommand.php
β βββ Controller
β βββ GetQuotesByAuthor
β β βββ GetQuotesByAuthorController.php
β βββ Ping
β βββ PingController.php
βββ Shared
βββ Domain
β βββ Model
β βββ Aggregate
β β βββ AggregateRoot.php
β βββ Api
β β βββ ApiError.php
β βββ Bus
β β βββ CommandBus.php
β β βββ EventBus.php
β β βββ QueryBus.php
β βββ Cache
β β βββ CacheRepository.php
β βββ Command.php
β βββ Event
β β βββ DomainEvent.php
β β βββ DomainEventPublisher.php
β β βββ DomainEventSubscriber.php
β β βββ EventFailed.php
β β βββ EventFailedNotFoundException.php
β β βββ EventFailedStore.php
β β βββ EventNotPublished.php
β β βββ EventNotPublishedNotFoundException.php
β β βββ EventNotPublishedStore.php
β β βββ EventStore.php
β β βββ PublishableDomainEvent.php
β β βββ StoredEvent.php
β β βββ StoredEventNotFoundException.php
β βββ Exception
β β βββ BadRequestException.php
β β βββ ConflictException.php
β β βββ NotFoundException.php
β β βββ ProjectException.php
β βββ Query.php
β βββ Serializer
β βββ Serializer.php
βββ Infrastructure
βββ Bus
β βββ Custom
β β βββ CustomEventBus.php
β βββ League
β βββ CommandBus.php
β βββ CommandBusFactory.php
β βββ CommandBusProvider.php
β βββ DbalTransactionMiddleware.php
β βββ QueryBus.php
β βββ QueryBusFactory.php
β βββ QueryBusProvider.php
βββ MessageBroker
β βββ Dispatcher.php
β βββ RabbitMq
β β βββ RabbitMqConfigurer.php
β β βββ RabbitMqConnection.php
β β βββ RabbitMqDomainEventsConsumer.php
β β βββ RabbitMqExchangeNameFormatter.php
β β βββ RabbitMqFactoryConfigurer.php
β β βββ RabbitMqFactoryConnection.php
β β βββ RabbitMqPublisher.php
β βββ SubscriberMapper.php
βββ Persistence
β βββ Dbal
β β βββ Event
β β βββ DbalEventFailedStore.php
β β βββ DbalEventNotPublishedStore.php
β β βββ DbalEventStore.php
β βββ FakeCacheRepository.php
β βββ Redis
β βββ Cache
β βββ RedisCacheRepository.php
βββ Serializer
β βββ PhpSerializer.php
βββ UI
βββ Command
βββ MessageBroker
βββ RabbitMqConfigureCommand.php
βββ RabbitMqConsumeDomainEventsCommand.php
βββ RabbitMqUpDomainEventsConsumers.php