adds italian && fit support

This commit is contained in:
Christian Beutel
2024-07-01 16:02:54 +02:00
parent 825c7db6e8
commit 3ab0882b81
19 changed files with 585 additions and 230 deletions

View File

@@ -0,0 +1,89 @@
package migrations
import (
"encoding/json"
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/models/schema"
)
func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("uavt73rsqcn1n13")
if err != nil {
return err
}
// update
edit_language := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "0sepzvkh",
"name": "language",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"en",
"de",
"fr",
"hu",
"it",
"nl",
"pl",
"pt",
"zh"
]
}
}`), edit_language); err != nil {
return err
}
collection.Schema.AddField(edit_language)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("uavt73rsqcn1n13")
if err != nil {
return err
}
// update
edit_language := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "0sepzvkh",
"name": "language",
"type": "select",
"required": false,
"presentable": false,
"unique": false,
"options": {
"maxSelect": 1,
"values": [
"en",
"de",
"fr",
"hu",
"nl",
"pl",
"pt",
"zh"
]
}
}`), edit_language); err != nil {
return err
}
collection.Schema.AddField(edit_language)
return dao.SaveCollection(collection)
})
}

BIN
docs/public/trailer.mp4 Normal file

Binary file not shown.

View File

@@ -0,0 +1,23 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M282.194 510.676C411.274 497.557 512 388.542 512 256C512 114.615 397.385 0 256 0C114.615 0 0 114.615 0 256C0 352.324 53.199 436.222 131.818 479.917C180.739 464.052 227.195 443.583 237.5 421C244.301 406.097 233.287 391.002 223.456 377.528C216.971 368.639 211 360.456 211 353.5C211 320.569 300.5 310 300.5 310H331.5C331.5 310 248.5 320.5 252.5 353.5C253.84 364.557 262.721 373.406 272.808 383.458C282.974 393.588 294.364 404.939 300.5 421C315.277 459.681 289.253 500.629 282.194 510.676Z" fill="white"/>
<path d="M348.212 206.014C349.872 203.329 354.021 203.329 355.681 206.014L416.362 304.207C418.022 306.893 415.947 310.25 412.628 310.25H291.265C287.945 310.25 285.871 306.893 287.531 304.207L348.212 206.014Z" fill="#242734"/>
<path d="M164.723 183.276C166.612 180.005 171.334 180.005 173.223 183.276L242.282 302.889C244.17 306.161 241.809 310.25 238.032 310.25H99.9145C96.137 310.25 93.776 306.161 95.6648 302.889L164.723 183.276Z" fill="#242734"/>
<path d="M266.25 155C268.56 151 274.333 151 276.643 155L361.08 301.25C363.389 305.25 360.503 310.25 355.884 310.25H187.009C182.39 310.25 179.503 305.25 181.813 301.25L266.25 155Z" fill="#242734"/>
<path d="M148.413 115.398C139.829 115.398 132.87 126.079 132.87 139.255H163.957C163.957 126.079 156.998 115.398 148.413 115.398Z" fill="#242734"/>
<path d="M123.11 115.398C108.138 115.398 96 126.079 96 139.255H150.221C150.221 126.079 138.083 115.398 123.11 115.398Z" fill="#242734"/>
<path d="M134.316 106C125.532 106 118.411 115.386 118.411 126.965H150.221C150.221 115.386 143.1 106 134.316 106Z" fill="#242734"/>
<path d="M276 67C264.402 67 255 79.9837 255 96H297C297 79.9837 287.598 67 276 67Z" fill="#242734"/>
<path d="M250 79C237.85 79 228 86.6112 228 96H272C272 86.6112 262.15 79 250 79Z" fill="#242734"/>
<path d="M255 63C245.611 63 238 72.402 238 84H272C272 72.402 264.389 63 255 63Z" fill="#242734"/>
<path d="M396.5 139C387.94 139 381 147.954 381 159H412C412 147.954 405.06 139 396.5 139Z" fill="#242734"/>
<path d="M365 138C352.85 138 343 147.402 343 159H387C387 147.402 377.15 138 365 138Z" fill="#242734"/>
<path d="M377 127C364.297 127 354 136.402 354 148H400C400 136.402 389.703 127 377 127Z" fill="#242734"/>
<path d="M113.567 421.162C113.567 419.505 114.91 418.162 116.567 418.162H123.285C124.942 418.162 126.285 419.505 126.285 421.162V425.76C126.285 427.417 124.942 428.76 123.285 428.76H116.567C114.91 428.76 113.567 427.417 113.567 425.76V421.162Z" fill="#242734"/>
<path d="M117.379 394.3C118.857 393.079 120.994 393.079 122.473 394.3L144.391 412.402C147.282 414.79 145.594 419.487 141.844 419.487H98.008C94.258 419.487 92.5695 414.79 95.4607 412.402L117.379 394.3Z" fill="#242734"/>
<path d="M117.172 382.093C118.715 380.627 121.136 380.627 122.68 382.093L142.519 400.927C145.14 403.416 143.379 407.828 139.765 407.828H100.086C96.4722 407.828 94.7112 403.416 97.3322 400.927L117.172 382.093Z" fill="#242734"/>
<path d="M116.856 370.436C118.455 368.521 121.397 368.521 122.996 370.436L139.007 389.606C141.182 392.211 139.33 396.17 135.937 396.17H103.915C100.521 396.17 98.6693 392.211 100.845 389.606L116.856 370.436Z" fill="#242734"/>
<path d="M347.567 397.162C347.567 395.505 348.91 394.162 350.567 394.162H357.285C358.942 394.162 360.285 395.505 360.285 397.162V401.76C360.285 403.417 358.942 404.76 357.285 404.76H350.567C348.91 404.76 347.567 403.417 347.567 401.76V397.162Z" fill="#242734"/>
<path d="M351.379 370.3C352.857 369.079 354.994 369.079 356.473 370.3L378.391 388.402C381.282 390.79 379.594 395.487 375.844 395.487H332.008C328.258 395.487 326.569 390.79 329.461 388.402L351.379 370.3Z" fill="#242734"/>
<path d="M351.172 358.093C352.715 356.627 355.136 356.627 356.68 358.093L376.519 376.927C379.14 379.416 377.379 383.828 373.765 383.828H334.086C330.472 383.828 328.711 379.416 331.332 376.927L351.172 358.093Z" fill="#242734"/>
<path d="M350.856 346.436C352.455 344.521 355.397 344.521 356.996 346.436L373.007 365.606C375.182 368.211 373.33 372.17 369.937 372.17H337.915C334.521 372.17 332.669 368.211 334.845 365.606L350.856 346.436Z" fill="#242734"/>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -21,7 +21,7 @@ GET /comment/{id}
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"expand": {
"author": {
"avatar": "string",
@@ -41,7 +41,7 @@ GET /comment/{id}
"rating": 0,
"text": "string",
"trail": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -61,7 +61,7 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» expand|object|true|none||none|
|»» author|object|true|none||none|
|»»» avatar|string|true|none||none|
@@ -79,7 +79,7 @@ HTTP Status Code **200**
|» rating|integer|true|none||none|
|» text|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -135,12 +135,12 @@ POST /comment/{id}
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"id": "string",
"rating": 0,
"text": "string",
"trail": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -160,12 +160,12 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» id|string|true|none||none|
|» rating|integer|true|none||none|
|» text|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -348,12 +348,12 @@ PUT /comment
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"id": "string",
"rating": 0,
"text": "string",
"trail": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -373,12 +373,12 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» id|string|true|none||none|
|» rating|integer|true|none||none|
|» text|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **400**

View File

@@ -53,18 +53,134 @@ GET /list/{id}
> 200 Response
```json
{}
{
"author": "string",
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"expand": {
"trails": [
{
"author": "string",
"category": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"date": "string",
"description": "string",
"difficulty": "string",
"distance": 0,
"duration": 0,
"elevation_gain": 0,
"expand": {
"category": {},
"waypoints": [
null
]
},
"gpx": "string",
"id": "string",
"lat": 0,
"location": "string",
"lon": 0,
"name": "string",
"photos": [
"string"
],
"public": true,
"summit_logs": [
"string"
],
"thumbnail": 0,
"updated": "string",
"waypoints": [
"string"
]
}
]
},
"id": "string",
"name": "string",
"trails": [
"string"
],
"updated": "2019-08-24T14:15:22Z"
}
```
### Responses
|HTTP Status Code |Meaning|Description|Data schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Record Not Found|Inline|
### Responses Data Schema
HTTP Status Code **200**
|Name|Type|Required|Restrictions|Title|description|
|---|---|---|---|---|---|
|» author|string|true|none||none|
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» expand|object|true|none||none|
|»» trails|[object]|true|none||none|
|»»» author|string|true|none||none|
|»»» category|string|true|none||none|
|»»» collectionId|string|true|none||none|
|»»» collectionName|string|true|none||none|
|»»» created|string|true|none||none|
|»»» date|string|true|none||none|
|»»» description|string|true|none||none|
|»»» difficulty|string|true|none||none|
|»»» distance|number|true|none||none|
|»»» duration|integer|true|none||none|
|»»» elevation_gain|number|true|none||none|
|»»» expand|object|true|none||none|
|»»»» category|object|true|none||none|
|»»»»» collectionId|string|true|none||none|
|»»»»» collectionName|string|true|none||none|
|»»»»» created|string|true|none||none|
|»»»»» id|string|true|none||none|
|»»»»» img|string|true|none||none|
|»»»»» name|string|true|none||none|
|»»»»» updated|string|true|none||none|
|»»»» waypoints|[object]|true|none||none|
|»»»»» author|string|true|none||none|
|»»»»» collectionId|string|true|none||none|
|»»»»» collectionName|string|true|none||none|
|»»»»» created|string|true|none||none|
|»»»»» description|string|true|none||none|
|»»»»» icon|string|true|none||none|
|»»»»» id|string|true|none||none|
|»»»»» lat|number|true|none||none|
|»»»»» lon|number|true|none||none|
|»»»»» name|string|true|none||none|
|»»»»» photos|[string]|true|none||none|
|»»»»» updated|string|true|none||none|
|»»» gpx|string|true|none||none|
|»»» id|string|true|none||none|
|»»» lat|number|true|none||none|
|»»» location|string|true|none||none|
|»»» lon|number|true|none||none|
|»»» name|string|true|none||none|
|»»» photos|[string]|true|none||none|
|»»» public|boolean|true|none||none|
|»»» summit_logs|[string]|true|none||none|
|»»» thumbnail|integer|true|none||none|
|»»» updated|string|true|none||none|
|»»» waypoints|[string]|true|none||none|
|» id|string|true|none||none|
|» name|string|true|none||none|
|» trails|[string]|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
|Name|Type|Required|Restrictions|Title|description|
@@ -93,7 +209,8 @@ POST /list/{id}
```json
{
"name": "string"
"name": "string",
"description": "string"
}
```
@@ -105,6 +222,7 @@ POST /list/{id}
|Content-Type|header|string| yes |none|
|body|body|object| no |none|
|» name|body|string| yes |none|
|» description|body|string| no |none|
> Response Examples
@@ -116,14 +234,14 @@ POST /list/{id}
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"name": "string",
"trails": [
"string"
],
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -144,12 +262,12 @@ HTTP Status Code **200**
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» id|string|true|none||none|
|» name|string|true|none||none|
|» trails|[string]|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -393,14 +511,14 @@ PUT /list
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"id": "string",
"name": "string",
"trails": [
"string"
],
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -421,12 +539,12 @@ HTTP Status Code **200**
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» id|string|true|none||none|
|» name|string|true|none||none|
|» trails|[string]|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **400**

View File

@@ -20,11 +20,11 @@ GET /summit-log/{id}
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"date": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"id": "string",
"text": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -43,11 +43,11 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» date|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» id|string|true|none||none|
|» text|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -77,7 +77,8 @@ POST /summit-log/{id}
```json
{
"name": "string"
"date": "2019-08-24",
"text": "string"
}
```
@@ -88,7 +89,8 @@ POST /summit-log/{id}
|id|path|string| yes |none|
|Content-Type|header|string| yes |none|
|body|body|object| no |none|
name|body|string| yes |none|
date|body|string(date)| yes |none|
|» text|body|string| no |none|
> Response Examples
@@ -98,11 +100,11 @@ POST /summit-log/{id}
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"date": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"id": "string",
"text": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -121,11 +123,11 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» date|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» id|string|true|none||none|
|» text|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -252,7 +254,7 @@ PUT /summit-log
```json
{
"date": "string",
"date": "2019-08-24",
"text": "string"
}
```
@@ -262,8 +264,8 @@ PUT /summit-log
|Name|Location|Type|Required|Description|
|---|---|---|---|---|
|body|body|object| no |none|
|» date|body|string| yes |none|
|» text|body|string| yes |none|
|» date|body|string(date)| yes |none|
|» text|body|string| no |none|
> Response Examples
@@ -273,11 +275,11 @@ PUT /summit-log
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"date": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"id": "string",
"text": "string",
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -296,11 +298,11 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» date|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» id|string|true|none||none|
|» text|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **400**

View File

@@ -20,11 +20,11 @@ GET /trail-share/{id}
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"id": "string",
"permission": "string",
"permission": "view",
"trail": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"user": "string"
}
```
@@ -44,13 +44,20 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» id|string|true|none||none|
|» permission|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» user|string|true|none||none|
#### Enum
|Name|Value|
|---|---|
|permission|view|
|permission|edit|
HTTP Status Code **404**
|Name|Type|Required|Restrictions|Title|description|
@@ -111,11 +118,11 @@ POST /trail-share/{id}
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"id": "string",
"permission": "string",
"permission": "view",
"trail": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"user": "string"
}
```
@@ -135,13 +142,20 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» id|string|true|none||none|
|» permission|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» user|string|true|none||none|
#### Enum
|Name|Value|
|---|---|
|permission|view|
|permission|edit|
HTTP Status Code **404**
|Name|Type|Required|Restrictions|Title|description|
@@ -315,11 +329,11 @@ PUT /trail-share
{
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"id": "string",
"permission": "string",
"permission": "view",
"trail": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"user": "string"
}
```
@@ -339,13 +353,20 @@ HTTP Status Code **200**
|---|---|---|---|---|---|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» id|string|true|none||none|
|» permission|string|true|none||none|
|» trail|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» user|string|true|none||none|
#### Enum
|Name|Value|
|---|---|
|permission|view|
|permission|edit|
HTTP Status Code **400**
|Name|Type|Required|Restrictions|Title|description|

View File

@@ -60,9 +60,10 @@ GET /trail/{id}
"category": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"description": "string",
"difficulty": "string",
"difficulty": "easy",
"distance": 0,
"duration": 0,
"elevation_gain": 0,
@@ -80,7 +81,7 @@ GET /trail/{id}
"string"
],
"thumbnail": 0,
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"waypoints": [
"string"
]
@@ -104,12 +105,13 @@ HTTP Status Code **200**
|» category|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» description|string|true|none||none|
|» difficulty|string|true|none||none|
|» distance|integer|true|none||none|
|» duration|integer|true|none||none|
|» elevation_gain|integer|true|none||none|
|» distance|number|true|none||none|
|» duration|number|true|none||none|
|» elevation_gain|number|true|none||none|
|» gpx|string|true|none||none|
|» id|string|true|none||none|
|» lat|number|true|none||none|
@@ -120,9 +122,17 @@ HTTP Status Code **200**
|» public|boolean|true|none||none|
|» summit_logs|[string]|true|none||none|
|» thumbnail|integer|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» waypoints|[string]|true|none||none|
#### Enum
|Name|Value|
|---|---|
|difficulty|easy|
|difficulty|moderate|
|difficulty|hard|
HTTP Status Code **404**
|Name|Type|Required|Restrictions|Title|description|
@@ -151,7 +161,18 @@ POST /trail/{id}
```json
{
"name": "string"
"name": "string",
"category": "string",
"description": "string",
"difficulty": "easy",
"distance": 0,
"duration": 0,
"elevation_gain": 0,
"lat": 0,
"location": "string",
"lon": 0,
"public": true,
"thumbnail": 0
}
```
@@ -163,6 +184,25 @@ POST /trail/{id}
|Content-Type|header|string| yes |none|
|body|body|object| no |none|
|» name|body|string| yes |none|
|» category|body|string| no |none|
|» description|body|string| no |none|
|» difficulty|body|string| no |none|
|» distance|body|number| no |none|
|» duration|body|number| no |none|
|» elevation_gain|body|number| no |none|
|» lat|body|number| no |none|
|» location|body|string| no |none|
|» lon|body|number| no |none|
|» public|body|boolean| no |none|
|» thumbnail|body|integer| no |none|
#### Enum
|Name|Value|
|---|---|
|» difficulty|easy|
|» difficulty|moderate|
|» difficulty|hard|
> Response Examples
@@ -174,9 +214,10 @@ POST /trail/{id}
"category": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"description": "string",
"difficulty": "string",
"difficulty": "easy",
"distance": 0,
"duration": 0,
"elevation_gain": 0,
@@ -223,7 +264,7 @@ POST /trail/{id}
"string"
],
"thumbnail": 0,
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"waypoints": [
"string"
]
@@ -247,12 +288,13 @@ HTTP Status Code **200**
|» category|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» description|string|true|none||none|
|» difficulty|string|true|none||none|
|» distance|integer|true|none||none|
|» duration|integer|true|none||none|
|» elevation_gain|integer|true|none||none|
|» distance|number|true|none||none|
|» duration|number|true|none||none|
|» elevation_gain|number|true|none||none|
|» expand|object|true|none||none|
|»» category|object|true|none||none|
|»»» collectionId|string|true|none||none|
@@ -285,9 +327,17 @@ HTTP Status Code **200**
|» public|boolean|true|none||none|
|» summit_logs|[string]|true|none||none|
|» thumbnail|integer|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» waypoints|[string]|true|none||none|
#### Enum
|Name|Value|
|---|---|
|difficulty|easy|
|difficulty|moderate|
|difficulty|hard|
HTTP Status Code **404**
|Name|Type|Required|Restrictions|Title|description|
@@ -476,34 +526,35 @@ string
```json
{
"name": "string",
"public": true,
"difficulty": "string",
"author": "string",
"category": "string",
"collectionId": "string",
"collectionName": "string",
"created": "2019-08-24T14:15:22Z",
"date": "2019-08-24",
"description": "string",
"difficulty": "easy",
"distance": 0,
"duration": 0,
"elevation_gain": 0,
"gpx": "string",
"id": "string",
"lat": 0,
"location": "string",
"lon": 0,
"thumbnail": 0,
"name": "string",
"photos": [
"string"
],
"waypoints": [
"string"
],
"public": true,
"summit_logs": [
"string"
],
"expand": {
"thumbnail": 0,
"updated": "2019-08-24T14:15:22Z",
"waypoints": [
"string"
],
"summit_logs": [
"string"
]
},
"tags": [
"string"
],
"description": "string",
"author": "string"
}
```
@@ -524,8 +575,8 @@ HTTP Status Code **200**
|» category|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» date|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» date|string(date)|true|none||none|
|» description|string|true|none||none|
|» difficulty|string|true|none||none|
|» distance|number|true|none||none|
@@ -541,9 +592,17 @@ HTTP Status Code **200**
|» public|boolean|true|none||none|
|» summit_logs|[string]|true|none||none|
|» thumbnail|integer|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» waypoints|[string]|true|none||none|
#### Enum
|Name|Value|
|---|---|
|difficulty|easy|
|difficulty|moderate|
|difficulty|hard|
HTTP Status Code **400**
|Name|Type|Required|Restrictions|Title|description|

View File

@@ -57,19 +57,12 @@ GET /user/{id}
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"email": "string",
"emailVisibility": true,
"id": "string",
"language": "string",
"location": {
"lat": 0,
"lon": 0,
"name": "string"
},
"token": "string",
"unit": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"username": "string",
"verified": true
}
@@ -91,18 +84,12 @@ HTTP Status Code **200**
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» email|string|true|none||none|
|» emailVisibility|boolean|true|none||none|
|» id|string|true|none||none|
|» language|string|true|none||none|
|» location|object|true|none||none|
|»» lat|number|true|none||none|
|»» lon|number|true|none||none|
|»» name|string|true|none||none|
|» token|string|true|none||none|
|» unit|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» username|string|true|none||none|
|» verified|boolean|true|none||none|
@@ -153,19 +140,12 @@ POST /user/{id}
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"email": "string",
"emailVisibility": true,
"id": "string",
"language": "string",
"location": {
"lat": 0,
"lon": 0,
"name": "string"
},
"token": "string",
"unit": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"username": "string",
"verified": true
}
@@ -187,18 +167,12 @@ HTTP Status Code **200**
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» email|string|true|none||none|
|» emailVisibility|boolean|true|none||none|
|» id|string|true|none||none|
|» language|string|true|none||none|
|» location|object|true|none||none|
|»» lat|number|true|none||none|
|»» lon|number|true|none||none|
|»» name|string|true|none||none|
|» token|string|true|none||none|
|» unit|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» username|string|true|none||none|
|» verified|boolean|true|none||none|
@@ -311,14 +285,11 @@ PUT /user
"avatar": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"emailVisibility": true,
"id": "string",
"language": "string",
"location": null,
"token": "string",
"unit": "string",
"updated": "string",
"updated": "2019-08-24T14:15:22Z",
"username": "string",
"verified": true
}
@@ -340,14 +311,11 @@ HTTP Status Code **200**
|» avatar|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» emailVisibility|boolean|true|none||none|
|» id|string|true|none||none|
|» language|string|true|none||none|
|» location|null|true|none||none|
|» token|string|true|none||none|
|» unit|string|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
|» username|string|true|none||none|
|» verified|boolean|true|none||none|

View File

@@ -21,7 +21,7 @@ GET /waypoint/{id}
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"icon": "string",
"id": "string",
@@ -31,7 +31,7 @@ GET /waypoint/{id}
"photos": [
"string"
],
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -51,15 +51,15 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» icon|string|true|none||none|
|» id|string|true|none||none|
|» lat|integer|true|none||none|
|» lon|integer|true|none||none|
|» lat|number|true|none||none|
|» lon|number|true|none||none|
|» name|string|true|none||none|
|» photos|[string]|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -89,7 +89,11 @@ POST /waypoint/{id}
```json
{
"name": "string"
"name": "string",
"description": "string",
"lat": 0,
"lon": 0,
"icon": "string"
}
```
@@ -100,7 +104,11 @@ POST /waypoint/{id}
|id|path|string| yes |none|
|Content-Type|header|string| yes |none|
|body|body|object| no |none|
|» name|body|string| yes |none|
|» name|body|string| no |none|
|» description|body|string| no |none|
|» lat|body|number| yes |none|
|» lon|body|number| yes |none|
|» icon|body|string| no |none|
> Response Examples
@@ -111,7 +119,7 @@ POST /waypoint/{id}
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"icon": "string",
"id": "string",
@@ -121,7 +129,7 @@ POST /waypoint/{id}
"photos": [
"string"
],
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -141,15 +149,15 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» icon|string|true|none||none|
|» id|string|true|none||none|
|» lat|integer|true|none||none|
|» lon|integer|true|none||none|
|» lat|number|true|none||none|
|» lon|number|true|none||none|
|» name|string|true|none||none|
|» photos|[string]|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **404**
@@ -305,8 +313,8 @@ PUT /waypoint
|» name|body|string| no |none|
|» description|body|string| no |none|
|» author|body|string| yes |none|
|» lat|body|integer| yes |none|
|» lon|body|integer| yes |none|
|» lat|body|number| yes |none|
|» lon|body|number| yes |none|
|» icon|body|string| no |none|
> Response Examples
@@ -318,7 +326,7 @@ PUT /waypoint
"author": "string",
"collectionId": "string",
"collectionName": "string",
"created": "string",
"created": "2019-08-24T14:15:22Z",
"description": "string",
"icon": "string",
"id": "string",
@@ -328,7 +336,7 @@ PUT /waypoint
"photos": [
"string"
],
"updated": "string"
"updated": "2019-08-24T14:15:22Z"
}
```
@@ -348,15 +356,15 @@ HTTP Status Code **200**
|» author|string|true|none||none|
|» collectionId|string|true|none||none|
|» collectionName|string|true|none||none|
|» created|string|true|none||none|
|» created|string(date-time)|true|none||none|
|» description|string|true|none||none|
|» icon|string|true|none||none|
|» id|string|true|none||none|
|» lat|integer|true|none||none|
|» lon|integer|true|none||none|
|» lat|number|true|none||none|
|» lon|number|true|none||none|
|» name|string|true|none||none|
|» photos|[string]|true|none||none|
|» updated|string|true|none||none|
|» updated|string(date-time)|true|none||none|
HTTP Status Code **400**
@@ -377,4 +385,3 @@ HTTP Status Code **400**
|»»» message|string|true|none||none|
|»»» data|object|true|none||none|
|» name|string|true|none||none|

View File

@@ -7,7 +7,8 @@ hero:
Welcome to <span class="-tracking-[0.075em] s-y_bCXRrkrYfP">wanderer</span>
tagline: <span class="-tracking-[0.075em] s-y_bCXRrkrYfP">wanderer</span> is a self-hosted trail database. You can upload your recorded GPS tracks or create new ones and add various metadata to build an easily searchable catalogue.
image:
file: ../../assets/logo_dark.svg
html:
<video class="rounded-xl" width="600" src="/trailer.mp4" controls autoplay />
actions:
- text: Try the demo
link: https://demo.wanderer.to

6
web/package-lock.json generated
View File

@@ -16,6 +16,7 @@
"@types/three": "^0.161.2",
"canvg": "^4.0.1",
"crypto-random-string": "^5.0.0",
"easy-fit": "^0.0.8",
"instead": "^1.0.3",
"isomorphic-xml2js": "^0.1.3",
"jspdf": "^2.5.1",
@@ -2234,6 +2235,11 @@
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
"dev": true
},
"node_modules/easy-fit": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/easy-fit/-/easy-fit-0.0.8.tgz",
"integrity": "sha512-59BXYGsiteuFG7qfkOccPz2ioXH9RTWcO4ffY/m3niYdAyzYSsSkgqOB6vKncLcbIBZU9cC8V12dCbeAlPBeew=="
},
"node_modules/electron-to-chromium": {
"version": "1.4.647",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.647.tgz",

View File

@@ -40,6 +40,7 @@
"@types/three": "^0.161.2",
"canvg": "^4.0.1",
"crypto-random-string": "^5.0.0",
"easy-fit": "^0.0.8",
"instead": "^1.0.3",
"isomorphic-xml2js": "^0.1.3",
"jspdf": "^2.5.1",

View File

@@ -9,12 +9,12 @@
import "leaflet/dist/leaflet.css";
import { createEventDispatcher, onMount } from "svelte";
import { _ } from "svelte-i18n";
import Dropdown, { type DropdownItem } from "../base/dropdown.svelte";
import Dropdown from "../base/dropdown.svelte";
export let trail: Trail | null;
export let markers: Marker[] = [];
export let map: Map | null = null;
export let options = {};
export let options: any = {};
export let graticule: AutoGraticule | null = null;
export let crosshair: boolean = false;
@@ -28,7 +28,7 @@
$: gpxData = trail?.expand.gpx_data;
$: if (gpxData && controlElevation) {
controlElevation.updateOptions({
autofitBounds: true,
autofitBounds: options.autofitBounds ?? true,
});
controlElevation.clear();
controlElevation.load(gpxData);

View File

@@ -9,6 +9,7 @@ register('en', () => import('./locales/en.json'))
register('de', () => import('./locales/de.json'))
register('fr', () => import('./locales/fr.json'))
register('hu', () => import('./locales/hu.json'))
register('it', () => import('./locales/it.json'))
register('nl', () => import('./locales/nl.json'))
register('pl', () => import('./locales/pl.json'))
register('pt', () => import('./locales/pt.json'))

View File

@@ -2,14 +2,14 @@
class Settings {
id?: string;
unit?: "metric" | "imperial";
language?: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt" | "zh";
language?: "en" | "de" | "fr" | "hu"| "it" | "nl" | "pl" | "pt" | "zh";
mapFocus?: "trails" | "location";
location?: { name: string, lat: number, lon: number };
user?: string;
constructor(
unit: "metric" | "imperial",
language: "en" | "de" | "fr" | "hu" | "nl" | "pl" | "pt" | "zh",
language: "en" | "de" | "fr" | "hu"| "it" | "nl" | "pl" | "pt" | "zh",
mapFocus: "trails" | "location",
user: string,
params?: {

View File

@@ -1,11 +1,16 @@
import GPX from "$lib/models/gpx/gpx";
import { Trail } from "$lib/models/trail";
import { Waypoint } from "$lib/models/waypoint";
import { Waypoint, waypointSchema } from "$lib/models/waypoint";
import { currentUser } from "$lib/stores/user_store";
import GeoJsonToGpx from "$lib/vendor/geoJSONToGPX";
import { kml, tcx } from "$lib/vendor/toGeoJSON/toGeoJSON";
import cryptoRandomString from "crypto-random-string";
import { get } from "svelte/store";
//@ts-ignore
import EasyFit from "easy-fit"
import Track from "$lib/models/gpx/track";
import TrackSegment from "$lib/models/gpx/track-segment";
import GPXWaypoint from "$lib/models/gpx/waypoint";
export async function gpx2trail(gpxString: string) {
const gpx = await GPX.parse(gpxString);
@@ -16,7 +21,7 @@ export async function gpx2trail(gpxString: string) {
const trail = new Trail("");
trail.name = gpx.metadata?.name || gpx.trk?.at(0)?.name || gpx.rte?.at(0)?.name ||  `trail-${new Date().toISOString()}`;
trail.name = gpx.metadata?.name || gpx.trk?.at(0)?.name || gpx.rte?.at(0)?.name || `trail-${new Date().toISOString()}`;
trail.description = gpx.metadata?.desc;
@@ -125,3 +130,42 @@ export function fromTCX(tcxData: string) {
const gpx = GeoJsonToGpx(geojson as any, options)
return new XMLSerializer().serializeToString(gpx)
}
export async function fromFIT(fitData: ArrayBuffer) {
const easyFit = new EasyFit({
});
return new Promise<string>((resolve, reject) => easyFit.parse(fitData, function (error: string, data: any) {
if (error) {
console.log(error);
reject(error)
}
console.log(data);
const gpx = new GPX({
metadata: {
name: "",
desc: "",
time: data.activity?.timestamp ?? new Date(),
keywords: "wanderer"
},
trk: [
new Track({
trkseg: new TrackSegment({
trkpt: data.records.flatMap((d => {
return (d.position_lat && d.position_long) ? new GPXWaypoint({
$: { lat: d.position_lat, lon: d.position_long },
time: d.timestamp,
ele: d.altitude
}) : []
}))
})
})
]
});
console.log(gpx);
resolve(gpx.toString());
}));
}

View File

@@ -31,6 +31,7 @@
{ text: $_("english"), value: "en" },
{ text: $_("french"), value: "fr" },
{ text: $_("hungarian"), value: "hu" },
{ text: $_("italian"), value: "it" },
{ text: $_("dutch"), value: "nl" },
{ text: $_("polish"), value: "pl" },
{ text: $_("portuguese"), value: "pt" },

View File

@@ -50,7 +50,7 @@
formatElevation,
formatTimeHHMM,
} from "$lib/util/format_util";
import { fromKML, fromTCX, gpx2trail } from "$lib/util/gpx_util";
import { fromFIT, fromKML, fromTCX, gpx2trail } from "$lib/util/gpx_util";
import {
createAnchorMarker,
createMarkerFromWaypoint,
@@ -221,7 +221,37 @@
document.getElementById("fileInput")!.click();
}
function handleFileSelection() {
async function parseFile(file: File) {
const fileExtension = file.name.split(".").pop()?.toLowerCase();
let gpxData = "";
if (fileExtension !== "fit") {
const fileContent = await file.text();
if (fileContent.includes("http://www.opengis.net/kml")) {
gpxData = fromKML(fileContent);
gpxFile = new Blob([gpxData], {
type: "application/gpx+xml",
});
return gpxData;
} else if (fileContent.includes("TrainingCenterDatabase")) {
gpxData = fromTCX(fileContent);
gpxFile = new Blob([gpxData], {
type: "application/gpx+xml",
});
} else {
gpxData = fileContent;
gpxFile = file;
}
} else {
const fileContent = await file.arrayBuffer();
gpxData = await fromFIT(fileContent);
}
return gpxData
}
async function handleFileSelection() {
const selectedFile = (
document.getElementById("fileInput") as HTMLInputElement
).files?.[0];
@@ -235,27 +265,14 @@
clearRoute();
drawingActive = false;
overwriteGPX = false;
var reader = new FileReader();
reader.readAsText(selectedFile);
let gpxData = await parseFile(selectedFile);
reader.onload = async function (e) {
let gpxData = "";
const fileContent = e.target?.result as string;
if (fileContent.includes("http://www.opengis.net/kml")) {
gpxData = fromKML(e.target?.result as string);
gpxFile = new Blob([gpxData], { type: "application/gpx+xml" });
} else if (fileContent.includes("TrainingCenterDatabase")) {
gpxData = fromTCX(e.target?.result as string);
gpxFile = new Blob([gpxData], { type: "application/gpx+xml" });
} else {
gpxData = fileContent;
gpxFile = selectedFile;
}
try {
const parseResult = await gpx2trail(gpxData);
$form = parseResult.trail;
$form.expand.gpx_data = gpxData;
$form.category = $categories[0].id;
setRoute(parseResult.gpx);
initRouteAnchors(parseResult.gpx);
@@ -278,9 +295,7 @@
body: JSON.stringify({
q: "",
options: {
filter: [
`_geoRadius(${$form.lat}, ${$form.lon}, 10000)`,
],
filter: [`_geoRadius(${$form.lat}, ${$form.lon}, 10000)`],
sort: [`_geoPoint(${$form.lat}, ${$form.lon}):asc`],
limit: 1,
},
@@ -289,7 +304,6 @@
const closestCity = (await r.json()).hits[0];
$form.location = closestCity.name;
};
}
function clearWaypoints() {
@@ -386,7 +400,7 @@
}
function beforSummitLogModalOpen() {
summitLog.set(new SummitLog(new Date().toISOString().split('T')[0]));
summitLog.set(new SummitLog(new Date().toISOString().split("T")[0]));
openSummitLogModal();
}
@@ -640,7 +654,7 @@
type="file"
name="gpx"
id="fileInput"
accept=".gpx,.GPX,.tcx,.TCX,.kml,.KML"
accept=".gpx,.GPX,.tcx,.TCX,.kml,.KML,.fit,.FIT"
style="display: none;"
on:change={handleFileSelection}
/>