Welcome to the Mobile Bolt open-source project! This guide will help you set up your development environment and understand our contribution process.
- Node.js v20.15.1 or later
- pnpm v9.4.0 or later
- A modern web browser (Chrome, Firefox, or Edge recommended)
- An Anthropic API key for Claude integration
- Fork and clone the repository:
git clone https://github.com/your-username/mobile-bolt.git
cd mobile-bolt
- Install dependencies:
pnpm install
- Environment configuration:
cp .env.example .env.local
Add your Anthropic API key to .env.local
:
ANTHROPIC_API_KEY=your-key-here
VITE_LOG_LEVEL=debug # Optional for development
Mobile Bolt consists of four main interfaces that work together:
-
Chat Interface
- Built with React and Vercel's AI SDK
- Handles AI message streaming and state management
- Located in
app/components/chat
-
Code Editor
- Uses CodeMirror with React Native extensions
- Supports mobile framework syntax
- Located in
app/components/editor
-
Terminal/Shell
- Integrates with Expo CLI
- Handles command execution and output streaming
- Located in
app/components/terminal
-
File Tree
- Manages project structure visualization
- Handles file operations
- Located in
app/components/filetree
pnpm run dev
: Start development serverpnpm run build
: Build for productionpnpm run test
: Run test suitepnpm run lint
: Run lintingpnpm run typecheck
: Run type checkingpnpm run preview
: Preview production build
- Check our Issues page
- Look for
good first issue
andhelp wanted
tags - Comment on an issue before starting work
- Create a new branch:
git checkout -b feature/your-feature-name
-
Follow our coding standards:
- Use TypeScript for all new code
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
-
Commit your changes:
- Use conventional commit messages
- Reference issue numbers in commits
- Run the test suite:
pnpm test
- Add new tests for your changes
- Ensure all tests pass before submitting
- Push your changes to your fork
- Create a Pull Request (PR)
- Fill out the PR template
- Wait for review
- Use TypeScript for type safety
- Follow Prettier formatting
- Use ESLint with our configuration
- Follow React Hooks best practices
- Write unit tests using Vitest
- Add integration tests for new features
- Test mobile-specific functionality
- Test cross-platform compatibility
- Update README.md for user-facing changes
- Add JSDoc comments for new functions
- Update API documentation as needed
- Include example usage where appropriate
- Test on both iOS and Android configurations
- Consider different screen sizes
- Handle platform-specific features appropriately
- Test with Expo's development tools
- Build Failures
# Clear build cache
pnpm clean
pnpm install
- Environment Issues
# Verify environment
node -v
pnpm -v
- AI Integration Issues
- Verify your API key is correctly set
- Check the debug logs
- Ensure proper streaming setup