Files
spacedrive/docs/developers/prerequisites/environment-setup.mdx
Vítor Vasconcellos bd0a7ff434 [ENG-265] Improve setup scripts (#1368)
* Setup script revamp

* Move toml to dev dep + CI runs the postinstall in debug mode

* Fix windows CI

* chmod +x scripts/setup.sh

* Fix eslint and ts CI

* Remove binstall + Fix trying to read input in CI

* Doesn't need to check pnpm and rust in CI

* Run postinstall script for Clippy CI

* Attempt to fix windows CI not running postinstall
 - Ignore cache when running postinstall on CI

* commited generated config.toml by mistake

* Pass GITHUB_TOKEN to `pnpm i`

* Update archive-wasm + Increase minimum node version to 18.17

* CI: Move rust setup after post-install script

* Revert: CI: Move rust setup after post-install script

* Fix CI, generate dummy cargo config.toml to fix prisma generation

* Fix windows CI

* CI: Fix wrong command

---------

Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com>
2023-09-28 10:03:46 +00:00

101 lines
2.6 KiB
Plaintext

---
index: 1
---
# Environment Setup
To get started contributing to Spacedrive, follow this guide carefully.
This project uses [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) and [pnpm](https://pnpm.io/installation).
## Installation
1. **Clone repo**
```shell
git clone https://github.com/spacedriveapp/spacedrive && cd spacedrive
```
2. **Run setup script**
**For Linux or MacOS users run:**
```shell
./scripts/setup.sh
```
This will install FFmpeg and any other required dependencies for Spacedrive to build.
**...or for Windows users run using PowerShell:**
```shell
.\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._
3. **Install dependencies**
```shell
pnpm i
```
4. **Run codegen & build required dependencies**
```shell
pnpm prep
```
## Running apps
- **Desktop:** `pnpm desktop dev`
- **Landing:** `pnpm landing dev`
- **Server:** `DATA_DIR=/path/to/library cargo run -p sdcore`
- **Webapp:** `pnpm web dev`
<Notice
type="note"
text="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
1. Install [Android Studio](https://developer.android.com/studio) for Android and [Xcode](https://apps.apple.com/au/app/xcode/id497799835) for IOS development
2. `./scripts/setup.sh mobile`
_The should setup most of the dependencies for the mobile app to build._
3. You must also ensure you have [NDK 23.1.7779620 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) in Android Studio
4. `pnpm mobile android` - runs on Android Emulator
5. `pnpm mobile ios` - runs on iOS Emulator
### 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
<Notice
type="note"
text="You may loose 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.
```json
{
"resetOnStartup": false,
"libraries": [
{
"id": "26697dc0-ef06-4b39-ad72-ffe5d5205b61",
"name": "Oscar's Library",
"password": "password",
"resetLocationsOnStartup": true,
"locations": [
{
"path": "/Users/oscar/Pictures/assets"
}
]
}
]
}
```