Skip to content

Commit c83e952

Browse files
authored
docs(self-host): improve self hosting docs (#1800)
* docs(self-host): add manual install guide * docs: update self-hosting docs
1 parent d794461 commit c83e952

9 files changed

Lines changed: 653 additions & 123 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ It'll be around for the long-term:
3737
- User sessions
3838

3939
### The Limitations
40+
4041
Current things we don't support (yet):
42+
4143
- Subcalendar sync (only primary calendar)
4244
- Sharing, reminders, locations
4345
- Mobile app
@@ -86,6 +88,7 @@ We love contributions! Whether it's bug fixes, new features, or documentation im
8688
**Feedback**: Share your ideas on [GitHub Discussions](https://github.com/SwitchbackTech/compass/discussions).
8789

8890
## Resources
91+
8992
- **Docsite**: [docs.compasscalendar.com](https://docs.compasscalendar.com/docs)
9093
- **Changelog**: [compasscalendar.com](https://changelog.compasscalendar.com)
9194
- **Handbook**: [notion.site](https://alpaca-ty.notion.site/Compass-Handbook-26b237bde8f4805c9a56de6db3a7993d?utm_source=github&utm_medium=referral&utm_campaign=readme)

docs/development/quickstart.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Development Quickstart
2+
3+
## Get code and dependencies
4+
5+
```bash
6+
git clone git@github.com:SwitchbackTech/compass.git
7+
8+
cd compass
9+
10+
bun install
11+
12+
## Setup config values
13+
14+
```bash
15+
cp compass.example.yaml compass.yaml
16+
```
17+
18+
Replace the placeholder values in `compass.yaml`
19+
20+
## Run
21+
22+
Run the web app in one terminal:
23+
24+
```bash
25+
bun run dev:web
26+
# Frontend on <http://localhost:9080>
27+
```
28+
29+
Run the backend in another terminal:
30+
31+
```bash
32+
bun run dev:backend
33+
# Backend on <http://localhost:3000>
34+
```
35+
36+
## Testing
37+
38+
After making your changes, you can run our test suite locally before opening a PR.
39+
40+
```bash
41+
bun run test:core && bun run test:web && bun run test:backend
42+
bun run test:e2e
43+
```

docs/self-hosting/README.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Start with [Run Compass on a server](./server-guide.md). It walks through a smal
66

77
If you only want to run Compass on your own computer, use the normal local development flow with Bun instead of the self-host installer.
88

9-
## What Compass is made of
9+
## Compass architecture
1010

1111
When you self-host Compass on a server, you get a stack of small services. Only the public website and API are reachable from your browser. The databases stay private inside Docker.
1212

@@ -32,19 +32,8 @@ flowchart TD
3232

3333
## Start here
3434

35-
- New self-host install: [Run Compass on a server](./server-guide.md)
36-
- Backups and restore: [Back up and restore your data](./backup-and-restore.md)
37-
- Google Calendar: [Add Google Calendar](./google-calendar.md)
38-
- Monitoring: [Monitoring](./monitoring.md)
35+
Ready to get this setup on your infrastructure? See [Run Compass on a server](./server-guide.md)
3936

40-
## What you still need to handle yourself
41-
42-
These docs keep the default self-host path focused on a small server. They do not set up:
43-
44-
- a built-in backup scheduler
45-
- an automatic restore flow
46-
- a rollback command for `./compass update`
47-
- Docker backups for browser IndexedDB data
48-
- automatic Google Calendar watch maintenance (see [Google Calendar](./google-calendar.md))
37+
----
4938

5039
Have an idea on how we can make self-hosting easier? Let us know in [this GitHub Discussion](https://github.com/SwitchbackTech/compass/discussions/1694).

docs/self-hosting/backup-and-restore.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,6 @@ rerun the installer.
334334
After you have a backup you trust, return to [Server hosting guide](./server-guide.md)
335335
for server checks and update notes.
336336

337+
----
338+
337339
Have an idea on how we can make self-hosting easier? Let us know in [this GitHub Discussion](https://github.com/SwitchbackTech/compass/discussions/1694).

docs/self-hosting/customizing.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Custom code guide
2+
3+
We deploy our code to DockerHub so it's easy to pull them down during updates without manually rebuilding. This guide is for those who want to run their own Compass code in their selfhosted environment.
4+
5+
> **Warning: back up before every update.** `./compass update` rebuilds with newer code. There is no rollback. Back up `~/compass/compass.yaml`, the Mongo volumes, and the SuperTokens Postgres volume **together**. See [Backups and restore](./backup-and-restore.md).
6+
7+
Then:
8+
9+
```bash
10+
cd ~/compass
11+
./compass update
12+
```
13+
14+
## Customizing web code
15+
16+
There are a few scenarios when you'll need to customize things:
17+
18+
- When you want to change the API URL used by the browser
19+
- When you want to enable Google OAuth
20+
21+
These values are baked into the web bundle, so they require a rebuild.
22+
23+
If you need one of those values to differ from the published image, build and push a custom `compass-web` image, then set `web.image` in `compass.yaml` to the
24+
tag you pushed:
25+
26+
```yaml
27+
web:
28+
image: your-registry/compass-web:your-tag
29+
url: https://compass.example.com
30+
```
31+
32+
The `compass` script exports `web.image` as `COMPASS_WEB_IMAGE` and Docker Compose uses it automatically. Run `./compass restart` after updating the field.

docs/self-hosting/google-calendar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,6 @@ The repo has the code paths for Google watches and repair. The self-host Docker
166166

167167
If you need public Google watch notifications, continue with [Server hosting guide](./server-guide.md).
168168

169+
----
170+
169171
Have an idea on how we can make self-hosting easier? Let us know in [this GitHub Discussion](https://github.com/SwitchbackTech/compass/discussions/1694).

docs/self-hosting/monitoring.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ GET /api/health
1111
No authentication required.
1212

1313
**Response (healthy):** `200 OK`
14+
1415
```json
1516
{"status": "ok", "timestamp": "2025-01-01T00:00:00.000Z"}
1617
```
1718

1819
**Response (unhealthy):** `500 Internal Server Error`
20+
1921
```json
2022
{"status": "error", "timestamp": "2025-01-01T00:00:00.000Z"}
2123
```
2224

2325
The check calls `db.admin().ping()` against MongoDB. Call it on whatever schedule makes sense for your setup — Compass does not impose a polling interval.
2426

27+
----
28+
2529
Have an idea on how we can make self-hosting easier? Let us know in [this GitHub Discussion](https://github.com/SwitchbackTech/compass/discussions/1694).

0 commit comments

Comments
 (0)