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

solana-app-kit/
├── src/                    # Mobile app source code
├── server/                 # Backend server
├── android/                # Android-specific files
├── ios/                    # iOS-specific files
├── docs/                   # Documentation
├── scripts/                # Build and utility scripts
├── App.tsx                 # Main app component
├── package.json            # Dependencies and scripts
└── Configuration files     # Various config files

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

src/core/
├── chat/                   # AI chat integration
├── dev-mode/              # Development tools and debugging
├── profile/               # User profile management
├── shared-ui/             # Reusable UI components
└── thread/                # Social feed and threading

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.

Backend Server Structure (server/)

The backend server provides essential API endpoints and services:

Platform-Specific Directories

ios/ - iOS-specific configuration and native code

ios/
├── SolanaAppKit/          # Main iOS project
│   ├── Info.plist         # iOS app configuration
│   ├── AppDelegate.mm     # iOS app delegate
│   └── Images.xcassets/   # iOS app icons and images
├── Podfile                # CocoaPods dependencies
└── SolanaAppKit.xcworkspace # Xcode workspace

iOS Development: Requires macOS and Xcode for building and testing on iOS devices

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:

module-name/
├── components/            # UI components specific to this module
├── hooks/                 # Custom hooks for module functionality
├── screens/               # Screens specific to this module
├── services/              # API and blockchain services
├── types/                 # TypeScript interfaces
├── utils/                 # Utility functions
├── index.ts               # Public API exports
└── README.md              # Module documentation

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:

1

Component Hierarchy

Screens import and use Components from modules for UI composition

2

State Management

Components use Hooks for state management and business logic

3

External Operations

Hooks call Services for API interactions and blockchain operations

4

Utility Functions

Services use Utils for common operations and data processing

5

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: