insidesuki/application

Installs: 50

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:project

6.8.1 2025-05-22 21:47 UTC

README

Symfony 6.4 PHP 8.1+ Hexagonal Architecture DDD Ready

๐Ÿ“‹ Overview

A modern Symfony 6.4 project skeleton built around Clean Architecture principles, specifically implementing the Hexagonal Architecture (also known as Ports and Adapters) pattern. This architecture isolates the core business logic from external concerns, making the system more maintainable, testable, and adaptable to change.

The project structure separates the core application from external dependencies:

  • The kernel lives in /src, isolated from your application code
  • Application and domain code lives in the /app folder, organized by bounded contexts
  • Infrastructure implementations connect the core to external systems and frameworks

This separation enables:

  • ๐Ÿ”„ Swappable adapters (persistence, UI, services) without affecting business logic
  • ๐Ÿงช Testable domain logic independent of infrastructure concerns
  • ๐Ÿ›ก๏ธ Protection of business rules from external influence
  • ๐Ÿงฉ Clear separation of concerns through well-defined ports (interfaces)

๐Ÿ›๏ธ Architecture

The project follows a Clean Architecture approach with the Hexagonal Architecture pattern (Ports and Adapters):

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Application                       โ”‚
โ”‚                                                     โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚   โ”‚              Domain Layer                    โ”‚  โ”‚
โ”‚   โ”‚                                             โ”‚  โ”‚
โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚   โ”‚  โ”‚                                     โ”‚   โ”‚  โ”‚
โ”‚   โ”‚  โ”‚         Business Logic              โ”‚   โ”‚  โ”‚
โ”‚   โ”‚  โ”‚                                     โ”‚   โ”‚  โ”‚
โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚   โ”‚                    โ”‚                        โ”‚  โ”‚
โ”‚   โ”‚                    โ–ผ                        โ”‚  โ”‚
โ”‚   โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚  โ”‚
โ”‚   โ”‚  โ”‚            Application              โ”‚   โ”‚  โ”‚
โ”‚   โ”‚  โ”‚               Layer                 โ”‚   โ”‚  โ”‚
โ”‚   โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚  โ”‚
โ”‚   โ”‚                    โ”‚                        โ”‚  โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                        โ”‚                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚     Infrastructure Layer (Adapters)           โ”‚ โ”‚
โ”‚  โ”‚                                               โ”‚ โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  Database  โ”‚  โ”‚    Web     โ”‚ โ”‚  Third   โ”‚ โ”‚ โ”‚
โ”‚  โ”‚  โ”‚  Adapter   โ”‚  โ”‚   Adapter  โ”‚ โ”‚  Party   โ”‚ โ”‚ โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key Architectural Components:

  • Domain Layer: Contains business logic, entities, value objects, and domain services.
  • Application Layer: Contains use cases, application services, and ports (interfaces).
  • Infrastructure Layer: Contains adapters that implement the ports defined in the application layer.

๐Ÿค– InsideApps IA Context

This project includes InsideApps IA context for AI assistants. The InsideApps framework provides:

  • ๐Ÿ”„ DDD Architectural Guidance: Clear guidelines for implementing Domain-Driven Design
  • ๐Ÿ—๏ธ Automated Generation: Module and entity creation following DDD best practices
  • ๐Ÿค– AI Integration: Specialized commands for AI assistants to understand the architecture
  • ๐Ÿ“ Business Rule Enforcement: Consistent application of rules from the business-context directory
  • ๐Ÿ“ Memory Protocol: Tracking of project changes and architectural decisions

InsideApps Commands:

# Load full architectural context
insideapps:start

# Create a new module with proper DDD structure
insideapps create new module <ModuleName>

# Create a new entity with business rules
insideapps create new entity <EntityName> in <ModuleName> with this rule: <BusinessRules>

For complete documentation, see the insideapps.md file.

โœจ Features

  • ๐Ÿ” Authentication System: Decoupled implementation for flexibility
  • ๐Ÿ”‘ Password Recovery: Decoupled password restoration system
  • ๐ŸŒ API Support: Built-in API capabilities with documentation
  • ๐Ÿ“Š Monolog Integration: Comprehensive logging
  • ๐ŸŽจ PlaniAdmin Template: Modern admin interface integration

๐Ÿš€ Installation

  1. Clone the repository
  2. Install dependencies:
    composer install
    
  3. Create a .env.local file in the config/env folder
  4. Configure your database connection and mailer DSN
  5. Run database migrations:
    php bin/console doctrine:migrations:migrate
    
  6. Start the development server:
    symfony server:start
    

๐Ÿ”— Routes

  • ๐Ÿ”’ /login - Authentication page
  • ๐Ÿ“š /api/docs - API Documentation

๐Ÿ“š Documentation

For more detailed documentation on the architecture and development guidelines, please refer to:

  • insideapps.md - InsideApps AI context and architectural guidelines
  • business-context/ directory - Business rules and domain models