# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: OpenFlags
spec:
    description: The lightweight alternative to LaunchDarkly — built for React, Bun, and Node.js.
    icon: https://openflags.dev/favicon.svg
    variables:
        - key: DASHBOARD_DOMAIN
          type: DOMAIN
          name: Dashboard Domain
          description: Domain for the OpenFlags admin dashboard
        - key: SERVER_DOMAIN
          type: DOMAIN
          name: API Domain
          description: Domain for the OpenFlags API server
    tags:
        - Tool
        - Open Source
        - Feature Flags
    readme: |
        # OpenFlags
        The lightweight alternative to LaunchDarkly — built for React, Bun, and Node.js.

        ## Deployment
        This template will deploy:
        - **OpenFlags Server**: Bun-native API with SQLite storage.
        - **OpenFlags Dashboard**: React + Vite admin UI.
    services:
        - name: openflags-server
          icon: https://openflags.dev/favicon.svg
          template: GIT
          spec:
            id: openflags-server
            source:
                source: GITHUB
                repo: 1175531218
                branch: main
                rootDirectory: apps/server
            ports:
                - id: web
                  port: 4000
                  type: HTTP
            env:
                CORS_ORIGIN:
                    default: https://${DASHBOARD_DOMAIN}
                PORT:
                    default: "4000"
          domainKey: SERVER_DOMAIN
        - name: openflags-dashboard
          icon: https://openflags.dev/favicon.svg
          dependencies:
            - openflags-server
          template: GIT
          spec:
            id: openflags-dashboard
            source:
                source: GITHUB
                repo: 1175531218
                branch: main
                rootDirectory: apps/dashboard
            ports:
                - id: web
                  port: 80
                  type: HTTP
            env:
                VITE_API_URL:
                    default: https://${SERVER_DOMAIN}
          domainKey: DASHBOARD_DOMAIN
