How kaiju-no-9/sol_lite works
What this project is (type + purpose)
This is a mobile client (Expo / React Native + TypeScript) that connects to a Solana wallet, retrieves wallet-related data (balances/tokens) and displays transaction history. The README describes a “mobile app that retrieve data from your solana wallet and display it along with transition history.”
There is no backend service visible in the file tree (no server folder, no API routes, no database). Architecturally, it’s a client-only app that likely talks directly to:
• Solana RPC (for on-chain account/transaction data)
• Possibly 3rd-party Solana indexing APIs (e.g., Solscan-like explorers) if used for richer history/token metadata (not explicit in README, but the app naming suggests this might exist)
Routing / Screens (Expo Router)
The app/ directory indicates expo-router routing:
• app/_layout.tsx and app/(tabs)/_layout.tsx define navigation layout (root stack + tab navigator)
• app/(tabs)/index.tsx, explorer.tsx, swap.tsx, settings.tsx are tab screens
• app/orders.tsx is a non-tab route (likely pushed from a tab)
• app/token/[mint].tsx is a dynamic route for viewing a specific token by mint address
Shared app logic
• src/store/wallet.ts is a wallet state management module (connection state, selected wallet/account, public key, etc.)
• src/lib/lib.tsx is a library/util layer (usually: RPC calls, formatting, helpers, Solana SDK wrappers)
• src/components/FavButton.tsx is a reusable UI component (favoriting tokens/addresses/items)
Duplicate top-level trees
You have two parallel app roots:
• SolScan/...
• and also the same structure at repository root (app/, assets/, package.json, etc.)
What to capture
Because there’s no backend, the “system” is primarily:
• Mobile App (UI + navigation)
• State layer (wallet store)
• Data access layer (Solana RPC / external APIs)
• Optional: OS-level secure storage / deep links (not shown, but common in wallet apps—only include if truly present in code)
Goal: Show user, the app, and external dependencies.
• User
• Sol_lite Mobile App (iOS/Android)
• Solana Blockchain (conceptual)
• Solana RPC Provider (QuickNode/Helius/Alchemy/public RPC — name unknown; label generically as “RPC endpoint”)
• Swap/DEX Aggregator (optional) (because there is a swap.tsx tab; include as “Swap Quote/Swap API” if it exists in code)
• User → Mobile App: “view wallet, browse tokens, view tx history”
• Mobile App → RPC Provider: “get account info, token accounts, transactions”
• RPC Provider → Solana Blockchain: “RPC queries / reads”
• (Optional) Mobile App → Indexing API: “enhanced tx history, token metadata”
• (Optional) Mobile App → Swap API: “quotes, routes, build tx”
Notes to label:
• “Client-only; no dedicated backend in repo”
• “Reads on-chain state via RPC; may supplement with indexing”
Goal: Show the internal “containers” even if they’re all inside a mobile app.
Containers inside the Mobile App:
Navigation / Router (expo-router)
• Routes from app/ (_layout.tsx, (tabs)/_layout.tsx, screens)
UI Screens (React components)
• Tabs: index, explorer, swap, settings
• Routes: orders, token/[mint]
State Management (Wallet Store)
• src/store/wallet.ts
Data / Service Layer (Lib)
• src/lib/lib.tsx (RPC calls, formatting, helpers, adapters)
Shared UI Components
• src/components/FavButton.tsx (and future components)
External containers:
• Solana RPC Endpoint
• (Optional) Indexing/Explorer API
• (Optional) Swap API
• Screens → Wallet Store: “read/write wallet state”
• Screens → Lib: “load balances/tx history/token details”
• Lib → RPC Endpoint: “fetch on-chain data”
• Wallet Store → Lib or RPC (depending on code): “publicKey triggers reload”
Goal: Make it “code-shaped” so it matches what’s in this tree.
Components to include (map directly to folders/files)
Routing / Layout
• app/_layout.tsx (root navigation shell)
• app/(tabs)/_layout.tsx (tab navigator)
Tab Screens
• app/(tabs)/index.tsx — likely wallet overview (balances summary)
• app/(tabs)/explorer.tsx — explore addresses/tokens/tx
• app/(tabs)/swap.tsx — swapping flow (quote/build/sign/send)
• app/(tabs)/settings.tsx — app settings + wallet settings
Non-tab Screens
• app/orders.tsx — orders/history view (swap orders or tx orders; label neutrally as “Orders screen”)
• app/token/[mint].tsx — token detail screen (mint as route param)
State
• src/store/wallet.ts — wallet connection/session state, selected account/publicKey, etc.
Lib
• src/lib/lib.tsx — Solana client helpers, RPC wrappers, formatting, etc.
UI Component
• src/components/FavButton.tsx — favorites toggling (likely stored locally or in store)
Architectural patterns/design principles evident here
• Client-side, layered architecture:
• Presentation (screens/components)
• State management (src/store)
• Services/utilities (src/lib)
• External integrations (RPC / APIs)
• Route-as-module with expo-router: each file in app/ is a routable component
• Clear labels with file/folder mapping, e.g.
“Token Detail Screen (app/token/[mint].tsx)”
• Blue rectangles: UI screens/routes
• Green hexagon: External services (RPC, indexing, swap)
• Boundaries:
• One boundary for “Mobile Device (Expo App)”
• Separate boundary for “External Services”
• Optional boundary for “Solana Network” behind RPC provider
Practical “don’t overthink it” component breakdown (max separation, minimal assumptions)
• app/_layout.tsx
• app/(tabs)/_layout.tsx
• app/(tabs)/index.tsx
• app/(tabs)/explorer.tsx
• app/(tabs)/swap.tsx
• app/(tabs)/settings.tsx
• app/orders.tsx
• app/token/[mint].tsx
• src/store/wallet.ts
• src/lib/lib.tsx
• src/components/FavButton.tsx
• External: “Solana RPC Endpoint”