# TekDek Employees API

Backend API for the TekDek team/employees page. Built by Talos.

## Structure

```
tekdek-employees-api/
├── public/
│   ├── index.php          # Entry point
│   └── .htaccess          # Apache rewrite rules
├── src/
│   ├── Database.php       # PDO connection manager
│   ├── EmployeeRepository.php  # Data access layer
│   ├── EmployeeController.php  # Request handling
│   └── Router.php         # URL routing
├── database/
│   ├── migrations/        # Schema SQL
│   └── seeds/             # Initial data
├── tests/
│   ├── EmployeeRepositoryTest.php
│   ├── EmployeeControllerTest.php
│   └── RouterTest.php
├── docs/
│   └── API.md             # Full API documentation
├── composer.json
├── phpunit.xml
└── README.md
```

## Quick Start

```bash
composer install
mysql -u root -p tekdek < database/migrations/001_create_employees_table.sql
mysql -u root -p tekdek < database/seeds/001_seed_employees.sql
composer test
```

## Endpoints

- `GET /api/employees` — All employees (sorted)
- `GET /api/employees/:slug` — Single employee by slug

See [docs/API.md](docs/API.md) for full documentation.

## Environment

Set via environment variables: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASS`.

## Tests

```bash
composer test
```

Repository tests use SQLite in-memory (no MySQL needed). Controller tests use mocked repositories. Router tests verify dispatch logic.
