Index <= Page index / Phase => Phase 2 – Docs + fichiers .enc (fake crypto)
Endpoints CRUD documents, stockage binaire + métadonnées JSON, contenu encore en clair (chiffrement réel prévu en phase 6).
storage/docs/<doc_id>.bin.storage/meta/<doc_id>.json avec : sha256, size, enc (false pour l’instant), tags, timestamps.{
"doc_id": "DOC-0001",
"name": "circular_mayors.pdf",
"sha256": "abc123...",
"size": 123456,
"enc": false,
"tags": ["p1", "mayor", "doc"],
"created_at": "2025-12-10T14:00:00Z",
"updated_at": "2025-12-10T14:00:00Z"
}
curl -X POST http://localhost:8000/api/v1/docs \
-H "Content-Type: application/json" \
-d '{
"doc_id": "DOC-0001",
"name": "circular_mayors.pdf",
"content_b64": "...",
"tags": ["p1","mayor"]
}'
curl http://localhost:8000/api/v1/docs/DOC-0001
curl -X DELETE http://localhost:8000/api/v1/docs/DOC-0001
Réception du content_b64, décodage vers SPIFFS ou SD (mode test). Exemple minimal :
#include <Base64.h>
// Pseudocode : write decoded bytes to SPIFFS
// fs::File f = SPIFFS.open("/doc.bin", "w");
// f.write(decoded, decodedLen);