How kryptokrona/hugin-native works
Hugin is a React Native mobile app for decentralized messaging, group chat, voice/video calling, file sharing, and a Kryptokrona wallet. The user enters through the app shell and navigates authentication and main screens; messaging and wallet capabilities are backed by JavaScript services and a Bare runtime, with persistent client state and native crypto support. The excerpts show app startup, persisted stores, RPC dispatch, and peer-file storage; many screen-to-service connections are not sampled, so those links are left out rather than inferred.
Main entry points: main.js Bare RPC handler · App.tsx App shell · root-navigator.tsx Navigation · screens Messaging and wallet screens
Components 21
Mobile app
- App entry
index.js - App shell
src/App.tsx - Navigation
src/components/_navigation/root-navigator.tsx - Account screens
src/screens/_auth-screens - Messaging and wallet screens
src/screens
Messaging runtime
- Bare RPC handler
bare/main.js - Peer messaging
bare/swarm.js - Account runtime
bare/account.js - Peer file storage
bare/storage.js - Message operations
bare/messages.js - RPC client
src/lib/rpc.js - Bare service
src/services/bare - Call service
src/services/calls
Wallet
- Wallet service
src/services/kryptokrona
Identity and state
- Hugin identity
src/services/hugin - Persisted app state
src/services/zustand/async-storage-stores.ts
Native support
- Native crypto
android/app/src/main/jni/kryptokrona.cpp - Native bridge
android/app/src/main/java/com/hugin/TurtleCoinModule.java
Other components
- Mobile user
- Peer network
- Kryptokrona network
Connections 20
- Mobile user → App entry: opens app
- App entry → App shell: renders
- App shell → Navigation: mounts
- Navigation → Account screens: routes
- Navigation → Messaging and wallet screens: routes
- App shell → Persisted app state: reads theme
- Bare RPC handler → Account runtime: initializes
- Bare RPC handler → Message operations: dispatches message work
- Bare RPC handler → Peer messaging: dispatches peer work
- Bare RPC handler → Peer file storage: dispatches file work
- Peer messaging → Peer network: communicates
- Peer file storage → Peer network: shares files
- RPC client → Bare RPC handler: sends requests
- Bare service → RPC client: uses RPC
- Message operations → Peer network: sends messages
- Messaging and wallet screens → Wallet service: wallet actions
- Wallet service → Kryptokrona network: queries and submits
- Messaging and wallet screens → Call service: call features
- Account runtime → Hugin identity: uses identity
- Native bridge → Native crypto: invokes