Prerequisites
Environment Setup
To get started contributing to Spacedrive, follow this guide carefully.
This project uses Cargo and pnpm.
Installation
-
Clone repo
git clone https://github.com/spacedriveapp/spacedrive && cd spacedrive
-
Run setup script
For Linux or MacOS users run:
./scripts/setup.sh
This will install FFmpeg and any other required dependencies for Spacedrive to build.
...or for Windows users run using PowerShell:
.\scripts\setup.ps1
This will install pnpm, LLVM, FFmpeg and any other required dependencies for Spacedrive to build. Ensure you run it like documented above as it expects it is executed from the root of the repository.
-
Install dependencies
pnpm i
-
Run codegen & build required dependencies
pnpm prep
Running apps
- Desktop:
pnpm tauri dev
- Landing:
pnpm landing dev
- Server:
DATA_DIR=/path/to/library cargo run -p sdcore
- Webapp:
pnpm web dev
note
When changing branches, make sure to run pnpm prep
command right after. This ensures all the codegen is up to date.
Mobile app
To run mobile app
- Install Android Studio for Android and Xcode for IOS development
- This should setup most of the dependencies for the mobile app to build.
./scripts/setup.sh mobile
- You must also ensure you have NDK 26.1.10909125 and CMake in Android Studio
- To run on Android (emulator or device), run:
pnpm mobile android
- Run the following commands to access the logs from
sd-core
.
adb logcat | grep -i com.spacedrive.app
- Run the following commands to access the logs from
- To run on iOS (runs on iOS Emulator), run:
pnpm mobile ios
- The following command allows you to view the console output of the iOS app from
tracing
. However, the application must be built indebug
mode for this.
xcrun simctl launch --console booted com.spacedrive.app
- The following command allows you to view the console output of the iOS app from
- To run the UI only (runs the metro bundler only):
pnpm mobile start
Troubleshooting
If you are having issues ensure you are using the following versions of Rust and Node:
- Rust version: 1.68.2
- Node version: 18
Seeding data on startup
note
You may lose data if your using this feature so please be careful! This only works on development builds for this reason.
You can add a file called sd_init.json
in the same folder where you start Spacedrive and it can automatically seed data on startup.
{
"resetOnStartup": false,
"libraries": [
{
"id": "26697dc0-ef06-4b39-ad72-ffe5d5205b61",
"name": "Oscar's Library",
"password": "password",
"resetLocationsOnStartup": true,
"locations": [
{
"path": "/Users/oscar/Pictures/assets"
}
]
}
]
}