diff --git a/docs/WHY_NOT_HAPPY.md b/docs/WHY_NOT_HAPPY.md index 45f66ba2..29aad4cd 100644 --- a/docs/WHY_NOT_HAPPY.md +++ b/docs/WHY_NOT_HAPPY.md @@ -24,48 +24,48 @@ HAPI's local-first design simplifies everything: ``` ┌─────────────────────────────────────────────────────────────────────────────────┐ -│ PUBLIC INTERNET │ -│ │ -│ │ -│ ┌─────────────┐ ┌─────────────────────────────────┐ │ -│ │ │ │ │ │ -│ │ Mobile App │◄─────── E2EE ───────►│ Cloud Server │ │ -│ │ │ │ │ │ -│ └─────────────┘ │ ┌───────────────────────────┐ │ │ -│ │ │ │ │ │ -│ │ │ Encrypted Database │ │ │ -│ │ │ (server cannot read) │ │ │ -│ │ │ │ │ │ -│ │ └───────────────────────────┘ │ │ -│ │ │ │ -│ └────────────────┬────────────────┘ │ -│ │ │ -│ │ E2EE │ -│ │ │ -└────────────────────────────────────────────────────────────┼─────────────────────┘ +│ PUBLIC INTERNET │ +│ │ +│ │ +│ ┌─────────────┐ ┌─────────────────────────────────┐ │ +│ │ │ │ │ │ +│ │ Mobile App │◄─────── E2EE ───────►│ Cloud Server │ │ +│ │ │ │ │ │ +│ └─────────────┘ │ ┌───────────────────────────┐ │ │ +│ │ │ │ │ │ +│ │ │ Encrypted Database │ │ │ +│ │ │ (server cannot read) │ │ │ +│ │ │ │ │ │ +│ │ └───────────────────────────┘ │ │ +│ │ │ │ +│ └────────────────┬────────────────┘ │ +│ │ │ +│ │ E2EE │ +│ │ │ +└──────────────────────────────────────────────────────────────┼───────────────────┘ │ -┌────────────────────────────────────────────────────────────┼─────────────────────┐ -│ PRIVATE NETWORK │ │ -│ │ │ -│ ▼ │ +┌──────────────────────────────────────────────────────────────┼─────────────────────┐ +│ PRIVATE NETWORK │ │ +│ │ │ +│ ▼ │ │ ┌──────────────────────────────────────────────┐ │ -│ │ │ │ -│ │ CLI │ │ -│ │ │ │ +│ │ │ │ +│ │ CLI │ │ +│ │ │ │ │ │ ┌────────────────────────────────────┐ │ │ -│ │ │ Encryption Keys │ │ │ -│ │ │ (only client holds the keys) │ │ │ +│ │ │ Encryption Keys │ │ │ +│ │ │ (only client holds the keys) │ │ │ │ │ └────────────────────────────────────┘ │ │ -│ │ │ │ +│ │ │ │ │ └──────────────────────────────────────────────┘ │ -│ │ -└──────────────────────────────────────────────────────────────────────────────────┘ +│ │ +└───────────────────────────────────────────────────────────────────────────────────┘ Data Flow: -┌──────────────────────────────────────────────────────────────────────────────────┐ +┌────────────────────────────────────────────────────────────────────────────────────┐ │ │ -│ CLI ◄───────► Cloud Server ◄───────► App │ +│ CLI ◄───────► Cloud Server ◄───────► App │ │ │ │ │ │ │ │ (encrypt) │ (ciphertext) │ (decrypt) │ │ ▼ ▼ ▼ │ @@ -76,24 +76,24 @@ Data Flow: │ encrypted blobs │ │ (zero knowledge) │ │ │ -└──────────────────────────────────────────────────────────────────────────────────┘ +└────────────────────────────────────────────────────────────────────────────────────┘ ``` ### HAPI: Local-First ``` -┌──────────────────────────────────────────────────────────────────────────────────┐ +┌────────────────────────────────────────────────────────────────────────────────────┐ │ PRIVATE NETWORK │ │ │ -│ ┌────────────────────────────────────────────────────────────────────────┐ │ +│ ┌──────────────────────────────────────────────────────────────────────────┐ │ │ │ │ │ │ │ Single Process / Binary │ │ │ │ │ │ -│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ +│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ CLI │◄──►│ Server │◄──►│ Web App │ │ │ │ │ │ │ │ │ │ (embedded) │ │ │ -│ │ └──────────────┘ └──────┬───────┘ └──────────────┘ │ │ +│ │ └──────────────┘ └──────┬───────┘ └──────────────┘ │ │ │ │ │ │ │ │ │ ▼ │ │ │ │ ┌────────────────┐ │ │ @@ -103,37 +103,37 @@ Data Flow: │ │ │ │ │ │ │ │ └────────────────┘ │ │ │ │ │ │ -│ └────────────────────────────────────────────────────────────────────────┘ │ +│ └──────────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ │ localhost │ -└────────────────────────────────────────┼─────────────────────────────────────────┘ +└────────────────────────────────────────┼───────────────────────────────────────────┘ │ ▼ -┌────────────────────────────────────────────────────────────────────────────────┐ +┌───────────────────────────────────────────────────────────────────────────────────┐ │ TUNNEL (Optional) │ │ │ │ localhost ────────► public URL (TLS) │ │ │ -└────────────────────────────────────────┬────────────────────────────────────────┘ +└────────────────────────────────────────┬──────────────────────────────────────────┘ │ ▼ -┌────────────────────────────────────────────────────────────────────────────────┐ +┌───────────────────────────────────────────────────────────────────────────────────┐ │ PUBLIC INTERNET │ │ │ -│ ┌───────────────────────────────┐ │ +│ ┌───────────────────────────────┐ │ │ │ │ │ │ │ Remote Clients │ │ │ │ (PWA / Mini App) │ │ │ │ │ │ -│ └───────────────────────────────┘ │ +│ └───────────────────────────────┘ │ │ │ -└─────────────────────────────────────────────────────────────────────────────────┘ +└───────────────────────────────────────────────────────────────────────────────────┘ Data Flow: -┌──────────────────────────────────────────────────────────────────────────────────┐ +┌────────────────────────────────────────────────────────────────────────────────────┐ │ │ -│ CLI ◄────────► Server ◄────────► App │ +│ CLI ◄────────► Server ◄────────► App │ │ │ │ │ │ (same machine / process) │ │ ▼ │ @@ -145,7 +145,7 @@ Data Flow: │ external access │ │ (TLS encryption) │ │ │ -└──────────────────────────────────────────────────────────────────────────────────┘ +└────────────────────────────────────────────────────────────────────────────────────┘ ``` --- @@ -164,30 +164,30 @@ Data Flow: ``` Happy: -┌─────────────────────────────────────────────────────────────────────┐ +┌───────────────────────────────────────────────────────────────────────┐ │ │ │ Distributed Services (4+ components) │ │ │ -│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ +│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Database │ │ Cache │ │ Storage │ │ Server │ │ -│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ +│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │ │ │ Requires: Container orchestration, multiple config files │ │ │ -└─────────────────────────────────────────────────────────────────────┘ +└───────────────────────────────────────────────────────────────────────┘ HAPI: -┌─────────────────────────────────────────────────────────────────────┐ +┌───────────────────────────────────────────────────────────────────────┐ │ │ │ Single Binary (everything bundled) │ │ │ -│ ┌─────────────────────────────────────────────────────────────┐ │ -│ │ CLI + Server + Web App + Database (embedded) │ │ -│ └─────────────────────────────────────────────────────────────┘ │ +│ ┌─────────────────────────────────────────────────────────────┐ │ +│ │ CLI + Server + Web App + Database (embedded) │ │ +│ └─────────────────────────────────────────────────────────────┘ │ │ │ │ Requires: One command to run │ │ │ -└─────────────────────────────────────────────────────────────────────┘ +└───────────────────────────────────────────────────────────────────────┘ ``` ### 2.3 Security Approach