# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Guideng
spec:
    description: Self-hosted family location sharing app with a Rust server and React client.
    icon: https://raw.githubusercontent.com/619dev/guideng/main/client/public/assets/guideng-logo.png
    variables:
        - key: GUIDENG_TOKEN
          type: PASSWORD
          name: Shared Token
          description: Shared token for all Guideng clients. Leave empty to let the server generate one on startup.
        - key: GUIDENG_AMAP_WEB_JS_API_KEY
          type: STRING
          name: AMap Web JS API Key
          description: AMap Web JavaScript API key for the web client.
        - key: GUIDENG_AMAP_WEB_JS_SECURITY_CODE
          type: PASSWORD
          name: AMap Web JS Security Code
          description: AMap Web JavaScript API security code paired with the web key.
        - key: GUIDENG_AMAP_ANDROID_KEY
          type: STRING
          name: AMap Android Key
          description: AMap Android SDK key for future Android app builds.
        - key: GUIDENG_AMAP_IOS_KEY
          type: STRING
          name: AMap iOS Key
          description: AMap iOS SDK key for future iOS app builds.
    tags:
        - Tool
        - Family
        - Location
    readme: |-
        # Guideng

        Guideng is a self-hosted family location sharing app.

        Deploys:

        - `server`: Rust API server, SQLite storage, latest 7 days of tracks.
        - `client`: React web client.

        If `GUIDENG_TOKEN` is empty, the server generates a 128-character random token and writes it to `/data/guideng.log`.
    services:
        - name: server
          icon: https://raw.githubusercontent.com/619dev/guideng/main/client/public/assets/guideng-logo.png
          template: PREBUILT
          spec:
            id: server
            source:
                image: facilisvelox/guideng-server:latest
            ports:
                - id: http
                  port: 8080
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
            env:
                GUIDENG_AMAP_ANDROID_KEY:
                    default: ${GUIDENG_AMAP_ANDROID_KEY}
                GUIDENG_AMAP_IOS_KEY:
                    default: ${GUIDENG_AMAP_IOS_KEY}
                GUIDENG_AMAP_WEB_JS_API_KEY:
                    default: ${GUIDENG_AMAP_WEB_JS_API_KEY}
                GUIDENG_AMAP_WEB_JS_SECURITY_CODE:
                    default: ${GUIDENG_AMAP_WEB_JS_SECURITY_CODE}
                GUIDENG_BIND:
                    default: 0.0.0.0:8080
                GUIDENG_CORS_ORIGINS:
                    default: '*'
                GUIDENG_DATABASE_URL:
                    default: /data/guideng.sqlite3
                GUIDENG_LOG_PATH:
                    default: /data/guideng.log
                GUIDENG_TOKEN:
                    default: ${GUIDENG_TOKEN}
            healthCheck:
                type: HTTP
                port: http
                http:
                    path: /health
        - name: client
          icon: https://raw.githubusercontent.com/619dev/guideng/main/client/public/assets/guideng-logo.png
          dependencies:
            - server
          template: PREBUILT
          spec:
            id: client
            source:
                image: facilisvelox/guideng-client:latest
            ports:
                - id: http
                  port: 80
                  type: HTTP
