Repository Structure
Comprehensive guide to understanding and navigating the Solana App Kit codebase organization
This document provides a comprehensive overview of how the Solana App Kit codebase is organized. Understanding this structure will help you navigate the project efficiently and know exactly where to make changes for your specific needs.
Root Directory Overview
Monorepo Structure: The kit combines mobile app, backend server, and documentation in a single repository for easier development and maintenance
Mobile App Structure (src/
)
The mobile application is organized into several key directories, each serving a specific purpose:
src/core/
- Essential app functionality used across multiple screens
Chat
AI chat integration with Solana blockchain interactions
Dev Mode
Development tools for debugging and testing
Profile
User profile management and account settings
Shared UI
Reusable components used throughout the application
Thread
Social feed and threading for community features
Purpose: Core features are central to the app’s functionality and provide shared capabilities across multiple screens and modules.
src/core/
- Essential app functionality used across multiple screens
Chat
AI chat integration with Solana blockchain interactions
Dev Mode
Development tools for debugging and testing
Profile
User profile management and account settings
Shared UI
Reusable components used throughout the application
Thread
Social feed and threading for community features
Purpose: Core features are central to the app’s functionality and provide shared capabilities across multiple screens and modules.
src/modules/
- Independent, protocol-specific integrations
Data Module
Blockchain data fetching and market information
Meteora
Dynamic Liquidity Markets integration
MoonPay
Fiat on-ramp for purchasing crypto
NFT
NFT functionality with Tensor integration
Pump.fun
Meme token creation and trading
Raydium
Professional token launching platform
Solana Agent Kit
AI agent integration for automated interactions
Swap
Multi-DEX token swapping with optimal routing
Token Mill
Advanced token creation with custom bonding curves
Wallet Providers
Multi-provider wallet connection and management
Purpose: Each module encapsulates a specific protocol or feature, making the codebase modular, maintainable, and allowing you to use only what you need.
src/screens/
- React Native screens organized by feature area
Common Screens
Shared across features - intro, login, and module selection screens
Sample UI
Example implementations showing how to use core features and modules
Purpose: Screens define the user interface and navigation flow, providing the main entry points for different app features.
src/shared/
- Common utilities and configurations
Configuration
App settings and environment configuration
Context
React Context providers for global state
Hooks
Custom React hooks for reusable logic
Navigation
Navigation setup and routing configuration
State Management
Redux store and state management slices
Types
TypeScript definitions for type safety
Purpose: Shared resources provide common functionality and maintain consistency across the entire application.
src/assets/
- Static resources and design system
Images
Static image files for app branding and UI
SVGs
Scalable vector graphics for icons and illustrations
Colors
Color palette definitions for consistent theming
Typography
Typography system for consistent text styling
Purpose: Centralized asset management and design system definitions ensure visual consistency.
Backend Server Structure (server/
)
The backend server provides essential API endpoints and services:
Platform-Specific Directories
ios/
- iOS-specific configuration and native code
iOS Development: Requires macOS and Xcode for building and testing on iOS devices
ios/
- iOS-specific configuration and native code
iOS Development: Requires macOS and Xcode for building and testing on iOS devices
android/
- Android-specific configuration and native code
Android Development: Works on any platform with Android Studio and Java/Kotlin support
Configuration Files
Key configuration files in the root directory:
App.tsx
Main React Native component and app initialization entry point
package.json
Project dependencies, scripts, and metadata configuration
app.config.js
Expo configuration for builds, deployment, and app settings
babel.config.js
JavaScript compilation configuration and plugin setup
metro.config.js
Metro bundler configuration for React Native builds
tsconfig.json
TypeScript compiler configuration and type checking rules
.env.local
Environment variables (not in repo, created during setup)
mint.json
Documentation configuration for this documentation site
Module Architecture Pattern
Each module follows a consistent, well-defined structure:
This pattern ensures:
Consistency
Similar organization across all modules makes navigation predictable
Encapsulation
Module internals are contained with clean public interfaces
Reusability
Clean public APIs make modules easy to integrate and reuse
Maintainability
Easy to understand and modify with clear separation of concerns
Data Flow Architecture
Understanding how components connect and data flows through the application:
Component Hierarchy
Screens import and use Components from modules for UI composition
State Management
Components use Hooks for state management and business logic
External Operations
Hooks call Services for API interactions and blockchain operations
Utility Functions
Services use Utils for common operations and data processing
Type Safety
Everything uses Types for TypeScript type safety and IntelliSense
Data Flow Diagram
Development Workflow
Understanding the structure helps with common development tasks:
Best Practices
Module Independence
Keep modules loosely coupled to maintain modularity and testability
Shared Code
Put common functionality in src/shared/
for reusability across modules
Type Safety
Define interfaces in module types/
directories for better developer experience
Export Consistency
Use index.ts
files for clean public APIs and easier imports
Documentation
Update module READMEs when making changes to keep docs current
Testing
Write tests for critical business logic in services and hooks
Next Steps
Now that you understand the repository structure, explore these guides: