Skip to content

Commit d6d5dd5

Browse files
committed
restructuring to mirror check list occurence
1 parent 27de0e9 commit d6d5dd5

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

docs/source/dev_setup.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,16 @@ A working Firebase Project (Including Firebase Functions and Database Rules) is
66
Get in touch with the MapSwipe team (e.g. in Slack) to get access to an existing Firebase Instance for development purposes.
77

88
Check list:
9-
1. Clone repo from GitHub.
10-
2. Install GDAL/OGR and GDAL for Python on your machine.
11-
3. Set environment variables and get a Service Account Key File.
12-
4. Set up local Postgres database using Docker.
13-
5. Install MapSwipe Workers Python package.
9+
1. Github: Clone repo from GitHub.
10+
2. Requirements: Install GDAL/OGR and GDAL for Python on your machine.
11+
3. Configuration: Set environment variables and get a Service Account Key File.
12+
4. Database: Set up local Postgres database using Docker.
13+
5. Python-Package: Install MapSwipe Workers Python package.
1414
6. Run MapSwipe Workers.
1515

1616

1717
## Installation
1818

19-
### Requirements
20-
21-
MapSwipe Workers requires GDAL/OGR (`gdal-bin`) and GDAL for Python (`libgdal-dev`, `python-gdal`) to be installed.
22-
Furthermore, we rely on Docker to set up Postgres.
23-
24-
2519
### Clone from GitHub
2620

2721
... and switch to development branch.
@@ -32,15 +26,29 @@ cd python-mapswipe-workers
3226
git checkout dev
3327
```
3428

29+
### Requirements
30+
31+
MapSwipe Workers requires GDAL/OGR (`gdal-bin`) and GDAL for Python (`libgdal-dev`, `python-gdal`) to be [installed](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html).
32+
Furthermore, we rely on Docker to set up Postgres.
33+
3534

3635
### Configuration
3736

3837
All configurations values are stored in environment variables. Please refer to the documentation on [Configuration](configuration.html) for further details.
3938

39+
#### Service Account Key
4040

41-
### Directories
41+
The MapSwipe Workers requires a Service Account Key (`serviceAccountKey.json`) to access Firebase database.
42+
Request yours from the MapSwipe working group.
4243

43-
MapSwipe Workers needs access to a data directory for logs and data for data for the API:
44+
The path to the Service Account Key is defined in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
45+
46+
You could also set up your own Firebase instance. However, this is not recommended.
47+
If you still want to do it, get your Service Account Key from Firebase from [Google Cloud Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
48+
49+
#### Directories
50+
51+
MapSwipe Workers needs access to a data directory for logs and data for the API:
4452

4553
To create this directories run:
4654
```
@@ -50,18 +58,7 @@ mkdir --parents ~/.local/share/mapswipe_workers
5058
> Note: XDG Base Directory Specification is respected
5159
5260

53-
### Service Account Key
54-
55-
The MapSwipe Workers requires a Service Account Key (`serviceAccountKey.json`) to access Firebase database.
56-
Request yours from the MapSwipe working group.
57-
58-
The path to the Service Account Key is defined in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
59-
60-
You could also set up your own Firebase instance. However, this is not recommended.
61-
If you still want to do it, get your Service Account Key from Firebase from [Google Cloud Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
62-
63-
64-
### Postgres
61+
### Database
6562

6663
Setup a local Postgres instance for MapSwipe Workers using the Dockerfile provided for development purposes (`postgres/Dockerfile-dev`).
6764
The Dockerfile for production (`postgres/Dockerfile`) does need additional setup for build-in backup to Google Cloud Storage, which is not needed for local development. That is why a simplified Dockerfile for development is provided.
@@ -75,7 +72,7 @@ docker run -d -p 5432:5432 --name mapswipe_postgres -e POSTGRES_DB="$POSTGRES_DB
7572
Or set up Postgres using the `initdb.sql` file in the `postgres/` folder.
7673

7774

78-
### Install MapSwipe Workers Python Package
75+
### Mapswipe-Workers Python Package
7976

8077
1. Export environment variables to current shell.
8178
2. Create a Python virtual environment with `system-site-packages` option enabled to get access to GDAL/OGR Python packages
@@ -94,11 +91,12 @@ mapswipe_workers --help
9491

9592
> Yeah! If you reached this point, you are ready to get into coding. Below you find some more information on Logging, Firebase Functions and Database Backup. However, you don't need this to get started for now.
9693
94+
# Further Information
9795

9896
## Logging
9997

10098
Mapswipe workers logs are generated using the Python logging module of the standard library (See [Official docs](https://docs.python.org/3/library/logging.html) or this [Tutorial](https://realpython.com/python-logging/#the-logging-module).
101-
To use the logger object import the it from the `definitions` module:
99+
To use the logger object import it from the `definitions` module:
102100

103101
```python
104102
from mapswipe_workers.definitions import logger
@@ -145,6 +143,7 @@ On how to setup the development environment and how to deploy functions to the F
145143
For more information refer to the official [Reference on Cloud Function for Firebase](https://firebase.google.com/docs/reference/functions/).
146144
For example function take a look at this [GitHub repository](https://github.com/firebase/functions-samples).
147145

146+
148147
## Database Backup
149148

150149
### Firebase

0 commit comments

Comments
 (0)