# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Mix Space Core
spec:
    description: A modern personal website backend server
    icon: https://mx-space.js.org/logo.png
    variables:
        - key: JWT_SECRET
          type: STRING
          name: JWT Secret
          description: A secure string used for JWT token encryption
        - key: ALLOWED_ORIGINS
          type: STRING
          name: Allowed Origins
          description: Comma-separated list of allowed origins (CORS)
    tags:
        - Backend
        - CMS
        - Node.js
        - Blog
    readme: |-
        # Mix Space Core

        Mix Space Core is a modern personal website backend server built with Node.js.
        It provides RESTful APIs for your personal website, blog, and other content management needs.

        ## Features
        - RESTful API
        - MongoDB as database
        - Redis for caching
        - JWT authentication
        - Content management

        ## Getting Started
        After deployment, you can access your API at the domain you configured.
        The default port is 2333.
    services:
        - name: MongoDB
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/mongodb.svg
          template: PREBUILT
          spec:
            source:
                image: mongo:latest
            ports:
                - id: database
                  port: 27017
                  type: TCP
            volumes:
                - id: data
                  dir: /data/db
        - name: Redis
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg
          template: PREBUILT
          spec:
            source:
                image: redis:alpine
            ports:
                - id: database
                  port: 6379
                  type: TCP
            volumes:
                - id: data
                  dir: /data
        - name: mx-server
          icon: https://mx-space.js.org/logo.png
          dependencies:
            - MongoDB
            - Redis
          template: PREBUILT
          spec:
            source:
                image: innei/mx-server:latest
            ports:
                - id: web
                  port: 2333
                  type: HTTP
            volumes:
                - id: data
                  dir: /root/.mx-space
            env:
                ALLOWED_ORIGINS:
                    default: ${ALLOWED_ORIGINS}
                DB_HOST:
                    default: ${MONGODB_HOST}
                JWT_SECRET:
                    default: ${JWT_SECRET}
                NODE_ENV:
                    default: production
                REDIS_HOST:
                    default: ${REDIS_HOST}
                TZ:
                    default: Asia/Shanghai
localization:
    zh-CN:
        description: 现代化的个人网站后端服务器
        variables:
            - key: JWT_SECRET
              type: STRING
              name: JWT 密钥
              description: 用于 JWT 令牌加密的安全字符串
            - key: ALLOWED_ORIGINS
              type: STRING
              name: 允许的来源
              description: 逗号分隔的允许来源列表（CORS）
        readme: |-
            # Mix Space Core

            Mix Space Core 是一个使用 Node.js 构建的现代化个人网站后端服务器。
            它为您的个人网站、博客和其他内容管理需求提供 RESTful API。

            ## 特性
            - RESTful API
            - MongoDB 数据库
            - Redis 缓存
            - JWT 认证
            - 内容管理

            ## 开始使用
            部署完成后，您可以通过配置的域名访问 API。
            默认端口为 2333。
