This project serves as a template for building product-related applications using Symfony. It showcases an example of architecture leveraging Hexagonal Architecture, CQRS, and Stripe integration.
- Framework: Symfony
- Architecture: Hexagonal Architecture
- Patterns: CQRS (Command Query Responsibility Segregation)
- Payment Integration: Stripe
- Hexagonal Architecture: Promotes separation of concerns and decouples the core logic from external systems.
- CQRS: Separates read and write operations to optimize performance and scalability.
- Stripe Integration: Demonstrates payment processing capabilities using Stripe's API.
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/mifefr/Symfony-base-product cd base-product
-
Set up environment variables:
- Copy
.env.example
to.env
and configure your environment variables, includingSTRIPE_SECRET_KEY
.
- Copy
-
Build and start the Docker containers:
docker-compose up --build -d
-
Access the application:
- Web: http://localhost:8080
- MySQL: Host
localhost
, Port3306
Execute the following command to run the test suite:
php bin/phpunit
- Create Product: Use the
POST /api/products
endpoint to create new products. - List Products: Use the
GET /api/products
endpoint to retrieve all products. - Get Product: Use the
GET /api/products/{id}
endpoint to retrieve product details. - Create Payment: Use the
/api/payment/create
endpoint to initiate a payment. - Check Payment Status: Use the
/api/payment/{paymentId}/status
endpoint to check payment status.
This project is licensed under the MIT License.
Contributions are welcome :) Please open an issue or submit a pull request for any changes.