No description
Find a file
rcalvo d2fd88c91e
All checks were successful
Deploy / deploy (push) Successful in 49s
Add deploy workflow
2026-03-29 02:38:04 +00:00
.forgejo/workflows Add deploy workflow 2026-03-29 02:38:04 +00:00
backend feat: add Firebase Auth with Google sign-in 2026-03-28 19:04:51 -06:00
frontend feat: redesign frontend with editorial typography layout 2026-03-28 20:27:48 -06:00
.env.example feat: add Firebase Auth with Google sign-in 2026-03-28 19:04:51 -06:00
.gitignore feat: add Vue 3 frontend with Vite and Docker 2026-03-28 19:04:44 -06:00
docker-compose.yml feat: add Firebase Auth with Google sign-in 2026-03-28 19:04:51 -06:00
README.md docs: add live URL to README 2026-03-28 20:20:54 -06:00

favs-my

API de bookmarks personales con categorización automática via LLM.

Live: https://24.favs.devsignlab.com/

Stack

  • API: FastAPI (Python 3.12)
  • DB: PostgreSQL 16
  • LLM: Claude (Haiku por defecto)
  • Infra: Docker Compose

Setup

cp .env.example .env
# editar .env con tu ANTHROPIC_API_KEY
docker compose up --build

La API queda en http://localhost:8000. La DB en el puerto 5433.

Uso

Crear bookmark

curl -X POST http://localhost:8000/api/bookmarks \
  -H "Content-Type: application/json" \
  -d '{"title":"FastAPI docs","link":"https://fastapi.tiangolo.com"}'

Listar todos

curl http://localhost:8000/api/bookmarks

Filtrar por categoría

curl http://localhost:8000/api/bookmarks?category=python

Obtener uno

curl http://localhost:8000/api/bookmarks/{id}

Actualizar

curl -X PUT http://localhost:8000/api/bookmarks/{id} \
  -H "Content-Type: application/json" \
  -d '{"title":"Nuevo titulo"}'

Eliminar

curl -X DELETE http://localhost:8000/api/bookmarks/{id}

Categorizar pendientes (LLM)

curl -X POST http://localhost:8000/api/categorize

Toma los bookmarks sin categoría (category: null), los envía a Claude y asigna categorías automáticamente.

Cron

Para categorizar automáticamente cada 30 minutos:

crontab -e
*/30 * * * * curl -s -X POST http://localhost:8000/api/categorize

Variables de entorno

Variable Default Descripción
DATABASE_URL postgresql+asyncpg://favs:favs@favs-db:5432/favs Conexión a PostgreSQL
ANTHROPIC_API_KEY API key de Anthropic (requerida para categorizar)
CATEGORIZE_MODEL claude-haiku-4-5-20251001 Modelo a usar para categorización

Estructura

├── docker-compose.yml
├── .env.example
└── backend/
    ├── Dockerfile
    ├── requirements.txt
    └── app/
        ├── main.py            # Entrypoint, lifespan, routers
        ├── config.py           # Settings via env vars
        ├── database.py         # Engine y sesión async
        ├── models.py           # Modelo Bookmark (SQLAlchemy)
        ├── schemas.py          # Pydantic schemas
        ├── categorizer.py      # Lógica de categorización con LLM
        └── routers/
            ├── bookmarks.py    # CRUD /api/bookmarks
            ├── categorize.py   # POST /api/categorize
            └── health.py       # GET /api/health