You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOP.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,69 @@ The project uses TypeScript. Build packages with
14
14
pnpm build
15
15
```
16
16
17
+
# Running Service
18
+
19
+
## Dependent Services
20
+
21
+
The PowerSync service requires Postgres and MongoDB server connections. These configuration details can be specified in a `powersync.yaml` (or JSON) configuration file.
22
+
23
+
See the [Self hosting demo](https://github.com/powersync-ja/self-host-demo) for examples of starting these services.
24
+
25
+
A quick method for running all required services with a handy backend and frontend is to run the following in a checked-out `self-host-demo` folder.
26
+
27
+
```bash
28
+
docker compose up --scale powersync=0
29
+
```
30
+
31
+
Note: The `mongo` hostname specified in the MongoDB replica set needs to be accessible by your host machine if using the Mongo service above.
32
+
33
+
This will start all the services defined in the Self hosting demo except for the PowerSync service - which will be started from this repository.
34
+
35
+
## Local Configuration
36
+
37
+
The `./service` folder contains a NodeJS project which starts all PowerSync service operations.
38
+
39
+
Copy the template configuration files and configure any changes to your local needs.
The service can be started with watching changes to any consumed source files by running the `pnpm watch:service` command in the repository root.
50
+
51
+
# Running Tests
52
+
53
+
Most packages should contain a `test` script which can be executed with `pnpm test`. Some packages may require additional setup to run tests.
54
+
55
+
## Service Core
56
+
57
+
Some tests for these packages require a connection to MongoDB and Postgres. Connection strings for these services should be available as environment variables. See [Running Tests](#running-services) for details on configuring those services.
or by copying the `.env.template` file and using a loader such as [Direnv](https://direnv.net/)
67
+
68
+
```bash
69
+
cp .env.template .env
70
+
```
71
+
72
+
## Postgres Configuration
73
+
74
+
The default `PG_TEST_URL` points to a `powersync_test` database. Ensure this is created by executing the following SQL on your connection.
75
+
76
+
```SQL
77
+
CREATEDATABASEpowersync_test;
78
+
```
79
+
17
80
# Releases
18
81
19
82
This repository uses Changesets. Add changesets to changed packages before merging PRs.
@@ -22,4 +85,6 @@ This repository uses Changesets. Add changesets to changed packages before mergi
22
85
changeset add
23
86
```
24
87
25
-
Merging a PR with changeset files will automatically create a release PR. Merging the release PR will bump versions, tag and publish packages and the Docker image. The Docker image version is extracted from the `./service/package.json``version` field.
88
+
Merging a PR with changeset files will automatically create a release PR. Merging the release PR will bump versions, tag and publish packages.
89
+
90
+
The Docker image is published by manually triggering the `Docker Image Release` Github Action. The Docker image version is extracted from the `./service/package.json``version` field.
0 commit comments