{"id":51273641,"url":"https://github.com/maverick0322/taskify","last_synced_at":"2026-06-29T20:00:58.435Z","repository":{"id":363168010,"uuid":"1261753581","full_name":"maverick0322/Taskify","owner":"maverick0322","description":"Sistema distribuido \"Local-First\" con sincronización en tiempo real (Realtime) y resolución de concurrencia. Implementado con arquitectura de Sidecar (Go/Tauri) y PWA.","archived":false,"fork":false,"pushed_at":"2026-06-24T09:55:15.000Z","size":90552,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T11:23:30.436Z","etag":null,"topics":["architecture","distributed-systems","go","golang","local-first","pwa","react","realtime","sqlite","supabase","tauri"],"latest_commit_sha":null,"homepage":"https://taskify-steel-eta.vercel.app","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maverick0322.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T05:26:56.000Z","updated_at":"2026-06-24T09:55:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/maverick0322/Taskify","commit_stats":null,"previous_names":["maverick0322/taskify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maverick0322/Taskify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maverick0322%2FTaskify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maverick0322%2FTaskify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maverick0322%2FTaskify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maverick0322%2FTaskify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maverick0322","download_url":"https://codeload.github.com/maverick0322/Taskify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maverick0322%2FTaskify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34941027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","distributed-systems","go","golang","local-first","pwa","react","realtime","sqlite","supabase","tauri"],"created_at":"2026-06-29T20:00:24.252Z","updated_at":"2026-06-29T20:00:58.425Z","avatar_url":"https://github.com/maverick0322.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taskify - Local-First Architecture \u0026 Realtime Synchronization\n\n## 📖 Executive Summary\n\nTaskify is an operational management system built under the **Local-First** paradigm.\n\nThe platform addresses network latency, intermittent connectivity, and data-loss challenges by prioritizing local persistence and offline operation.\n\nKey characteristics:\n\n- ✅ 100% offline availability.\n- ✅ Local-first data ownership.\n- ✅ Bidirectional asynchronous synchronization.\n- ✅ Eventual consistency across multiple clients.\n- ✅ Realtime updates through WebSockets.\n- ✅ Cross-platform support (Desktop + PWA).\n\nThe system maintains a local source of truth and synchronizes state with cloud infrastructure whenever connectivity becomes available.\n\n---\n\n# 🏗️ System Architecture\n\nTaskify uses a hybrid architecture:\n\n- **Desktop Application:** Sidecar Pattern\n- **Web Application (PWA):** Traditional Client-Server Architecture\n\n## Technology Stack\n\n| Layer | Technology |\n|---------|------------|\n| Frontend | React + TypeScript + Vite |\n| UI Components | Tailwind CSS + shadcn/ui |\n| Desktop Host | Tauri (Rust) |\n| Synchronization Engine | Go (Golang) |\n| Local Database | SQLite |\n| Cloud Database | PostgreSQL (Supabase) |\n| Realtime Layer | Supabase Realtime (WebSockets) |\n\n---\n\n## Architecture Diagram\n\n```mermaid\nflowchart LR\n    subgraph Desktop[\"Desktop Client (Tauri)\"]\n        direction TB\n        DesktopUI[\"React UI\"]\n        GoMotor[\"Go Sync Motor (Sidecar)\"]\n        SQLite[(\"SQLite (Local State)\")]\n        \n        DesktopUI \u003c--\u003e|gRPC / HTTP| GoMotor\n        GoMotor \u003c--\u003e|Read / Write| SQLite\n    end\n\n    subgraph Web[\"Web Client (PWA)\"]\n        WebUI[\"React UI\"]\n    end\n\n    subgraph Cloud[\"Cloud Infrastructure\"]\n        direction TB\n        Postgres[(\"PostgreSQL (Supabase)\")]\n        WS[\"Realtime Server (WebSockets)\"]\n    end\n\n    GoMotor \u003c--\u003e|\"Async Sync (Pull/Push)\"| Postgres\n    WebUI \u003c--\u003e|\"REST API\"| Postgres\n    WebUI \u003c--\u003e|\"Subscribe (Events)\"| WS\n    WS --\u003e|\"Broadcast\"| GoMotor\n```\n\n---\n\n# 🔄 Synchronization Flow\n\n```text\n┌─────────────┐\n│ React UI    │\n└──────┬──────┘\n       │\n       ▼\n┌─────────────┐\n│ Go Sidecar  │\n└──────┬──────┘\n       │\n       ▼\n┌─────────────┐\n│ SQLite      │\n└──────┬──────┘\n       │\n       │ Sync when online\n       ▼\n┌─────────────┐\n│ PostgreSQL  │\n│ Supabase    │\n└──────┬──────┘\n       │\n       ▼\n┌─────────────┐\n│ Realtime WS │\n└─────────────┘\n```\n\n---\n\n# 📐 Architectural Decision Records (ADRs)\n\n## ADR-001: Conflict Resolution Strategy (Last Write Wins)\n\n### Context\n\nIn a Local-First environment, multiple clients may modify the same entity while disconnected from the network.\n\n### Decision\n\nImplement a **Last Write Wins (LWW)** conflict resolution strategy using UTC timestamps (`updated_at`).\n\n### Benefits\n\n- Simple implementation.\n- Predictable synchronization behavior.\n- High availability.\n- Better user experience during offline operation.\n\n### Trade-off\n\nThe system favors:\n\n- Availability\n- Responsiveness\n- Offline operation\n\nover:\n\n- Immediate strong consistency\n- Distributed transaction coordination\n\n---\n\n## ADR-002: Soft Deletes for Synchronization Integrity\n\n### Context\n\nPhysical deletions (`DELETE`) generated synchronization race conditions because removed records left no synchronization trail.\n\n### Decision\n\nReplace hard deletes with logical deletions using:\n\n```sql\ndeleted_at TIMESTAMP NULL\n```\n\n### Benefits\n\n- Deterministic synchronization.\n- Full auditability.\n- Historical recovery.\n- Simplified conflict resolution.\n\n### Consequences\n\nAll domain queries must filter logically deleted records.\n\n---\n\n## ADR-003: Production Credential Isolation\n\n### Context\n\nDesktop binaries distribute executable code directly to end users.\n\nExposing infrastructure credentials inside the application package creates significant security risks.\n\n### Decision\n\nAvoid shipping static environment secrets.\n\nConfiguration is injected securely during the build and deployment process.\n\n### Benefits\n\n- Reduced attack surface.\n- Safer enterprise deployments.\n- Better secret management practices.\n\n### Operational Rule\n\n- `frontend/.env` must contain only public client variables.\n- Privileged credentials such as `REMOTE_DB_URL`, `JWT_SECRET`, and `SUPABASE_SERVICE_ROLE_KEY` must live only in backend/runtime secret stores.\n- Developers should create local `.env` files from the tracked `.env.example` templates; real `.env` files must stay untracked.\n- Desktop Tauri builds must use `REMOTE_API_URL` for cloud synchronization and must not embed direct database credentials inside the executable.\n\n---\n\n# 🔐 Security\n\n## Row Level Security (RLS)\n\nThe cloud database uses PostgreSQL Row Level Security policies to guarantee tenant isolation.\n\nFeatures:\n\n- JWT-based authentication.\n- Tenant-aware authorization.\n- Secure realtime subscriptions.\n- Data isolation between organizations.\n\n---\n\n## Realtime Security\n\nWebSocket payloads are protected through authenticated Supabase channels.\n\nSecurity goals:\n\n- Prevent unauthorized subscriptions.\n- Prevent tenant data leakage.\n- Maintain end-to-end authorization enforcement.\n\n---\n\n# 🎨 User Experience (UX)\n\nThe user interface follows established usability principles inspired by Nielsen's heuristics.\n\n### Design Goals\n\n- Immediate feedback.\n- Offline visibility.\n- Synchronization transparency.\n- Responsive interactions.\n- Minimal user disruption.\n\n### Examples\n\n- Network status indicators.\n- Synchronization progress feedback.\n- Automatic reconnection handling.\n- Light/Dark theme transitions.\n- Optimistic UI updates.\n\n---\n\n# ⚡ Key Quality Attributes\n\n| Attribute | Strategy |\n|------------|-----------|\n| Availability | Local SQLite persistence |\n| Reliability | Asynchronous synchronization |\n| Performance | Local reads and writes |\n| Scalability | Event-driven synchronization |\n| Security | RLS + JWT |\n| Maintainability | Sidecar architecture |\n| Portability | Tauri Desktop + PWA |\n| Usability | Offline-first UX |\n\n---\n\n# 🚀 Build \u0026 Deployment Guide\n\n## Prerequisites\n\n### Node.js\n\n```bash\n\u003e= 18.x\n```\n\n### Go\n\n```bash\n\u003e= 1.21\n```\n\n### Rust\n\nRequired for:\n\n- Cargo\n- Tauri\n\nInstall from:\n\nhttps://www.rust-lang.org/tools/install\n\n---\n\n# 🖥️ Production Build (Windows x64)\n\nThe current build process uses a manual pipeline (pre-CI/CD).\n\nGoals:\n\n- Optimize executable size.\n- Hide sidecar terminal window.\n- Improve startup performance.\n\n---\n\n## Step 1: Build the Go Synchronization Engine\n\n```bash\ncd backend\n\ngo build \\\n  -trimpath \\\n  -ldflags=\"-H windowsgui -s -w\" \\\n  -o ../frontend/src-tauri/bin/backend-x86_64-pc-windows-msvc.exe \\\n  ./cmd\n```\n\n### Flags Explained\n\n| Flag | Purpose |\n|--------|----------|\n| `-H windowsgui` | Hides console window |\n| `-s` | Removes symbol table |\n| `-w` | Removes debug information |\n| `-trimpath` | Removes local filesystem paths from build metadata |\n\nThe automated desktop build already uses these release flags through `frontend/package.json`.\n\n---\n\n## Step 2: Package Desktop Application\n\n```bash\ncd ../frontend\n\nnpm install\n\nnpm run tauri build\n```\n\nGenerated artifacts:\n\n```text\nfrontend/src-tauri/target/release/bundle/\n```\n\n---\n\n# Desktop Release Hardening\n\n## What is already hardened\n\n- Desktop sync uses `REMOTE_API_URL`; it no longer connects directly to remote Postgres.\n- Remote sync tokens are stored in the operating system keychain through Tauri, not in desktop `localStorage`.\n- Desktop logout clears the secure session, clears the local sync session, and purges the local SQLite data store.\n- The Tauri webview capability no longer exposes generic shell execution permissions.\n- The Go sidecar release build hides the terminal window and strips debug-heavy metadata.\n\n## Release Checklist\n\n1. Secrets and configuration\n   - Verify `frontend/.env` contains only public values.\n   - Verify desktop build environment sets `REMOTE_API_URL` to the production backend URL.\n   - Verify Render production environment contains `JWT_SECRET`, `SUPABASE_SERVICE_ROLE_KEY`, and any database credentials only on the server side.\n   - Verify Supabase keys rotated during phase 1 are the only active ones.\n\n2. Backend and sync\n   - Confirm `/sync/push` and `/sync/pull` are deployed on Render.\n   - Confirm JWT auth is required for both endpoints.\n   - Confirm remote CORS allows the desktop local origin flow already used by the app.\n   - Confirm a real user can login on desktop, create a task offline, reconnect, and see it appear on web.\n\n3. Desktop executable\n   - Run `npm run tauri:build` from `frontend`.\n   - Install the generated `.msi` or `.exe` from `frontend/src-tauri/target/release/bundle/`.\n   - Verify the app starts without a visible sidecar console window.\n   - Verify window dragging, maximize, minimize, and close still work.\n   - Verify desktop relaunch restores the session from the OS keychain.\n   - Verify logout returns to an empty local state after restart.\n\n4. Data safety\n   - Export a backup from the desktop app and verify the SQLite file opens.\n   - Verify purge on logout does not delete files outside the Taskify app data folder.\n   - Verify avatar selection and local backup export still work in release mode.\n\n5. Distribution\n   - Verify app icon, product name, and version are correct in the installer.\n   - Code-sign the Windows installer/executable if you plan external distribution.\n   - Run one clean install test on a machine that never had Taskify installed.\n\n6. Final smoke test\n   - Desktop login\n   - Create/edit/delete data\n   - Sync to web\n   - Web change syncs back to desktop\n   - Restart desktop\n   - Logout\n   - Login as another user on the same machine\n\n---\n\n# 📦 Deployment Targets\n\n- Windows Desktop (.msi)\n- Windows Desktop (.exe)\n- Progressive Web App (PWA)\n\nFuture targets:\n\n- macOS\n- Linux\n- Self-hosted synchronization backend\n\n---\n\n# 🌟 Core Features\n\n- Local-First Architecture\n- Offline Operation\n- Realtime Synchronization\n- SQLite Local Database\n- PostgreSQL Cloud Database\n- WebSocket Updates\n- Desktop Application (Tauri)\n- Progressive Web App (PWA)\n- Multi-Client Synchronization\n- Eventual Consistency\n- Conflict Resolution (LWW)\n- Soft Delete Synchronization\n- JWT Authentication\n- Row Level Security (RLS)\n\n---\n\n# 📄 License\n\nThis project is distributed under the terms defined in the repository license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaverick0322%2Ftaskify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaverick0322%2Ftaskify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaverick0322%2Ftaskify/lists"}