Files
cpo_test/README.md
din9xtr 6d721dba79 feat: add cron scheduling and update services
- Added go-crond library to Dockerfile for task scheduling
- Created schedule service in compose.yaml with go-crond
- Added cron configuration file: docker/cron/laravel
- Updated README.md
- Improved service configurations with health checks
- Switched to base frankenphp image
2026-02-08 00:15:35 +07:00

50 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Тестовое задание
**На хост машине**
```bash
make help
make build
make install
make run # заполнит базу и запустит тесты
make bash # попасть в контейнер
```
**URL**
https://localhost:8443
**pgadmin**
http://localhost:8081
Маршруты в api.php
```php
Route::post('/login', [AuthController::class, 'login']);
Route::middleware(['auth:sanctum'])->group(function () {
Route::post('/logout', [AuthController::class, 'logout']);
Route::prefix('tasks')->name('tasks.')->group(function () {
Route::get('/', [TaskController::class, 'index'])->name('index');
Route::post('/', [TaskController::class, 'store'])->name('store');
Route::get('/{task}', [TaskController::class, 'show'])->name('show');
Route::match(['put', 'patch'], '/{task}', [TaskController::class, 'update'])->name('update');
Route::delete('/{task}', [TaskController::class, 'destroy'])->name('destroy');
});
});
```
### Комментарий:
Маршруты явно прописал, для наглядности
Настроил крон, воспользовался библеотекой https://github.com/webdevops/go-crond, показалось удобной
Не стал ставить редис для очередей, тк тестовое задание, в продакшене использовал https://laravel.com/docs/12.x/horizon
Жестко не стал базу ограничивать, сделал просто каст через php enum (статус таски)
Выбрал frankenphp пхп из-за простоты и любви
В тестах не рефреш датабейз трейт использовал, а транзакции, мне было удобнее просто