Root Directory Structure
Core Directories
app/ - Routes & Navigation
Expo Router uses file-based routing. Each file in app/ automatically becomes a route.
Screens should be thin: The
app/ directory focuses on route orchestration. Business logic belongs in hooks, helpers, or stores.components/ - UI Components
Components are organized by abstraction level:
hooks/ - React Hooks
Reusable hooks and Cashu-specific logic:
helper/ - Utility Functions
Stateless utility functions organized by domain:
stores/ - State Management
Zustand stores for global state (migrating from Redux):
Zustand Store Scoping: Some stores are profile-scoped, meaning they’re isolated per user profile. See
.cursor/rules/zustand-store-scoping.mdc for details.providers/ - Context Providers
React context providers for app-wide state:
utils/ - Utility Modules
Higher-level utilities:
Architecture Principles
Separation of Concerns
- Routes (
app/) - Orchestration only, minimal logic - Components (
components/) - Pure presentation, receive data via props - Hooks (
hooks/) - Reusable stateful logic - Helpers (
helper/) - Pure functions, no side effects - Stores (
stores/) - Global state management - Providers (
providers/) - Context and initialization
Cashu Integration
The integration is layered:- coco-cashu-core - Core Cashu protocol logic
- coco-cashu-expo-sqlite - SQLite storage adapter
- coco-cashu-react - React hooks
- coco-cashu-plugin-npc - NPC plugin
- hooks/coco/ - App-specific Cashu hook composition
- helper/coco/ - App-specific Cashu utilities
State Management Evolution
The app is migrating from Redux to Zustand:- Redux (
redux/) - Legacy, being phased out - Zustand (
stores/) - Current state management solution - Migration -
stores/migrateSettings.tshandles data migration
Special Directories
.cursor/rules/ - Agent Documentation
Self-improving documentation for AI agents:
scripts/ - Automation
Navigation Flow
The app uses nested navigators:(send-flow)/- Send payment modals(receive-flow)/- Receive payment modals(mint-flow)/- Mint management modals(map-flow)/- Map view modals(user-flow)/- User profile modals
Next Steps
Tech Stack
Learn about the technologies used
Scripts Reference
Complete guide to all available scripts
Getting Started
Set up your development environment
API Reference
Explore the API documentation