DummyBot - task manager ESP32 + Laravel
Go to file
javiservices 0027b2a478
Some checks are pending
Deploy DummyBot / Build & Deploy to ${{ env.DEPLOY_HOST }} (push) Waiting to run
docs: trigger auto-deploy test
2026-06-18 12:19:10 +02:00
.gitea/workflows feat(frontend): rediseño completo + deploy automático 2026-06-18 12:00:39 +02:00
app fix(deploy): substr offset 11 (refs/heads/ tiene 11 chars) 2026-06-18 12:18:23 +02:00
backend-laravel@3a5da955a4 docs: actualizar README raíz con OLED y nueva arquitectura 2026-06-17 14:04:22 +02:00
bootstrap fix(deploy): excluir CSRF en /webhook/* + script self-contained 2026-06-18 12:16:48 +02:00
config Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
database v2: auth (Sanctum) + devices tokens + projects + tags + UI web épica con Tailwind+Alpine 2026-06-17 01:58:54 +02:00
firmware@478bb65d32 feat(frontend): rediseño completo + deploy automático 2026-06-18 12:00:39 +02:00
public Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
resources feat(frontend): rediseño completo + deploy automático 2026-06-18 12:00:39 +02:00
routes feat(deploy): webhook de Gitea → /webhook/deploy 2026-06-18 12:12:11 +02:00
storage Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
tests Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
.editorconfig Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
.env.example Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
.gitattributes Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
.gitignore feat(frontend): rediseño completo + deploy automático 2026-06-18 12:00:39 +02:00
.npmrc Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
artisan Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
composer.json Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
composer.lock Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
deploy-runner.sh fix(deploy): excluir CSRF en /webhook/* + script self-contained 2026-06-18 12:16:48 +02:00
docker-compose.yml fix(deploy): excluir CSRF en /webhook/* + script self-contained 2026-06-18 12:16:48 +02:00
docker-entrypoint.sh v2: auth (Sanctum) + devices tokens + projects + tags + UI web épica con Tailwind+Alpine 2026-06-17 01:58:54 +02:00
Dockerfile Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
nginx.conf Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
package.json Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
phpunit.xml Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00
README.md docs: trigger auto-deploy test 2026-06-18 12:19:10 +02:00
vite.config.js Initial commit: DummyBot Laravel backend with Docker setup 2026-06-17 00:28:42 +02:00

DummyBot Backend

API REST y UI web para DummyBot — un bot físico de tareas para personas con TDAH, basado en ESP32 + ST7789 + caritas kawaii.

Stack: Laravel 12 · PHP 8.4 · MySQL 8 · Sanctum · Tailwind (CDN) + Alpine.js (CDN).


🚀 Setup rápido

# 1. Crear BD
mysql -u root -p
> CREATE DATABASE dummybot CHARACTER SET utf8mb4;
> CREATE USER 'dummybot'@'localhost' IDENTIFIED BY 'TU_PASSWORD';
> GRANT ALL ON dummybot.* TO 'dummybot'@'localhost';

# 2. Configurar
cp .env.example .env
# Edita DB_PASSWORD, APP_URL, etc.

# 3. Instalar + migrar
composer install --no-dev --optimize-autoloader
php artisan key:generate
php artisan migrate

# 4. Arrancar
php artisan serve --host=0.0.0.0 --port=8000

Abre http://localhost:8000/. Crea una cuenta, ve a Ajustes → Dispositivos y crea tu primer DummyBot para obtener un token.

🐳 Docker

AUTO_MIGRATE=1 docker compose up -d --build

Esto levanta dummybot_app (PHP-FPM), dummybot_web (nginx) y dummybot_db (MySQL 8). El puerto 80 queda interno (el proxy externo ya está gestionado en producción).

🧠 Modelo de datos

Tabla Descripción
users Usuarios (auth vía Sanctum)
tasks Tareas (title, description, priority, estimate_min, deadline, recurrence, done, snooze_until, done_at, project_id, user_id)
projects Agrupa tareas (color + icono)
tags Etiquetas transversales (muchas a muchas con tasks)
devices Cada ESP32 con su propio token y last_seen_at

🔌 API REST

Todas las rutas devuelven JSON. Auth vía Authorization: Bearer <token>.

Auth (web)

POST   /api/auth/register   {name, email, password, password_confirmation}
POST   /api/auth/login      {email, password}
POST   /api/auth/logout     (auth)
GET    /api/auth/me         (auth)

Tareas (web, con sesión o token Sanctum)

GET    /api/tasks                    Listar (con project + tags)
POST   /api/tasks                    Crear
PUT    /api/tasks/{id}               Editar
DELETE /api/tasks/{id}               Borrar
POST   /api/tasks/{id}/done          Marcar como hecha (genera recurrente si aplica)
POST   /api/tasks/{id}/snooze        Posponer {minutes: N}
POST   /api/tasks/{id}/restore       Reabrir
GET    /api/tasks/stats              {pending, today, done_today, overdue, total_done}

Proyectos

GET    /api/projects
POST   /api/projects                {name, color, icon}
PUT    /api/projects/{id}
DELETE /api/projects/{id}

Tags

GET    /api/tags
POST   /api/tags                    {name, color}
DELETE /api/tags/{id}

Dispositivos (DummyBots)

GET    /api/devices                 Tus DummyBots
POST   /api/devices                 {name, hardware?, firmware_version?}  → devuelve token (solo 1 vez)
POST   /api/devices/{id}/rotate     Invalida y crea nuevo token
DELETE /api/devices/{id}

Para el ESP32 (auth.device, con token del dispositivo)

GET    /api/device/tasks/pending    Polling cada 30s
POST   /api/device/tasks            Crear tarea (desde bot, ej. comandos)
POST   /api/device/tasks/{id}/done
POST   /api/device/tasks/{id}/snooze
DELETE /api/device/tasks/{id}
POST   /api/device/heartbeat        Ping (refresca last_seen_at)

🎨 Frontend (Blade + Alpine)

  • pages/home.blade.php — landing
  • pages/login.blade.php / pages/register.blade.php — auth
  • pages/app.blade.phpapp principal (lista tareas, filtros, atajos teclado)
  • pages/settings.blade.php — gestión de dispositivos, proyectos, tags

Atajos de teclado (en /app)

  • n → nueva tarea
  • / → buscador
  • Esc → cerrar modal
  • 1 / 2 / 3 / 4 → filtro Todas / Pendientes / Hoy / Hechas
  • s → snooze 5 min (sobre tarea enfocada)

TDAH-friendly

  • Sin gamificación tóxica (sin puntos, sin streaks).
  • No judgemental: "sin tareas" muestra un emoji festivo, no un mensaje triste.
  • Dark mode por defecto con gradientes suaves.
  • Atajos de teclado para no tener que tocar el ratón.
  • Filtros contextuales (Hoy, Vencidas, Por proyecto) para evitar el agobio del "todo".

🔌 Webhooks (TODO)

Pendiente: hook de salida cuando se crea/marca una tarea. Pensado para integrarse con Notion, Zapier, n8n, etc.

📋 Importar / Exportar (TODO)

Endpoints para CSV/JSON de tareas.

🚀 Despliegue en producción

Ya está dockerizado. El repo está en https://git.anabolictrack.com/javiservices/dummybot.

# En el server
cd /root/dummybot
git pull
AUTO_MIGRATE=1 docker compose up -d --build

Para que el proxy-manager lo exponga en HTTPS, añadir host en http://157.180.77.232:81 apuntando al contenedor dummybot_web:80.

Licencia

MIT