This is a simple console application written in PHP (OOP, layered design) with a MySQL database. It demonstrates clean code practices, database design, and multilingual support.
The application allows searching vehicles (cars and motorbikes) by the first three letters of their name, retrieving detailed information including type-specific attributes and location.
- Make sure Docker and Docker Compose are installed
- Clone this repository
- Build and start containers:
docker compose build
docker compose up -d
- Install PHP dependencies:
docker compose run php composer install
-
Initialize database (schema and seed data will be loaded automatically)
-
Verify installation:
docker compose run php php -v
Search vehicles by entering the first three letters:
docker compose run php php src/Index.php abc
Run all tests with PHPUnit:
make test
Run only unit tests:
make test-unit
Run only integration tests:
make test-integration
Run only performance tests:
make test-performance
- Unit tests (
tests/unit/
): Test individual components in isolation, without external dependencies. - Integration tests (
tests/integration/
): Test interactions between components and with external systems (e.g., database). - Performance tests (
tests/performance/
): Measure speed and resource usage under large datasets or heavy load.
The tests follow the same structure as the source code under the /tests
directory.
/src -> PHP source code (entities, repositories, services, CLI entry point)
/tests -> PHPUnit test cases
/sql -> SQL scripts (schema + seed data)
/docs -> Documentation (ERD diagrams, notes)
README.md -> This file
- Entity-Relationship Diagram (PlantUML):
/docs/erd.puml
- Rendered diagram (PNG/SVG) available in the same folder.
Example:
The database and codebase use UTF-8 (utf8mb4) to support multiple languages, including non-Latin alphabets (Arabic, Chinese, etc.).
- No external frameworks are used.
- The project focuses on OOP principles, layered architecture, and testability.
- This repo is a demo project intended for portfolio purposes.