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
{{ message }}
This repository was archived by the owner on Oct 27, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+98-57Lines changed: 98 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,36 @@
1
1
# wmch-interactive-maps
2
-
A configurable backend to generate interactive maps on top of Wikidata.
3
2
4
-
## Settings
3
+
A configurable backend to generate and show interactive maps on top of Wikidata.
5
4
6
-
A base configuration file is available on `config.js`.
5
+
## User manual
7
6
8
-
Local settings like database name and authentication data are available in the git ignored `localconfig.json` in the following formats.
7
+
User manual in multiple languages is loaded on [i18n_man/index](https://github.com/synapta/wmch-interactive-maps/tree/master/i18n_man/index)
8
+
9
+
The user manual is available inside the app along the screenshots at the `/wizard/man/index` path.
9
10
10
-
TL;DR: Copy localconfig.example.json to localconfig.json
11
+
## Installation
11
12
12
-
Create directories:
13
+
Create `screenshots` and `local`directories:
13
14
14
15
`mkdir -p screenshots && mkdir -p local`
15
16
16
-
### url
17
+
Screenshots directory will contains preview files for maps, local directory could contain the sqlite database and other development data.
18
+
19
+
### Add localconfig.json
17
20
18
-
On localconfig.json, set the url to the production url. It will be used to:
19
-
- Get preview
20
-
- Expose the path to the user
21
+
***TL;DR: Copy localconfig.example.jsonto localconfig.json. Change data as needed.***
22
+
23
+
Local settings like database name and authentication data are available in the git ignored `localconfig.json` in the following formats.
21
24
22
-
It will be something like https://interactivemap.wikimedia.swiss/.
25
+
On localconfig.json, set the url to the production url. It will be used to expose the path to the user, something like https://example.org/.
23
26
24
-
### Database
27
+
### config.js
28
+
29
+
A global base configuration file is available on `config.js`.
30
+
31
+
It contains available map styles based on sources listed on [Tile servers](https://wiki.openstreetmap.org/wiki/Tile_servers) page on OpenStreetMap.
32
+
33
+
### Set up database
25
34
26
35
Data can be saved by two different connectors, SQLite and MariaDB.
27
36
@@ -65,7 +74,7 @@ Port and dialectOptions can be omitted, getting the default values above.
65
74
66
75
[Reference for MariaDB](http://docs.sequelizejs.com/manual/usage.html#mariadb)
67
76
68
-
## Run the app
77
+
## Run
69
78
70
79
`node app.js`
71
80
@@ -76,9 +85,27 @@ Port and dialectOptions can be omitted, getting the default values above.
76
85
15 Mar 10:46:31 - WMCH Interactive maps listening at http://:::9089
77
86
78
87
79
-
### Urls
80
-
- Backend: http://localhost:9089/wizard/
81
-
- Frontend: http://localhost:9089/
88
+
### Run the screenshot server
89
+
90
+
The screenshot server is used to take a screenshot of the map just before a map is saved to the database.
91
+
92
+
Port and url are specified on config.json.
93
+
94
+
`node screenshot.js`
95
+
96
+
Both the app.js and screenshot.js must be running at the same time.
97
+
98
+
### Auto-update and keep running
99
+
100
+
To auto-update and keep running the node servers in development environment on changes, you can use:
101
+
102
+
`nodemon MYSERVERSCRIPT.js --port MYPORT`
103
+
104
+
In this case nodemon must be installed globally.
105
+
106
+
## Languages
107
+
108
+
The app supports multiple languages.
82
109
83
110
### Language negotiation
84
111
@@ -89,29 +116,71 @@ To force a particular language in the format using the url use the `l` parameter
89
116
-http://localhost:9089/wizard/?l=it
90
117
-http://localhost:9089/wizard/?l=it-CH
91
118
119
+
A dropdown to change language is provided on both backend and frontend.
120
+
92
121
### Translations
93
122
94
123
All translations are key-based and hosted in JSON file named after the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code under the i18n folder.
95
124
96
-
Directory structure is.
125
+
Directory structure is associated with the respective section.
97
126
98
127
~~~
99
128
i18n
100
-
├── wizard
101
-
│ ├── en.json
102
-
│ └── it.json
103
-
└── frontend
104
-
├── en.json
105
-
└── it.json
129
+
|-- admin
130
+
| |-- en.json
131
+
| `-- it.json
132
+
|-- frontend
133
+
| |-- en.json
134
+
| `-- it.json
135
+
|-- manual
136
+
| |-- en.json
137
+
| `-- it.json
138
+
`-- wizard
139
+
|-- en.json
140
+
`-- it.json
141
+
106
142
~~~
107
143
108
-
The reference is the **en.json** file.
144
+
To add a new translation:
145
+
146
+
1. Add a new ISO 639-1 file to each directory inside `i18n` copying a file like `en.json` and changing the keys.
147
+
2. Edit `config.json` and add a new language code, e.g. `{"code": "ja", "name": "日本語"}`
148
+
149
+
## Paths
150
+
151
+
On development or locally, the main paths are:
152
+
153
+
- Backend: http://localhost:9089/admin/
154
+
- Wizard (backend and user manual): http://localhost:9089/wizard/
155
+
- Frontend: http://localhost:9089/
156
+
157
+
If the edit must be limited, `/admin` and `/wizard` paths can be protected via webserver.
158
+
159
+
## External resources
160
+
161
+
External libraries are loaded via Wikimedia CDN where availables:
External libraries are loaded via Wikimedia CDN where availables:
141
-
-https://tools.wmflabs.org/cdnjs/
142
-
143
-
## Run the screenshot server
207
+
Semantic UI Icons are available on wizard searching by class name.
144
208
145
-
The screenshot server is used to take a screenshot of the map just before a map is saved to the database.
209
+
These steps are useful when the Semantic UI version is changed.
146
210
147
-
Port and url are specified on config.json.
148
-
149
-
`node screenshot.js`
150
-
151
-
## Auto-update and keep running
152
-
153
-
To auto-update and keep running the node servers in development environment, you can use:
154
-
155
-
`nodemon MYSERVERSCRIPT.js --port MYPORT`
156
-
157
-
## Sticky maps
158
-
159
-
Maps can be set as sticky altering the sticky column. Greater sticky value will put the item on the top of the map list. Default value for sticky column is 0.
0 commit comments