feat: improve related notes algorithm and add seed data
- Add multilingual stop words (English + Spanish) for better matching - Add technical keywords set for relevance scoring - Improve scoring weights: tags +3, title matches +3 - Fix false positives between unrelated notes - Add README with usage instructions - Add 47 seed examples for testing - Update quick add shortcut behavior - Add project summary Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
207
resumen/2026-03-22-1435-resumen.md
Normal file
207
resumen/2026-03-22-1435-resumen.md
Normal file
@@ -0,0 +1,207 @@
|
||||
# Resumen del Proyecto - 2026-03-22
|
||||
|
||||
## Nombre
|
||||
**Recall** - Sistema de gestión de notas personales
|
||||
|
||||
## Descripción
|
||||
Aplicación web para crear, editar, buscar y organizar notas personales con soporte para tags, tipos de notas, favoritos, pins, captura rápida, backlinks y relaciones entre notas.
|
||||
|
||||
---
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Categoría | Tecnología |
|
||||
|-----------|------------|
|
||||
| Framework | Next.js 16.2.1 (React 19.2.4) |
|
||||
| Base UI | @base-ui/react 1.3.0 |
|
||||
| Database | SQLite con Prisma ORM |
|
||||
| Validation | Zod 4.3.6 |
|
||||
| Styling | Tailwind CSS 4 + CSS Variables |
|
||||
| Icons | Lucide React |
|
||||
| Markdown | react-markdown + remark-gfm |
|
||||
| Syntax Highlight | react-syntax-highlighter |
|
||||
| Toast | sonner 2.0.7 |
|
||||
| Testing | Jest |
|
||||
|
||||
---
|
||||
|
||||
## Estructura del Proyecto
|
||||
|
||||
```
|
||||
src/
|
||||
├── app/
|
||||
│ ├── api/
|
||||
│ │ ├── export-import/route.ts
|
||||
│ │ ├── notes/
|
||||
│ │ │ ├── route.ts
|
||||
│ │ │ ├── [id]/route.ts
|
||||
│ │ │ │ ├── backlinks/route.ts
|
||||
│ │ │ │ └── route.ts
|
||||
│ │ │ ├── quick/route.ts
|
||||
│ │ │ └── suggest/route.ts
|
||||
│ │ ├── search/route.ts
|
||||
│ │ └── tags/
|
||||
│ │ ├── route.ts
|
||||
│ │ └── suggest/route.ts
|
||||
│ ├── notes/[id]/page.tsx
|
||||
│ ├── notes/page.tsx
|
||||
│ ├── new/page.tsx
|
||||
│ ├── edit/[id]/page.tsx
|
||||
│ ├── settings/page.tsx
|
||||
│ ├── layout.tsx
|
||||
│ └── page.tsx
|
||||
├── components/
|
||||
│ ├── ui/ # shadcn/ui components
|
||||
│ ├── dashboard.tsx
|
||||
│ ├── header.tsx
|
||||
│ ├── markdown-content.tsx # Markdown con syntax highlight
|
||||
│ ├── note-card.tsx
|
||||
│ ├── note-form.tsx # Form con campos guiados
|
||||
│ ├── note-list.tsx
|
||||
│ ├── quick-add.tsx # Ctrl+N quick add
|
||||
│ ├── related-notes.tsx
|
||||
│ ├── search-bar.tsx
|
||||
│ ├── delete-note-button.tsx
|
||||
│ └── tag-filter.tsx
|
||||
├── lib/
|
||||
│ ├── prisma.ts
|
||||
│ ├── utils.ts
|
||||
│ ├── validators.ts
|
||||
│ ├── errors.ts # Error handling estándar
|
||||
│ ├── search.ts # Búsqueda con scoring
|
||||
│ ├── quick-add.ts # Parser para captura rápida
|
||||
│ ├── tags.ts # Normalización y sugerencias
|
||||
│ ├── templates.ts # Plantillas por tipo
|
||||
│ ├── related.ts # Notas relacionadas
|
||||
│ ├── backlinks.ts # Sistema de backlinks
|
||||
│ └── guided-fields.ts # Campos guiados por tipo
|
||||
└── types/
|
||||
└── note.ts
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Modelo de Datos (Prisma)
|
||||
|
||||
### Note
|
||||
| Campo | Tipo | Descripción |
|
||||
|-------|------|-------------|
|
||||
| id | String | CUID único |
|
||||
| title | String | Título |
|
||||
| content | String | Contenido en Markdown |
|
||||
| type | String | command, snippet, decision, recipe, procedure, inventory, note |
|
||||
| isFavorite | Boolean | Favorita |
|
||||
| isPinned | Boolean | Fijada |
|
||||
| createdAt | DateTime | Creación |
|
||||
| updatedAt | DateTime | Última modificación |
|
||||
|
||||
### Tag
|
||||
| Campo | Tipo | Descripción |
|
||||
|-------|------|-------------|
|
||||
| id | String | CUID único |
|
||||
| name | String | Nombre único (lowercase) |
|
||||
|
||||
### Backlink
|
||||
Relación bidireccional entre notas via `[[nombre-nota]]`
|
||||
|
||||
---
|
||||
|
||||
## APIs
|
||||
|
||||
| Método | Ruta | Descripción |
|
||||
|--------|------|-------------|
|
||||
| GET | `/api/notes` | Listar notas |
|
||||
| POST | `/api/notes` | Crear nota |
|
||||
| GET | `/api/notes/[id]` | Obtener nota |
|
||||
| PUT | `/api/notes/[id]` | Actualizar nota |
|
||||
| DELETE | `/api/notes/[id]` | Eliminar nota |
|
||||
| GET | `/api/notes/[id]/backlinks` | Backlinks recibidos |
|
||||
| POST | `/api/notes/quick` | Captura rápida |
|
||||
| GET | `/api/notes/suggest` | Sugerencias de notas |
|
||||
| GET | `/api/search` | Búsqueda con scoring |
|
||||
| GET | `/api/tags` | Listar/sugerir tags |
|
||||
| GET | `/api/tags/suggest` | Sugerencias por contenido |
|
||||
| GET/POST | `/api/export-import` | Exportar/importar |
|
||||
|
||||
---
|
||||
|
||||
## Funcionalidades Implementadas
|
||||
|
||||
### 1. Captura Rápida (Quick Add)
|
||||
- Shortcut global `Ctrl+N`
|
||||
- Sintaxis: `[tipo:][título] #tag1 #tag2`
|
||||
- Tipos: `cmd:`, `snip:`, `dec:`, `rec:`, `proc:`, `inv:`
|
||||
- API: `POST /api/notes/quick`
|
||||
|
||||
### 2. Búsqueda y Recuperación
|
||||
- Scoring: título exacto > parcial > favoritos > pinned > recencia
|
||||
- Búsqueda fuzzy (tolerante a errores de escritura)
|
||||
- Resaltado de términos con excerpt
|
||||
- Filtros por tipo y tags
|
||||
|
||||
### 3. Relaciones entre Notas
|
||||
- **Backlinks automáticos:** detecta `[[nombre-nota]]`
|
||||
- **Notas relacionadas:** scoring por tags, tipo, palabras
|
||||
- API: `GET /api/notes/[id]/backlinks`
|
||||
|
||||
### 4. Campos Guiados por Tipo
|
||||
- Command: comando, descripción, ejemplo
|
||||
- Snippet: lenguaje, código, descripción
|
||||
- Decision: contexto, decisión, alternativas, consecuencias
|
||||
- Recipe: ingredientes, pasos, tiempo
|
||||
- Procedure: objetivo, pasos, requisitos
|
||||
- Inventory: item, cantidad, ubicación
|
||||
|
||||
### 5. UX por Tipo
|
||||
- **Command:** botón copiar
|
||||
- **Snippet:** syntax highlighting
|
||||
- **Procedure:** checkboxes interactivos
|
||||
|
||||
### 6. Sistema de Tags
|
||||
- Normalización automática (lowercase, trim)
|
||||
- Autocomplete en formularios
|
||||
- Sugerencias basadas en contenido
|
||||
|
||||
---
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
npx jest __tests__/
|
||||
# 46 passing, 3 skipped
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Comandos
|
||||
|
||||
```bash
|
||||
npm install # Instalar dependencias
|
||||
npx prisma db push # Sincronizar schema con BD
|
||||
npm run dev # Desarrollo (localhost:3000)
|
||||
npm run build # Build producción
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Rutas de la Aplicación
|
||||
|
||||
| Ruta | Descripción |
|
||||
|------|-------------|
|
||||
| `/` | Dashboard |
|
||||
| `/notes` | Lista de notas |
|
||||
| `/notes/[id]` | Detalle de nota |
|
||||
| `/new` | Crear nota |
|
||||
| `/edit/[id]` | Editar nota |
|
||||
| `/settings` | Exportar/importar |
|
||||
|
||||
---
|
||||
|
||||
## Notas Técnicas
|
||||
|
||||
- App Router (Next.js 13+)
|
||||
- Server Components para datos
|
||||
- Client Components para interactividad
|
||||
- Prisma con SQLite
|
||||
- Zod para validación
|
||||
- Errores API con formato `{ success, data, error, timestamp }`
|
||||
Reference in New Issue
Block a user