A robust API for a product sales platform, inspired by LeBonCoin, with a focus on adhering to best software engineering practices.
This project is currently in active development. While its foundational principles and structures are in place, features and functionality may still be in flux.
The primary goal is to implement a product sales platform starting from a Symfony skeleton and a given docker-compose
setup. This project employs methodologies such as:
- Outside-In TDD
- Hexagonal Architecture to isolate the core of the application from external needs.
- Domain-Driven Design (DDD) to focus on the core domain logic.
- CQRS for a clear separation of command and query responsibilities.
Quality assurance tools integrated:
- PHP-CS-Fixer: For code style consistency.
- PHPStan: For static analysis ensuring bug-free code.
- Rector: Automated code refactoring.
- Deptrac: Enforces rules to maintain architecture boundaries.
- Create, retrieve, update, and delete product advertisements.
- Search adverts based on title, price range.
- Fetch advertisement details by ID.
- Register and login user functionalities.
- JWT authentication.
- PHP 8.2
- Symfony 6.3
- Docker
- Clone the repository:
git clone git@github.com:nicoweb/leboncode.git
- Navigate to the project directory:
cd leboncode
- Build and start the project using:
make start
Use the following command:
make test
Access the Swagger documentation at: http://localhost:8000/docs
The project is modularized, e.g., app/Module/User
. Each module can house multiple use-cases, such as "Register User", and these use-cases are categorized as:
- Application: Includes query/command, handlers, mappers, etc.
- Domain: Houses the core business logic and domain entities.
- Infrastructure: Contains details of implementation, like repositories.
- Presentation: Manages HTTP requests/responses – controllers, etc.
- Domain: No dependencies.
- Application: Only Domain.
- Infrastructure: Vendors and Domain.
- Presentation: Vendors and Domain.