← PORTAFOLIOPORTFOLIO / proyectos / task-laravel

// PRJ_010 · 2023

Task Manager LaravelLaravel Task Manager

Full stack · LaravelFull stack · Laravel

Un gestor de tareas con usuarios y login, hecho para practicar una arquitectura ordenada y con pruebas.A task manager with users and login, built to practice a clean, tested architecture.

En detalleIn detailAPI REST full stack con Laravel + PostgreSQL. CRUD de tareas, autenticación JWT (tymon/jwt-auth), arquitectura en capas (controllers → services → repositories → models), CI/CD con GitHub Actions y tests con PHPUnit.Full stack REST API with Laravel + PostgreSQL. Task CRUD, JWT auth (tymon/jwt-auth), layered architecture (controllers → services → repositories → models), CI/CD with GitHub Actions and PHPUnit tests.

RolRole
Full stack soloSolo full stack
AñoYear
2023
GitHub
ver repo ↗view repo ↗
Stack
Laravel · PHP · PostgreSQL

// IMPACTO// IMPACT

JWTJWT
authauth
PHPUnitPHPUnit
teststests
ActionsActions
ci/cdci/cd

El problemaThe problem

Construir un proyecto full stack en Laravel que demostrara arquitectura hexagonal real, autenticación JWT, CI/CD funcional y cobertura de tests — no solo un CRUD básico.Build a full stack Laravel project demonstrating real hexagonal architecture, JWT auth, functional CI/CD and test coverage — not just a basic CRUD.

Cómo lo resolvíHow I solved it

API REST con arquitectura en capas (controllers → services → repositories → models), autenticación JWT via tymon/jwt-auth con expiración configurable, tests de feature e unitarios con PHPUnit, y pipeline CI/CD en GitHub Actions.REST API with layered architecture (controllers → services → repositories → models), JWT auth via tymon/jwt-auth with configurable expiration, feature and unit tests with PHPUnit, and CI/CD pipeline in GitHub Actions.

Arquitectura y stackArchitecture & stack

  1. [01]Client
  2. [02]Laravel API
  3. [03]JWT (tymon)
  4. [04]Repositories
  5. [05]PostgreSQL
  • Laravel
  • PHP
  • PostgreSQL
  • Docker
  • PHPUnit
// app/Models/Task.php
class Task extends Model {
    protected $casts = [
        'due_at'      => 'datetime',
        'completed_at' => 'datetime',
    ];

    public function isOverdue(): bool {
        return $this->due_at
            && $this->due_at->isPast()
            && !$this->completed_at;
    }
}

Lo que aprendíWhat I learned

01 //

Capas en Laravel

Separar servicios y repositorios de los modelos Eloquent hace los tests mucho más limpios.

02 //

JWT con tymon

Para APIs stateless, los tokens JWT de tymon/jwt-auth son suficientes y simples.

03 //

CI desde el inicio

Agregar GitHub Actions el día 1 evita la deuda técnica de tests tardíos.

01 //

Layers in Laravel

Separating services and repositories from Eloquent models makes tests much cleaner.

02 //

JWT with tymon

For stateless APIs, tymon/jwt-auth tokens are enough and simple.

03 //

CI from day one

Adding GitHub Actions on day 1 avoids the tech debt of late testing.