Sturdy has 4 main components:
Name | Description | Links |
---|---|---|
api |
The backend. Does all of the version control. Built with Go | Sources |
web |
The website. Built with TypesScript, Vue 3, urql, and more. | Sources |
sturdy-sync |
The file synchronizer. A fork of mutagen. | Sources, The Sturdy fork of Mutagen |
app |
The electron app. Runs sturdy-sync, and renders the web app. | Sources |
# This is a simplified diagram of how all components connect to each other
# Protocols are annotated [like this].
Electron ──[HTTPS]───► Web ───[GraphQL]────► API
│ ▲
│ │
│ [REST/JSON]
│ │
▼ │
Local-Syncer ─────────[SSH]────────────► Remote-Syncer
Sturdy has a Docker container called the "oneliner", which contains all components of Sturdy in a single easy-to-run container. This is the easiest way to get a full development environment for all components except for the Electron App (most of the time however, connecting the production build of the Sturdy app is good enough).
./scripts/run-oneliner.sh
To support a full development environment, with hot reloading and fast restarts.
- Run PostgreSQL, LFS, and the SSH servers in Docker:
./up --build
- Build and run the API
server:
./scripts/build-run-api.sh
- Build and run the web frontend:
./scripts/build-run-web.sh
- Build and run the Electron app:
./scripts/build-run-app.sh
The easiest way to develop against the API-server is to test it through the GraphQL API.
- Get a auth token from
http://localhost:8080/api
(when logged in). - Use a GraphQL client like Insomnia or Altair.
- Connect to
http://localhost:3000/graphql
- Authenticate with
Authentication: bearer $YOUR_TOKEN
- You might have to set the Origin header to
http://localhost:8080
# Run unit tests
cd api && go test getsturdy.com/api/...
# Run unit tests in Docker
docker compose -f ci/docker-compose.yaml -f ci/unit/docker-compose.yaml up --build --exit-code-from runner
# Run unit + E2E tests
docker compose -f ci/docker-compose.yaml -f ci/e2e/docker-compose.yaml up --build --exit-code-from runner
yarn test && yarn lint
For Sturdy employees: How to build and run Sturdy Cloud