BlockBuddy

Your Safe Entry into Crypto β€” Education, Security, and Confidence powered by AI.

BlockBuddy is a native iOS app (iOS 17+, SwiftUI) that helps beginners understand cryptocurrency through bite-sized lessons, interactive quizzes, gamification, AI-powered explanations, and scam awareness training.


🎯 Vision

Make cryptocurrency easy, safe, and understandable for everyday people. Instead of focusing on trading or speculation, BlockBuddy focuses on education, security, confidence, and simple explanations.


🧠 Core Features

Feature Description
Daily Mini Lessons 30–90 second crypto lessons, one concept at a time
Interactive Quizzes Quick quizzes with XP rewards and streaks
AI Explain Paste wallet popups or transaction text β€” AI explains in simple language
Scam Awareness Fake vs real wallet examples, phishing detection, security simulations
Gamification XP, streaks, badges, levels (Beginner β†’ Intermediate β†’ Expert)
Push Notifications Daily facts, streak reminders, motivational nudges
Widget Home screen widget showing current streak

πŸ— Architecture

MVVM + Clean Architecture

View (SwiftUI)  ────────  ViewModel (@Observable)  ────────  UseCase
       β–²                         β”‚                              β”‚
       β”‚                         β–Ό                              β–Ό
   Renders UI             Holds UI state                 Business Logic
                          Calls UseCases                 Single Responsibility
                                                                 β”‚
                                                                 β–Ό
                                                          Repository
                                                              β”‚
                                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β–Ό                               β–Ό
                                        Data Source                      Data Source
                                         (Remote)                         (Local)
                                          β”‚                                 β”‚
                                    Firestore                          Core Data

πŸ“ Project Structure

BlockBuddy/
  β”œβ”€β”€ App/
  β”‚   β”œβ”€β”€ BlockBuddyApp.swift       // @main entry point
  β”‚   β”œβ”€β”€ AppView.swift             // Root tab navigation
  β”‚   └── AppState.swift            // Central state management
  β”œβ”€β”€ Core/
  β”‚   β”œβ”€β”€ AppIntents/               // Siri shortcuts
  β”‚   β”œβ”€β”€ Auth/                     // Sign in with Apple + Email
  β”‚   β”œβ”€β”€ Data/                     // Repositories + models
  β”‚   β”œβ”€β”€ Models/                   // Domain models
  β”‚   β”œβ”€β”€ Networking/               // URLSession + cert pinning
  β”‚   β”œβ”€β”€ Notifications/            // Push + local notifications
  β”‚   β”œβ”€β”€ Persistence/              // Core Data stack
  β”‚   β”œβ”€β”€ Security/                 // Jailbreak detection
  β”‚   └── Services/                 // AI, OCR, Keychain, StoreKit, etc.
  β”œβ”€β”€ DesignSystem/
  β”‚   β”œβ”€β”€ DesignSystem.swift         // Colors, typography, tokens
  β”‚   └── Components/               // Reusable SwiftUI views
  β”œβ”€β”€ Features/
  β”‚   β”œβ”€β”€ AIExplain/                // AI transaction explanation
  β”‚   β”œβ”€β”€ Admin/                    // Lesson draft review
  β”‚   β”œβ”€β”€ Auth/                     // Email sign-in
  β”‚   β”œβ”€β”€ Home/                     // Main learning feed
  β”‚   β”œβ”€β”€ Lessons/                  // Lesson detail view
  β”‚   β”œβ”€β”€ Onboarding/               // First-time experience
  β”‚   β”œβ”€β”€ Premium/                  // Paywall & subscriptions
  β”‚   β”œβ”€β”€ Profile/                  // User progress & stats
  β”‚   β”œβ”€β”€ Quiz/                     // Interactive quizzes
  β”‚   └── ScamAwareness/            // Scam training scenarios
  β”œβ”€β”€ NotificationService/          // Rich push extension
  β”œβ”€β”€ Resources/
  β”‚   β”œβ”€β”€ Assets.xcassets           // App icon, accent color
  β”‚   β”œβ”€β”€ en.lproj/                 // English localization
  β”‚   └── sv.lproj/                 // Swedish localization
  β”œβ”€β”€ Tests/
  β”‚   β”œβ”€β”€ UnitTests/                // XCTest unit tests
  β”‚   └── UITests/                  // XCUITest UI tests
  └── Widget/                       // WidgetKit extension

πŸ›  Tech Stack

Technology Purpose
Swift 5.10+ Primary language
SwiftUI Declarative UI framework
SwiftData Local persistence
Core Data Legacy persistence layer
Combine Reactive data bindings
VisionKit On-device OCR for screenshots
StoreKit 2 In-app purchases
Keychain Secure token storage
UserNotifications Push + local notifications
WidgetKit Home screen widgets
AppIntents Siri shortcuts
Firebase Auth, Firestore, FCM, Crashlytics

πŸ“‹ Requirements


πŸš€ Setup

1. Clone

git clone https://github.com/Rizgart/BlockBuddy.git
cd BlockBuddy

2. Open in Xcode

open BlockBuddy.xcodeproj

3. SPM Dependencies

SPM resolves automatically. Packages:

4. Firebase Setup (optional)

  1. Create a project at Firebase Console
  2. Download GoogleService-Info.plist
  3. Add it to the BlockBuddy/ folder in Xcode
  4. The app uses Firebase for: Auth, Firestore (lessons), FCM (push)

5. Server (optional AI proxy)

cd Server
cp .env.example .env
# Edit .env with your OpenAI API key
npm install
node src/server.js

The server proxies OpenAI GPT-4o requests. The iOS app uses the local AIExplanationService by default; configure ServerURL in the service to point to your server.

6. Run

Select the BlockBuddy scheme, choose an iOS 17 simulator, and press ⌘R.


πŸ§ͺ Tests

# Run unit tests
xcodebuild test -project BlockBuddy.xcodeproj -scheme BlockBuddy \
  -destination 'platform=iOS Simulator,name=iPhone 16 Pro'

# Run UI tests
xcodebuild test -project BlockBuddy.xcodeproj -scheme BlockBuddyUITests \
  -destination 'platform=iOS Simulator,name=iPhone 16 Pro'

To add test targets in Xcode:

  1. File β†’ New β†’ Target
  2. Select Unit Testing Bundle (name: BlockBuddyUnitTests)
  3. Select UI Testing Bundle (name: BlockBuddyUITests)
  4. Add the existing test files to each target:
    • Tests/UnitTests/AppStateTests.swift β†’ BlockBuddyUnitTests
    • Tests/UITests/BlockBuddyUITests.swift β†’ BlockBuddyUITests

🎨 Design System


πŸ” Security


πŸ“± App Store


πŸ“Š Gamification System


🚦 Monetization

Tier Features
Free Daily lessons, basic quizzes, 3 AI explanations/day
Premium Unlimited AI, scam detector, wallet risk analysis, personalized AI tutor

πŸ“„ License

Proprietary. All rights reserved.


πŸ‘€ Author

Nozad Teimouri


β€œThe safest way to start crypto.”