# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Global Situation Room (Full-stack)
spec:
    description: Full-stack Global Situation Room with a built-in RSS aggregator API.
    tags:
        - Vite
        - React
        - Node.js
        - RSS
    readme: |-
        # Global Situation Room (Full-stack)

        This template deploys both:
        - the frontend (static build)
        - the RSS aggregator backend (`/api/rss/*`)

        ## After deployment
        1. Open the service URL
        2. Click the settings button in the right panel (Live Intel)
        3. Fill `endpoint / apiKey / model` for your OpenAI-compatible provider

        ## Notes
        - The server only aggregates RSS (no LLM keys stored server-side).
        - The browser still calls your OpenAI-compatible endpoint directly.
    services:
        - name: app
          template: GIT
          spec:
            id: app
            source:
                source: GITHUB
                repo: 1169735484
                branch: main
                rootDirectory: /
                dockerfile: |-
                    FROM node:20-bookworm-slim AS web-build
                    WORKDIR /app/web
                    COPY web/package.json web/package-lock.json web/.npmrc ./
                    RUN npm ci --no-audit --no-fund
                    COPY web/ ./
                    RUN npm run build

                    FROM node:20-bookworm-slim AS server-deps
                    WORKDIR /app/server
                    COPY server/package.json server/package-lock.json ./
                    RUN npm ci --omit=dev --no-audit --no-fund

                    FROM node:20-bookworm-slim
                    ENV NODE_ENV=production
                    WORKDIR /app
                    COPY --from=web-build /app/web/dist ./web/dist
                    COPY --from=server-deps /app/server/node_modules ./server/node_modules
                    COPY server/ ./server/
                    EXPOSE 8080
                    CMD ["node", "server/index.js"]
            ports:
                - id: web
                  port: 8080
                  type: HTTP
