Getting Started
This guide will help you get started with OpenCloud Mobile development. We'll cover how to set up your development environment, how to run the app, and how to make your first changes.
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js (LTS version recommended)
- npm or yarn
- Git
- Xcode (for iOS development)
- Xcode 16.3+ requires specific Expo module versions - see Compatibility Notes below
- Android Studio (for Android development)
Installation
- Clone the repository:
git clone https://github.com/michaelstingl/opencloud-mobile.git
cd opencloud-mobile
- Install dependencies:
npm install
Running the App
Development Server
Start the development server:
npx expo start
This will open the Expo developer tools in your terminal and provide options for running the app on different platforms.
iOS Simulator
Run the app on an iOS simulator:
npx expo run:ios
For a release build:
npx expo run:ios --configuration Release
Android Emulator
Run the app on an Android emulator:
npx expo run:android
Web
Run the app in a web browser:
npx expo start --web
Connecting to a Server
When you launch the app, you'll need to connect to an OpenCloud server:
- Enter the server URL (e.g.,
https://your-server.com
) - Tap "Connect"
- The app will:
- Check if the server supports OpenID Connect via WebFinger
- Fetch the OpenID Connect configuration
- Redirect you to the server's login page
- After login, you'll be redirected back to the app
For development and testing, you can use any OpenCloud server that supports OpenID Connect authentication.
Development Workflow
Project Structure
The project follows this structure:
opencloud-mobile/
├── app/ # Expo Router pages
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── services/ # API and business logic services
├── utils/ # Helper functions and utilities
├── types/ # TypeScript type definitions
└── assets/ # Static assets like images
Making Changes
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
-
Make your changes to the code
-
Test your changes:
npm test
- Commit your changes:
git commit -m "Add your commit message"
- Push your changes:
git push origin feature/your-feature-name
- Create a pull request on GitHub
Testing
Run the tests:
npm test
Run a specific test:
npm test -- -t "test name"
Debugging
Using React Native Debugger
- Install React Native Debugger
- Run the app in development mode
- Open React Native Debugger
- In the app, shake the device or press Cmd+D (iOS) or Ctrl+M (Android) and select "Debug JS Remotely"
Viewing Logs
You can view logs in the terminal where you started the development server or use the Expo dev tools.
Compatibility Notes
Xcode 16.3+ Compatibility
Xcode 16.3 introduced a breaking change in LLVM 19's C++ compiler that affects Expo and React Native applications. If you're using Xcode 16.3 or later, you'll need to make sure you have compatible packages installed:
- React Native 0.77+ fully supports Xcode 16.3
- For React Native 0.76.x (which this project currently uses), you'll need patched versions of these Expo packages:
expo-device@7.0.3
or higherexpo-gl@15.0.5
or higherexpo-dev-client@5.0.18
or higherexpo-dev-menu@6.0.23
or higherexpo-dev-launcher@5.0.33
or higher
To ensure you have the compatible package versions, run:
npx expo install --fix
This will update the affected packages to versions that are compatible with Xcode 16.3.
For more information, see the Expo changelog.
Next Steps
Now that you have the app running, you can:
- Explore the codebase to understand how the app works
- Check out the API Reference to learn about the available components and APIs
- Read about the Architecture to understand how the app is designed
- Learn how to contribute to the project