docs: actualizar README raíz con OLED y nueva arquitectura

This commit is contained in:
javiservices 2026-06-17 14:04:22 +02:00
commit 2f349935eb
3 changed files with 108 additions and 0 deletions

106
README.md Normal file
View File

@ -0,0 +1,106 @@
# DummyBot
Bot físico de tareas para personas con TDAH, basado en **ESP32** + **pantalla OLED SSD1306 128x64 (I2C)** + **3 botones TTP223** + **vibrador**.
Las tareas se gestionan desde una **mini-app web Laravel** (dark mode, atajos de teclado, responsive). El ESP32 hace polling HTTP cada 30 s y vibra cuando llega una tarea nueva. Se configura por **captive portal**: abre un AP `DummyBot-Setup` con un formulario web.
## Arquitectura
```
┌──────────────────┐ HTTP/JSON (Bearer token) ┌──────────────────────┐
│ Navegador web │ ◀───────────────────────────▶ │ Laravel + MySQL │
│ (Tailwind+Alpine)│ │ /api/auth │
└──────────────────┘ │ /api/tasks │
│ /api/projects │
│ /api/tags │
│ /api/devices │
│ /api/device/... │
└──────────┬───────────┘
│ HTTP
│ (device token)
┌──────────▼───────────┐
│ ESP32 │
│ OLED SSD1306 128x64│
│ 3 botones TTP223 │
│ Vibrador │
└──────────────────────┘
```
## Estructura del proyecto
```
dummybot/
├── firmware/ # PlatformIO ESP32 Arduino
│ ├── platformio.ini
│ ├── src/main.cpp # Lógica principal (OLED + WiFi + portal)
│ ├── partitions.csv
│ └── README.md
└── backend-laravel/ # Laravel 12 (PHP 8.4, MySQL, Sanctum)
├── app/Models/Task.php
├── app/Models/Project.php
├── app/Models/Tag.php
├── app/Models/Device.php
├── app/Http/Controllers/Auth/ # AuthController, LoginController
├── app/Http/Controllers/Api/ # Project, Tag, Device
├── app/Http/Controllers/TaskController.php
├── app/Http/Controllers/PageController.php
├── app/Http/Middleware/AuthenticateDevice.php
├── database/migrations/
├── resources/views/pages/ # home, login, register, app, settings
├── resources/views/layouts/base.blade.php
├── routes/{web,api}.php
├── Dockerfile
├── docker-compose.yml
└── nginx.conf
```
## Endpoints clave (resumen)
Ver [`backend-laravel/README.md`](backend-laravel/README.md) para detalle completo.
```
POST /api/auth/register
POST /api/auth/login
GET /api/auth/me (auth)
GET /api/tasks (auth)
POST /api/tasks (auth)
POST /api/tasks/{id}/done (auth o device)
POST /api/tasks/{id}/snooze (auth o device)
GET /api/tasks/stats (auth)
GET /api/projects (auth)
POST /api/projects (auth)
GET /api/tags (auth)
POST /api/tags (auth)
GET /api/devices (auth)
POST /api/devices → devuelve token (solo 1 vez)
# Para el ESP32 (auth.device)
GET /api/device/tasks/pending
POST /api/device/heartbeat
```
## Setup del usuario
1. Abre `http://157.180.77.232:18080/` (o `http://localhost:8000/` en dev).
2. Crea una cuenta.
3. Ve a **Ajustes → Dispositivos**, crea tu DummyBot y **guarda el token**.
4. Flashea el firmware (ver `firmware/README.md`).
5. En el primer arranque, el ESP32 abre un AP `DummyBot-Setup`. Conéctate desde el móvil y configura WiFi + token desde el formulario web.
6. Tras guardar, el bot se reinicia y se conecta solo.
## Hardware
- **ESP32-D0WD-V3** (DevKitC / WROOM-32, 4 MB flash)
- **Pantalla OLED SSD1306 0.96"** (128x64, I2C, 4 pines: GND/VDD/SCK/SDA)
- **3× TTP223** (botones táctiles: Siguiente / Hecha / Snooze)
- **1× motor vibrador 1027** (3V DC, controlado por MOSFET en GPIO 25)
Ver [`firmware/README.md`](firmware/README.md) para detalle completo de cableado.
## Licencia
MIT

1
backend-laravel Submodule

@ -0,0 +1 @@
Subproject commit 3a5da955a4be8f6c0e932e714dd906a8c06926a4

1
firmware Submodule

@ -0,0 +1 @@
Subproject commit 9fb87a4d623f61748d734e0b10940e7ae0c45e6b