Skip to content

Commit cdf95b2

Browse files
committed
Add quick start guide
1 parent 7b1913b commit cdf95b2

8 files changed

Lines changed: 78 additions & 2 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ subsequently removed from mergin project (on cloud).
77

88
Also user can choose whether references to media files should be updated.
99

10+
### Quick start
11+
12+
Not sure where to start? Check out our [quick start](docs/quick_start.md) guide to set up sync from a new Mergin project to your MinIO/S3 bucket.
13+
14+
<div><img align="left" width="45" height="45" src="https://raw.githubusercontent.com/MerginMaps/docs/main/src/.vuepress/public/slack.svg"><a href="https://merginmaps.com/community/join">Join our community chat</a><br/>and ask questions!</div><br />
15+
1016
### Running with Docker
1117

1218
The easiest way to run Media sync is with Docker.
@@ -15,6 +21,7 @@ To build a local docker image:
1521
docker build -t mergin_media_sync .
1622
```
1723

24+
#### Local test
1825
To run the container, use a command like the following one:
1926
```shell
2027
docker run -it \
@@ -26,6 +33,7 @@ To run the container, use a command like the following one:
2633
The sync process will start, regularly checking Mergin service copy/move media files from mergin project to external storage.
2734
Local drive is a default backend, you need to mount volume from host machine for data to persist.
2835

36+
#### Update reference table in geopackage
2937
If you'd like to update references to media files (probably useful with MOVE mode), you can run:
3038
```shell
3139
docker run -it \
@@ -44,7 +52,7 @@ docker run -it \
4452
```
4553
Make sure you have correct structure of you .gpkg file. Otherwise leave all `REFERENCE__` variables empty.
4654

47-
55+
#### Using MinIO backend
4856
Last, in case you want to switch to different driver, you can run:
4957
```shell
5058
docker run -it \
@@ -62,7 +70,7 @@ docker run -it \
6270
mergin-media-sync python3 media_sync_daemon.py
6371
```
6472

65-
**Please note double underscore `__` is used to separate config group and item.**
73+
**Please note double underscore `__` is used to separate [config](config.ini.default) group and item.**
6674

6775
### Installation
6876

docs/images/bucket.png

34.5 KB
Loading

docs/images/new_proj.png

16.8 KB
Loading

docs/images/new_proj2.png

36.2 KB
Loading

docs/images/new_proj3.png

45.6 KB
Loading

docs/images/qgis_proj2.png

92.1 KB
Loading

docs/images/qgis_project.png

72.8 KB
Loading

docs/quick_start.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Quick start guide
2+
3+
In this quick start guide you will set up one way synchronization between a new Mergin project and your existing bucket (MinIO or S3).
4+
5+
## Prerequisites
6+
7+
- MinIO/AWS S3 bucket
8+
- docker engine
9+
10+
## 1. Create a bucket
11+
Create a public bucket if you do not have one.
12+
13+
## 2. Create an empty mergin project
14+
Go to [Mergin](https://public.cloudmergin.com/) website and create a new blank project.
15+
16+
![new_project](images/new_proj.png)
17+
18+
You should see there are not any files there.
19+
20+
![new_project_2](images/new_proj2.png)
21+
22+
and your full project name for later will be `<username>/<project-name>`, e.g. `john/media-sync`
23+
24+
## 3. Set up QGIS project
25+
Create a new QGIS project, add some layer (e.g. notes). Add few points and make sure you reference some pictures in attributes
26+
(e.g. photo). Create additional column for new URL where files would be copied to (e.g. external_url). Your project may look like this:
27+
28+
![project](images/qgis_project.png)
29+
30+
Upload your project to Mergin, either via web browser or [mergin plugin](https://github.com/lutraconsulting/qgis-mergin-plugin).
31+
32+
![plugin](images/new_proj3.png)
33+
34+
You have now your project ready in Mergin.
35+
36+
37+
## 4. Start syncing
38+
Download and run media-sync docker image with configuration based on above (you will need to tweak that):
39+
40+
```
41+
$ sudo docker run -it \
42+
--name mergin-media-sync \
43+
-e MERGIN__USERNAME=test000 \
44+
-e MERGIN__PASSWORD=myStrongPassword \
45+
-e MERGIN__PROJECT_NAME=test000/media-sync \
46+
-e DRIVER=minio \
47+
-e MINIO__ENDPOINT="minio-server-url" \
48+
-e MINIO__ACCESS_KEY=access-key \
49+
-e MINIO__SECRET_KEY=secret-key \
50+
-e MINIO__BUCKET=destination-bucket \
51+
-e MINIO__SECRET=1 \
52+
-e OPERATION_MODE=copy \
53+
-e REFERENCE__FILE=survey.gpkg \
54+
-e REFERENCE__TABLE=notes \
55+
-e REFERENCE__LOCAL_PATH_FIELD=photo \
56+
-e REFERENCE__DRIVER_PATH_FIELD=external_url \
57+
mergin-media-sync python3 media_sync_daemon.py
58+
```
59+
and you should see photos copied from your Mergin project to the bucket:
60+
61+
![bucket](images/bucket.png)
62+
63+
and your references in QGIS project updated:
64+
65+
![bucket](images/qgis_proj2.png)
66+
67+
In order to stop syncing simply stop docker container.
68+

0 commit comments

Comments
 (0)