Junona Architecture

Montana Protocol iOS Messenger

Entry Point
📱
JunonaAIApp
JunonaAIApp.swift
Главная точка входа. SwiftUI App с условным рендерингом: авторизован → MainTabView, иначе → AuthView
Чаты
Папки
Юнона
Звонки
Ещё
@StateObject auth
Authentication
🔐
AuthService DEMO
Auth/AuthService.swift
Singleton сервис авторизации. Состояния: unauthorized → sendingCode → waitingForCode → verifying → creatingKeys → authorized
📝
AuthView READY
Auth/AuthView.swift
UI авторизации: ввод телефона (+7), код подтверждения (5 цифр), анимация генерации ключей
TabView Navigation
Main Views (Telegram-style)
💬
ChatsView
Views/ChatsView.swift
Список чатов с превью сообщений
📁
FoldersView
Views/FoldersView.swift
Папки для организации чатов
🤖
JunonaView
Views/JunonaView.swift
AI ассистент Юнона
📞
CallsView
Views/CallsView.swift
История звонков
⚙️
SettingsView
Views/SettingsView.swift
Профиль, VPN, приватность, выход
import MontanaCore
Shared Framework
🏔
MontanaCore
MontanaCore/Sources/MontanaCore/
Swift Package: MontanaTheme, PrivacyLevel, MontanaAddress, MontanaVPNManager, общие UI компоненты
🔑
ML-DSA-65
FIPS 204 Post-Quantum
Private: 4032 bytes | Public: 1952 bytes | Sig: 3309 bytes Address: mt + SHA256(pubkey)[:20]

Authentication Flow

1
Телефон
+7 XXX XXX XXXX
2
SMS Код
Demo: 12345
3
ML-DSA-65
Генерация ключей
4
Keychain
Сохранение
5
MainTabView
Authorized
iOS Framework
  • SwiftUI Declarative UI
  • Combine Reactive bindings
  • Security.framework Keychain access
  • CommonCrypto SHA-256 hashing
  • NetworkExtension VPN tunnel
Cryptography
  • ML-DSA-65 Post-quantum signatures
  • ML-KEM-768 Key encapsulation (VPN)
  • SHA-256 Address derivation
  • SecRandomCopyBytes Entropy source
Backend API
  • /api/v1/auth/send-code SMS verification
  • /api/v1/auth/verify Code validation
  • /api/v1/auth/register Account creation
  • /api/v1/user/profile Profile loading
Storage
  • Keychain Private/Public keys
  • UserDefaults User session
  • montana_user Profile JSON
  • montana_session Auth token

Project Structure

iOS/
├── Apps/
│   └── JunonaAI/
│       ├── JunonaAI.xcodeproj
│       └── JunonaAI/
│           ├── JunonaAIApp.swift     ← Entry point
│           ├── Auth/
│           │   ├── AuthService.swift   ← Auth logic
│           │   └── AuthView.swift      ← Auth UI
│           ├── Views/
│           │   ├── ChatsView.swift
│           │   ├── FoldersView.swift
│           │   ├── ContactsView.swift
│           │   ├── SettingsView.swift
│           │   └── VPNView.swift
│           └── VPN/
│               ├── MontanaVPN.swift
│               └── PostQuantumTunnel.swift
│
└── MontanaCore/                    ← Swift Package
    └── Sources/MontanaCore/
        └── MontanaCore.swift       ← Shared code