System Overview & Architecture
The Delauretis Personal Finance API serves as the high-integrity analytical replica and reporting engine for personal finances, budgeting, and asset tracking.
Core Tenets
- Notion as Operational Source of Truth: Day-to-day transaction entry, mobile captures, and Mango/GrokBot workflows occur within Notion.
- Cloudflare D1 as Transactional Engine: The API persists all records into Cloudflare D1 (SQLite engine at the edge) under binding
FINANZAS_DB(f8e26b69-cfb2-439e-bb3f-cecc5890846d). - Integer Minor Units: All monetary amounts are stored in minor units as signed or unsigned 64-bit integers (
amount_minor). Floating point numbers are strictly rejected to avoid precision drift. - No-Duplicate-Credit Rule: Credit card purchases are recorded once as an expense. The subsequent bank-to-card bill payment transfers funds and never counts as a secondary expense.
- Strict Tenant & Identity Isolation: Every record enforces
owner_id. Human read access is cryptographically restricted exclusively tonicolasdelauretis122@gmail.com.
System Topology
flowchart TD
User([Nicolás De Lauretis]) -->|Google OAuth 2.0| Access[Cloudflare Access Edge]
Access -->|Verified Google Identity| ReadAPI[Nitro / Cloudflare Workers API]
GrokBot[GrokBot / Mango Ingestion] -->|X-API-Key + Idempotency-Key| IngestEndpoint[POST /v1/finances/changes]
IngestEndpoint -->|Atomic Batch + CAS| D1[(Cloudflare D1 FINANZAS_DB)]
ReadAPI -->|Analytic Queries| D1
DocsSite[docs.delauretis.com.ar] -->|Protected by Cloudflare Access| Docusaurus[Private Docs Engine]
Host Distribution
- Production API:
https://api.delauretis.com.ar(with path prefix/v1/finances) - Backwards-Compatible Path:
https://api.delauretis.com.ar/v1/finanzas - Private Documentation:
https://docs.delauretis.com.ar - User Dashboard:
https://delauretis.com.ar/dashboard/finanzas