Skip to content

Commit 72be4f3

Browse files
committed
feat: add and fix build guides
1 parent 025f43f commit 72be4f3

2 files changed

Lines changed: 62 additions & 21 deletions

File tree

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
11
---
22
title: Building Drop client
3-
---
3+
---
4+
5+
To build the client, you need:
6+
7+
- Node.js, and the `pnpm` package manager
8+
- Rust (nightly)
9+
10+
import { Steps } from "@astrojs/starlight/components";
11+
12+
<Steps>
13+
1. ### Clone the repo
14+
15+
```bash
16+
git clone https://github.com/Drop-OSS/drop-app.git && cd drop-app
17+
```
18+
19+
We also include some libraries as submodules. Clone them too:
20+
21+
```bash
22+
git submodule update --init --recursive
23+
```
24+
25+
2. ### Install build system dependencies
26+
27+
Use `pnpm` to install the dependencies for our bespoke build system:
28+
29+
```bash
30+
pnpm install
31+
```
32+
33+
3. ### Run the build
34+
35+
Use `tauri` to build the app:
36+
37+
```bash
38+
pnpm tauri build
39+
```
40+
41+
:::note
42+
If you don't have certain system libraries, the Rust build will fail. Install them, and re-run the build.
43+
:::
44+
45+
</Steps>

src/content/docs/reference/build-server.mdx

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,24 @@ This step is optional, you can use our pre-built binaries hosted on the NPM. The
6464
git submodule update --init --recursive
6565
```
6666

67-
2. ### [Optional] Link `droplet`
68-
69-
Use the directory from the `droplet` build:
67+
2. ### Install Node.js dependencies using `pnpm`
7068

7169
```bash
72-
pnpm install <droplet dir>
70+
pnpm install
7371
```
7472

75-
3. ### Install Node.js dependencies using `pnpm`
73+
3. ### [Optional] Copy in custom build of `droplet`
74+
75+
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.
76+
77+
To copy in your freshly built `droplet` binary, determine the binary triplet you're using. There should be a file called `droplet.<triplet>.node` in your `droplet` directory. Copy that file into the corresponding file in `node_modoles/@drop-oss/droplet-<triplet>`:
7678

7779
```bash
78-
pnpm install
80+
cp <droplet dir>/droplet.<triplet>.node <drop dir>/node_modules/@drop-oss/droplet-<triplet>
7981
```
8082

83+
It should override a file with the same name in that directory.
84+
8185
4. ### Build the application
8286

8387
```bash
@@ -88,10 +92,10 @@ This step is optional, you can use our pre-built binaries hosted on the NPM. The
8892

8993
## Building `torrential`
9094

91-
To build `torrential`, you only need to run:
95+
To build `torrential`, you only need to run in the `torrential` directory in your Drop repository:
9296

9397
```bash
94-
cargo build --release
98+
cd torrential && cargo build --release
9599
```
96100

97101
## Set up Drop runtime environment
@@ -122,19 +126,13 @@ You will need to install:
122126
Use your Node.js package manager to install prisma, either to the local directory or globally:
123127

124128
```bash
125-
npm install prisma@6.11.1 # local installation using npm
129+
npm install prisma@6.11.1 dotenv # dotenv is a requirement
126130
```
127131

128132
Then, with your database running:
129133

130134
```bash
131-
DATABASE_URL=<your database url> prisma migrate deploy
132-
```
133-
134-
If you've installed it locally, you might need to run:
135-
136-
```bash
137-
DATABASE_URL=<your database url> <package manager> prisma migrate deploy
135+
DATABASE_URL=<your database url> npm prisma migrate deploy
138136
```
139137

140138
4. ### Create your launch script
@@ -145,12 +143,13 @@ You will need to install:
145143

146144
```bash
147145
# required environment variables
148-
NGINX_CONF=./nginx.conf # potentially update if you've renamed the nginx.conf
149-
DATABASE_URL=<your database url>
150-
DATA=./data # potentially update if you'd like Drop to store data somewhere else (not library)
146+
export NGINX_CONFIG=./nginx.conf # potentially update if you've renamed the nginx.conf
147+
export DATABASE_URL=<your database url>
148+
export DATA=./data # potentially update if you'd like Drop to store data somewhere else (not library)
149+
export EXTERNAL_URL=http://localhost:3000
151150

152151
# optional variables
153-
# TORRENTIAL_PATH=<custom torrential path> # may be required if torrential isn't in your $PATH
152+
# export TORRENTIAL_PATH=<custom torrential path> # may be required if torrential isn't in your $PATH
154153
# ... see the rest of the document for other options ...
155154

156155
# run application

0 commit comments

Comments
 (0)