From 589aa86e9c90558748fc0d18e6584a2c28030708 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Thu, 29 Jan 2026 18:55:00 +1100 Subject: [PATCH] feat: add and fix build guides --- .../content/docs/reference/build-client.mdx | 44 +++++++++++++++++- .../content/docs/reference/build-server.mdx | 45 +++++++++---------- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/docs/src/content/docs/reference/build-client.mdx b/docs/src/content/docs/reference/build-client.mdx index 19d2ba0f..75a2e876 100644 --- a/docs/src/content/docs/reference/build-client.mdx +++ b/docs/src/content/docs/reference/build-client.mdx @@ -1,3 +1,45 @@ --- title: Building Drop client ---- \ No newline at end of file +--- + +To build the client, you need: + +- Node.js, and the `pnpm` package manager +- Rust (nightly) + +import { Steps } from "@astrojs/starlight/components"; + + +1. ### Clone the repo + + ```bash + git clone https://github.com/Drop-OSS/drop-app.git && cd drop-app + ``` + + We also include some libraries as submodules. Clone them too: + + ```bash + git submodule update --init --recursive + ``` + +2. ### Install build system dependencies + + Use `pnpm` to install the dependencies for our bespoke build system: + + ```bash + pnpm install + ``` + +3. ### Run the build + + Use `tauri` to build the app: + + ```bash + pnpm tauri build + ``` + + :::note + If you don't have certain system libraries, the Rust build will fail. Install them, and re-run the build. + ::: + + diff --git a/docs/src/content/docs/reference/build-server.mdx b/docs/src/content/docs/reference/build-server.mdx index 24f628d1..393c6d9f 100644 --- a/docs/src/content/docs/reference/build-server.mdx +++ b/docs/src/content/docs/reference/build-server.mdx @@ -64,20 +64,24 @@ This step is optional, you can use our pre-built binaries hosted on the NPM. The git submodule update --init --recursive ``` -2. ### [Optional] Link `droplet` - - Use the directory from the `droplet` build: - - ```bash - pnpm install - ``` - -3. ### Install Node.js dependencies using `pnpm` +2. ### Install Node.js dependencies using `pnpm` ```bash pnpm install ``` +3. ### [Optional] Copy in custom build of `droplet` + + Unfortunately, we cannot directly link the `droplet` package we built into Drop, because it's a development version and won't work properly in the built server. + + To copy in your freshly built `droplet` binary, determine the binary triplet you're using. There should be a file called `droplet..node` in your `droplet` directory. Copy that file into the corresponding file in `node_modoles/@drop-oss/droplet-`: + + ```bash + cp /droplet..node /node_modules/@drop-oss/droplet- + ``` + + It should override a file with the same name in that directory. + 4. ### Build the application ```bash @@ -88,10 +92,10 @@ This step is optional, you can use our pre-built binaries hosted on the NPM. The ## Building `torrential` -To build `torrential`, you only need to run: +To build `torrential`, you only need to run in the `torrential` directory in your Drop repository: ```bash -cargo build --release +cd torrential && cargo build --release ``` ## Set up Drop runtime environment @@ -122,19 +126,13 @@ You will need to install: Use your Node.js package manager to install prisma, either to the local directory or globally: ```bash - npm install prisma@6.11.1 # local installation using npm + npm install prisma@6.11.1 dotenv # dotenv is a requirement ``` Then, with your database running: ```bash - DATABASE_URL= prisma migrate deploy - ``` - - If you've installed it locally, you might need to run: - - ```bash - DATABASE_URL= prisma migrate deploy + DATABASE_URL= npm prisma migrate deploy ``` 4. ### Create your launch script @@ -145,12 +143,13 @@ You will need to install: ```bash # required environment variables - NGINX_CONF=./nginx.conf # potentially update if you've renamed the nginx.conf - DATABASE_URL= - DATA=./data # potentially update if you'd like Drop to store data somewhere else (not library) + export NGINX_CONFIG=./nginx.conf # potentially update if you've renamed the nginx.conf + export DATABASE_URL= + export DATA=./data # potentially update if you'd like Drop to store data somewhere else (not library) + export EXTERNAL_URL=http://localhost:3000 # optional variables - # TORRENTIAL_PATH= # may be required if torrential isn't in your $PATH + # export TORRENTIAL_PATH= # may be required if torrential isn't in your $PATH # ... see the rest of the document for other options ... # run application