{"id":49401375,"url":"https://github.com/rafaelesantos/prism","last_synced_at":"2026-04-28T18:04:51.842Z","repository":{"id":287760450,"uuid":"965704828","full_name":"rafaelesantos/prism","owner":"rafaelesantos","description":"A modular Swift package — foundation, networking, architecture, adaptive UI, media, and on-device intelligence for Apple platforms.","archived":false,"fork":false,"pushed_at":"2026-04-27T20:39:01.000Z","size":2623,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-27T21:17:04.554Z","etag":null,"topics":["accessibility","analytics","clean-architecture","coreml","design-system","gitflow","ios","localization","macos","swift","swift-package-manager","swiftui"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafaelesantos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2025-04-13T18:26:36.000Z","updated_at":"2026-04-27T20:39:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0b4c1e7-8eea-42ff-a518-3b981af98773","html_url":"https://github.com/rafaelesantos/prism","commit_stats":null,"previous_names":["rafaelesantos/refds","rafaelesantos/prism"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rafaelesantos/prism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelesantos%2Fprism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelesantos%2Fprism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelesantos%2Fprism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelesantos%2Fprism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelesantos","download_url":"https://codeload.github.com/rafaelesantos/prism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelesantos%2Fprism/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["accessibility","analytics","clean-architecture","coreml","design-system","gitflow","ios","localization","macos","swift","swift-package-manager","swiftui"],"created_at":"2026-04-28T18:04:37.251Z","updated_at":"2026-04-28T18:04:51.830Z","avatar_url":"https://github.com/rafaelesantos.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/v/release/rafaelesantos/prism?style=flat-square\u0026color=blue\" alt=\"Release\"\u003e\n  \u003cimg src=\"https://github.com/rafaelesantos/prism/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Swift-6.3-F05138?style=flat-square\u0026logo=swift\u0026logoColor=white\" alt=\"Swift 6.3\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platforms-iOS_|_macOS_|_tvOS_|_watchOS_|_visionOS-blue?style=flat-square\" alt=\"Platforms\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Architecture-Clean_+_UDF-purple?style=flat-square\" alt=\"Architecture\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Concurrency-Strict-orange?style=flat-square\" alt=\"Concurrency\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green?style=flat-square\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n# Prism\n\nA modular Swift package for building Apple-platform apps — shared foundation, networking, architecture, adaptive UI, media, and on-device intelligence.\n\n\u003e **542 tests** · **113 suites** · **7 modules** · **Swift 6.3 strict concurrency** · **DocC on every public API**\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────┐\n│                    Prism                        │  ← umbrella re-export\n├──────────┬──────────┬───────────┬───────────────┤\n│ PrismUI  │PrismVideo│PrismIntel.│PrismArchitect.│  ← feature modules\n├──────────┴──────────┴───────────┴───────────────┤\n│                PrismNetwork                     │  ← transport layer\n├─────────────────────────────────────────────────┤\n│               PrismFoundation                   │  ← zero-dep core\n└─────────────────────────────────────────────────┘\n```\n\n| Module | Role |\n|--------|------|\n| `PrismFoundation` | Entities, logging, analytics, locale, resources, defaults, formatting |\n| `PrismNetwork` | HTTP client, socket transport, endpoints, caching, FIX protocol |\n| `PrismArchitecture` | Router, store, reducer, middleware — unidirectional data flow |\n| `PrismUI` | Token-driven design system — 80+ components, 4 themes, Apple HIG |\n| `PrismVideo` | Video download helpers and media entities |\n| `PrismIntelligence` | CreateML training, CoreML inference, Apple Intelligence, remote LLM |\n| `Prism` | Umbrella — `import Prism` gives you everything |\n\n---\n\n## Install\n\n```swift\n// Package.swift\ndependencies: [\n    .package(url: \"https://github.com/rafaelesantos/prism.git\", from: \"1.0.0\")\n]\n```\n\n```swift\nimport Prism          // everything\nimport PrismUI        // just design system\nimport PrismNetwork   // just networking\n```\n\n**Requires:** Swift 6.3 · Xcode 16.4+ · iOS 26 · macOS 26 · tvOS 26 · watchOS 26 · visionOS 26\n\n---\n\n## PrismUI Design System\n\n### Tokens\n\nSix semantic token types drive every visual decision:\n\n| Token | Purpose | Values |\n|-------|---------|--------|\n| `ColorToken` | 28 semantic color roles | brand, surfaces, content, feedback |\n| `TypographyToken` | Text styles with weights | largeTitle → caption2 |\n| `SpacingToken` | 4pt grid system | 0–64pt |\n| `RadiusToken` | Continuous corners | sm(8) → full(1000) |\n| `ElevationToken` | Shadow hierarchy | flat → overlay |\n| `MotionToken` | Reduce-motion-aware | instant → expressive |\n\n### Themes\n\n| Theme | Description |\n|-------|-------------|\n| `DefaultTheme` | Apple HIG system colors, auto light/dark |\n| `DarkTheme` | Always-dark, ignores system appearance |\n| `HighContrastTheme` | Maximum contrast for accessibility |\n| `BrandTheme` | Configurable primary/secondary/accent |\n\n```swift\n// Apply theme\nContentView()\n    .prismTheme(DefaultTheme())\n\n// Custom brand\nlet theme = BrandTheme(primary: .indigo, secondary: .mint, accent: .orange)\n```\n\n### Components (60+)\n\n**Primitives:** Button, Icon, AsyncImage, TextField, Card, Tag, Chip, Divider, LoadingState, ProgressBar, Avatar\n\n**Composites:** Alert, Banner, Carousel, SearchBar, Toolbar, Toast, Menu, BottomSheet, Tooltip, EmptyState, CountdownTimer\n\n**Forms:** Toggle, Picker, Slider, SecureField, DatePicker, SegmentedControl, Stepper, TextArea, Rating, PinField, ColorWell\n\n**Lists:** Row, DisclosureRow, List, Badge, SwipeActions\n\n**Layout:** AdaptiveStack, Grid, Section, Scaffold, Spacer\n\n**Navigation:** NavigationView, TabView, Sheet\n\n### Usage\n\n```swift\n// Themed button with async action\nPrismButton(\"Sign In\", variant: .filled) {\n    await viewModel.signIn()\n}\n\n// Validated text field\nPrismTextField(\"Email\", text: $email, validation: .pattern(\n    \"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,}\",\n    \"Enter a valid email\"\n))\n\n// Semantic modifiers\nText(\"Welcome\")\n    .prismFont(.title)\n    .prismColor(.onBackground)\n    .prismPadding(.lg)\n    .prismSurface(.surfaceSecondary, radius: .lg)\n\n// Auto-dismissing toast\n.prismToast(isPresented: $showToast, \"Saved!\", icon: \"checkmark\", style: .success)\n\n// Avatar with status\nPrismAvatar(initials: \"JD\", size: .large, status: .online)\n```\n\n---\n\n## State Management\n\n```swift\nlet store = PrismStore(\n    initialState: AppState(),\n    reducer: appReducer\n)\n\nstore.send(.loadData)\n```\n\n## Analytics\n\n```swift\nContentView()\n    .prismAnalytics(FirebaseAnalytics())\n\n// Track screen views\nContentView()\n    .prismTrackScreen(\"Home\")\n```\n\n## Intelligence\n\n```swift\n// Train from any Codable\nlet training = PrismCodableTrainingData(data: houses)\nlet result = await training.trainRegressor(\n    id: \"price\", name: \"House Price\", target: \\.price\n)\n\n// Predict\nlet client = try await PrismIntelligenceClient.local(modelID: \"price\")\nlet prediction = try await client.regress(\n    features: [\"rooms\": .int(3), \"area\": .double(120)]\n)\n\n// Remote LLM\nlet remote = PrismIntelligenceClient.remote(\n    endpoint: url, token: \"sk-...\", model: \"gpt-4\"\n)\nlet answer = try await remote.generate(\"Summarize this document.\")\n```\n\n---\n\n## Development\n\n```bash\nmake format          # swift-format in-place\nmake lint            # strict lint check\nmake build           # build all targets + tests\nmake test            # test with coverage\nmake validate        # format → lint → build → test\nmake docs            # generate DocC\nmake docs-serve      # DocC + local server at :8000\n```\n\n---\n\n## Quality\n\n| Check | Status |\n|-------|--------|\n| Tests | 275+ across 44 suites |\n| Concurrency | Strict — `Sendable`, `@MainActor`, actor isolation |\n| Formatting | `swift-format` enforced in CI |\n| Docs | DocC with guides: Getting Started, Tokens, Components, Theming |\n| Themes | 4 built-in + custom theme protocol |\n| Accessibility | VoiceOver, Dynamic Type, contrast ratios, reduce motion |\n| Snapshot Testing | Built-in `PrismSnapshotTest` for visual regression |\n| WCAG | Contrast ratio validation (AA/AAA) via `PrismAccessibilityTest` |\n\n---\n\n## License\n\n[MIT](LICENSE)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eswift · swiftui · ios · macos · swift-package-manager · clean-architecture · design-system · coreml · accessibility · localization · analytics\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelesantos%2Fprism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelesantos%2Fprism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelesantos%2Fprism/lists"}