Yarnin Peled YP Monogram Logo
Yarnin Peledponyapp.net
Back to All ApplicationsTECHNICAL OVERVIEW — PART 2

StokApp Technical Overview

System Architecture, Data Pipelines, & Integration Specification

The shape of the app for an engineer getting oriented — architecture, data flow, and integrations at a level that explains the design without doubling as a build spec.

Platform & Tech Stack

Core technologies powering StokApp across Apple platforms:

SwiftUI Codebase

Single unified codebase for macOS 14+, iOS 17+, iPadOS 17+ with narrowly-scoped #if os() platform branches.

SwiftData + CloudKit

All user data stored in SwiftData backed by CloudKit — one shared container per iCloud account.

Anthropic Messages API

Powers scan ranking, Chat, Deep Dive lenses, and Batch synthesis. Uses web_search tool for Research lens.

Pluggable Provider Layer

Decoupled market data interface supporting EODHD, Twelve Data, Finnhub, Alpha Vantage, and TASE Data Hub.

Zero Server Overhead

No third-party UI framework or bundled backend server; client talks directly to APIs, Gmail SMTP, and Webhooks.

Architecture at a Glance

StokApp follows a clean reactive architecture centered around a single shared AppState environment object. AppState owns a set of thin SwiftData reader/writer Stores and thin API client Services. No SwiftUI view talks to CloudKit or Anthropic directly.

System Flow Diagram
SwiftUI ViewsToday, Recommendations, Portfolio, Deep Dive, Chat
AppStateSingle shared injected environment object
Stores & ServicesSwiftData Stores + Thin External System Services
Reading this: every screen reads and writes through one shared AppState, which owns thin Stores (SwiftData reader/writers) and Services (external system clients).

Sync & Persistence Matrix

Where each data type lives and how it syncs across devices:

Data TypeSync ChannelChannel Detail & Security
Logged actions, positions (derived), watchlist (derived)SwiftData / CloudKitSynced automatically with last-write-wins conflict resolution across user devices.
Portfolio rules, target weights, universe, deep dives, batch reports, chat, briefsSwiftData / CloudKitPersisted in shared iCloud container for full read/write access everywhere.
App settings — model choice, enabled markets, delivery togglesiCloud Key-Value StoreLightweight settings sync across all signed-in iCloud devices.
Anthropic API key, provider credentials, SMTP password, webhook URLiCloud KeychainEncrypted using Safari-grade Keychain security, never stored in plain text.
Whole-market symbol pool, screener sweep cache, price history cacheLocal Disk OnlyLarge, rebuildable caches stored locally per device and never synced over network.

External Integrations

Direct integration endpoints used by StokApp:

SystemUsed ForNotes & Capabilities
Anthropic Messages APIScan ranking, Chat, Deep Dive, Batch synthesisUser-supplied key; Research lens & Batch use web_search tool
Market Data Providers (EODHD, Twelve Data, Finnhub, Alpha Vantage, TASE)Quotes, historical price data, dividendsOne credential per provider; auto-detects EOD vs Live capability
Gmail SMTPScheduled morning and close briefsApp-specific password, direct SMTP, no third-party email server
User WebhookOptional brief delivery automationOff by default; routes briefs into user's personal webhooks
Sparkle FrameworkmacOS app updatesEdDSA-signed appcast pointing to secure distribution binaries

Constraints & Non-Goals

Single-User by Design

Sync is built exclusively for one person's own devices. No multi-user merge UI is required.

No Background Execution on iOS/iPadOS

Scheduled briefs are Mac-only. Phones and tablets run scans on-demand.

Never Executes a Trade

Intentionally contains zero brokerage integrations and zero order-placement code.

Provider-Dependent Data Quality

Coverage and field accuracy depend on the user's chosen market data provider.