Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 2dc233f
Author: Utku <74243531+utkubakir@users.noreply.github.com>
Date:   Fri Feb 9 18:42:42 2024 +0300

    Update readme & contributing guide & language stuff (spacedriveapp#2071)

    * updates

    * keep common errors

    * fix selector being empty for english

    * sort by label

    * update contributing

    * update ndk and docs

    * Update CONTRIBUTING.md

commit 177b2a2
Author: Brendan Allan <brendonovich@outlook.com>
Date:   Fri Feb 9 21:20:51 2024 +0800

    sync support for labels (spacedriveapp#2070)

    * more sync support for file paths + saved searches

    * sync support for labels

    * update sync prisma generator to support more than tags

    * workey

    * don't do illegal db migration

    * use name as label id in explorer

commit 6f28d8e
Author: Brendan Allan <brendonovich@outlook.com>
Date:   Fri Feb 9 16:17:04 2024 +0800

    More sync support for file paths + saved searches (spacedriveapp#2067)

    more sync support for file paths + saved searches
  • Loading branch information
Rocky43007 committed Feb 9, 2024
1 parent d4a47ad commit 8c0732f
Show file tree
Hide file tree
Showing 28 changed files with 703 additions and 290 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
# - name: Cache NDK
# uses: actions/cache@v3
# with:
# path: ${{ env.ANDROID_HOME }}/ndk/23.1.7779620
# key: ndk-23.1.7779620
# path: ${{ env.ANDROID_HOME }}/ndk/26.1.10909125
# key: ndk-26.1.10909125
#
# - name: Install NDK
# run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;23.1.7779620"
# run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;26.1.10909125"
#
# - name: Cache Gradle
# uses: gradle/gradle-build-action@v2
Expand All @@ -106,7 +106,7 @@ jobs:
# arch: x86_64
# api-level: 30
# target: google_apis
# ndk: 23.1.7779620
# ndk: 26.1.10909125
# ram-size: 4096M
# emulator-boot-timeout: 12000
# force-avd-creation: false
Expand All @@ -126,7 +126,7 @@ jobs:
# arch: x86_64
# api-level: 30
# target: google_apis
# ndk: 23.1.7779620
# ndk: 26.1.10909125
# ram-size: 4096M
# emulator-boot-timeout: 12000
# force-avd-creation: false
Expand Down
34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ To make changes locally, follow these steps:
1. Clone the repository: `git clone https://github.com/spacedriveapp/spacedrive`
2. Navigate to the project directory: `cd spacedrive`
3. Configure your system environment for Spacedrive development
1. For Linux users, run: `./scripts/setup.sh`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L133) will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, Gstreamer's Plugins, FFmpeg, Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux) and any other required dependencies for Spacedrive to build.
2. For macOS users, run: `./scripts/setup.sh`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L108) will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) and install any other required dependencies for Spacedrive to build.
3. For Windows users, run in PowerShell: `.\scripts\setup.ps1`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.ps1#L81) will install pnpm, LLVM, FFmpeg, C++ build tools, NASM, Rust + Cargo, Rust tools, Edge Webview 2, Strawberry Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-windows) and any other required dependencies for Spacedrive to build.
1. For Linux users, run: `./scripts/setup.sh`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L133) will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, Gstreamer's Plugins, FFmpeg, Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux) and any other required dependencies for Spacedrive to build.
2. For macOS users, run: `./scripts/setup.sh`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.sh#L108) will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-macos) and install any other required dependencies for Spacedrive to build.
3. For Windows users, run in PowerShell: `.\scripts\setup.ps1`
> This [script](https://github.com/spacedriveapp/spacedrive/blob/main/scripts/setup.ps1#L81) will install pnpm, LLVM, FFmpeg, C++ build tools, NASM, Rust + Cargo, Rust tools, Edge Webview 2, Strawberry Perl, [Tauri essentials](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-windows) and any other required dependencies for Spacedrive to build.
4. Install dependencies: `pnpm i`
5. Prepare the build: `pnpm prep` (This will run all necessary codegen and build required dependencies)

Expand Down Expand Up @@ -89,19 +89,19 @@ To run the mobile app:
- Install [Android Studio](https://developer.android.com/studio) for Android and [Xcode](https://apps.apple.com/au/app/xcode/id497799835) for iOS development.
- Run `./scripts/setup.sh mobile`
- This will set up most of the dependencies required to build the mobile app.
- Make sure you have [NDK 23.1.7779620 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) installed in Android Studio.
- Make sure you have [NDK 26.1.10909125 and CMake](https://developer.android.com/studio/projects/install-ndk#default-version) installed in Android Studio.
- Run the following commands:
- `pnpm android` (runs on Android Emulator)
- In order to have locations working on Android, you must run the following command once the application has been installed for the first time. Otherwise, locations will not work.
- `adb shell appops set --uid com.spacedrive.app MANAGE_EXTERNAL_STORAGE allow`
- Run the following commands to access the logs from `sd-core`.
- `adb shell`
- Then `run-as com.spacedrive.app` to access the app's directory on device.
- Run `cd files/logs` and then select the logs with the timestamp of when you ran the app. Ex: `sd.log.2023-11-28`.
- You can view the logs using `tail -f [log-name]`. Ex: `tail -f sd.log.2023-11-28`.
- `pnpm ios` (runs on iOS Emulator)
- `pnpm mobile android` (runs on Android Emulator)
- In order to have locations working on Android, you must run the following command once the application has been installed for the first time. Otherwise, locations will not work.
- `adb shell appops set --uid com.spacedrive.app MANAGE_EXTERNAL_STORAGE allow`
- Run the following commands to access the logs from `sd-core`.
- `adb shell`
- Then `run-as com.spacedrive.app` to access the app's directory on device.
- Run `cd files/logs` and then select the logs with the timestamp of when you ran the app. Ex: `sd.log.2023-11-28`.
- You can view the logs using `tail -f [log-name]`. Ex: `tail -f sd.log.2023-11-28`.
- `pnpm mobile ios` (runs on iOS Emulator)
- `xcrun simctl launch --console booted com.spacedrive.app` allows you to view the console output of the iOS app from `tracing`. However, the application must be built in `debug` mode for this.
- `pnpm start` (runs the metro bundler)
- `pnpm mobile start` (runs the metro bundler only)

##### AppImage

Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,28 @@ This project is using what I'm calling the **"PRRTT"** stack (Prisma, Rust, Reac
- `desktop`: A [Tauri](https://tauri.app) app.
- `mobile`: A [React Native](https://reactnative.dev/) app.
- `web`: A [React](https://reactjs.org) webapp.
- `landing`: A [React](https://reactjs.org) app using Vite SSR & Vite pages.
- `landing`: A [React](https://reactjs.org) app using [Next.js](https://nextjs.org).
- `server`: A [Rust](https://www.rust-lang.org) server for the webapp. (planned)
- `cli`: A [Rust](https://www.rust-lang.org) command line interface. (planned)
- `storybook`: A [React](https://reactjs.org) storybook for the UI components.

### Core:

- `core`: The [Rust](https://www.rust-lang.org) core, referred to internally as `sdcore`. Contains filesystem, database and networking logic. Can be deployed in a variety of host applications.
- `crates`: Shared Rust libraries used by the core and other Rust applications.

### Interface:

- `interface`: The complete user interface in React (used by apps `desktop`, `web`)

### Packages:

- `assets`: Shared assets (images, fonts, etc).
- `client`: A [TypeScript](https://www.typescriptlang.org/) client library to handle dataflow via RPC between UI and the Rust core.
- `ui`: A [React](https://reactjs.org) Shared component library.
- `interface`: The complete user interface in React (used by apps `desktop`, `web` and `landing`)
- `config`: `eslint` configurations (includes `eslint-config-next`, `eslint-config-prettier` and all `tsconfig.json` configs used throughout the monorepo).
- `ui`: A [React](https://reactjs.org) Shared component library.

- `macos`: A [Swift](https://developer.apple.com/swift/) Native binary for MacOS system extensions.
- `macos`: A [Swift](https://developer.apple.com/swift/) Native binary for MacOS system extensions (planned).
- `ios`: A [Swift](https://developer.apple.com/swift/) Native binary (planned).
- `windows`: A [C#](https://docs.microsoft.com/en-us/dotnet/csharp/) Native binary (planned).
- `android`: A [Kotlin](https://kotlinlang.org/) Native binary (planned).
21 changes: 13 additions & 8 deletions core/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ model Location {
hidden Boolean?
date_created DateTime?
/// @local
// this is just a client side cache which is annoying but oh well (@brendan)
instance_id Int?
instance Instance? @relation(fields: [instance_id], references: [id], onDelete: SetNull)
Expand Down Expand Up @@ -326,14 +328,14 @@ model Tag {
@@map("tag")
}

/// @relation(item: tag, group: object)
/// @relation(item: object, group: tag)
model TagOnObject {
tag_id Int
tag Tag @relation(fields: [tag_id], references: [id], onDelete: Restrict)
object_id Int
object Object @relation(fields: [object_id], references: [id], onDelete: Restrict)
tag_id Int
tag Tag @relation(fields: [tag_id], references: [id], onDelete: Restrict)
date_created DateTime?
@@id([tag_id, object_id])
Expand All @@ -342,9 +344,9 @@ model TagOnObject {

//// Label ////

/// @shared(id: name)
model Label {
id Int @id @default(autoincrement())
pub_id Bytes @unique
name String @unique
date_created DateTime @default(now())
date_modified DateTime @default(now())
Expand All @@ -354,15 +356,16 @@ model Label {
@@map("label")
}

/// @relation(item: object, group: label)
model LabelOnObject {
date_created DateTime @default(now())
label_id Int
label Label @relation(fields: [label_id], references: [id], onDelete: Restrict)
object_id Int
object Object @relation(fields: [object_id], references: [id], onDelete: Restrict)
label_id Int
label Label @relation(fields: [label_id], references: [id], onDelete: Restrict)
@@id([label_id, object_id])
@@map("label_on_object")
}
Expand Down Expand Up @@ -514,6 +517,7 @@ model Notification {
@@map("notification")
}

/// @shared(id: pub_id)
model SavedSearch {
id Int @id @default(autoincrement())
pub_id Bytes @unique
Expand All @@ -532,6 +536,7 @@ model SavedSearch {
@@map("saved_search")
}

/// @local(id: id)
model CloudCRDTOperation {
id Bytes @id
timestamp BigInt
Expand Down

0 comments on commit 8c0732f

Please sign in to comment.