# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: CrewAI Studio
spec:
    description: A full-stack template combining PostgreSQL and CrewAI Studio (Streamlit) for collaborative AI workflows, data analysis, and management.
    coverImage: https://raw.githubusercontent.com/strnad/CrewAI-Studio/refs/heads/main/img/crewai_logo.png
    icon: https://avatars.githubusercontent.com/u/170677839?s=200&v=4
    tags:
        - Database
        - Streamlit
        - PostgreSQL
    readme: "# CrewAI Studio Stack\n\nThis template provides a full-stack environment combining a PostgreSQL database with CrewAI Studio (Streamlit-based frontend) for collaborative AI workflows, data analysis, and data management.\n\n## Services\n\n- **PostgreSQL**  \n  An open-source relational database for data storage and management.\n  - Default user: `crewai_user`\n  - Default password: `secret`\n  - Default database: `crewai`\n\n- **CrewAI Studio**  \n  A Streamlit-based frontend for collaborative AI tasks and data visualization.  \n  - Automatically connects to the above PostgreSQL database\n\n## Getting Started\n\n1. Deploy this template with one click. Both PostgreSQL and CrewAI Studio services will be set up automatically.\n2. CrewAI Studio will connect to PostgreSQL using the provided environment variables—no manual configuration required.\n3. Access CrewAI Studio via your browser on the HTTP port (default: 8501) to start using the platform.\n\n## Connection Information\n\n- The PostgreSQL service exposes all necessary environment variables for easy integration with other services or applications.\n- CrewAI Studio reads these variables and establishes the database connection automatically.\n\n## Notes\n\n- You can customize the database user, password, or database name by editing the environment variables before deployment.\n- Please keep your database credentials secure to prevent unauthorized access.\n\n## LLM Configuration\n\nTo use different AI models or set up API keys for your CrewAI workflows, you can configure environment variables in the CrewAI Studio service. For detailed information on supported LLM providers and configuration options, please refer to the official documentation: https://docs.crewai.com/concepts/llms\n\nCommon environment variables you might need to set:\n- `OPENAI_API_KEY` for OpenAI models\n- `ANTHROPIC_API_KEY` for Claude models  \n- `GOOGLE_API_KEY` for Google models\n- `MODEL` to specify the default model (e.g., gpt-4o, claude-3-sonnet)\n\n---\nFor advanced configuration or more details, refer to the official documentation or contact the maintainer.\n"
    services:
        - name: PostgreSQL
          icon: https://cdn.zeabur.com/marketplace/postgresql.svg
          template: PREBUILT
          spec:
            id: postgresql
            source:
                image: postgres:15
            ports:
                - id: postgres
                  port: 5432
                  type: TCP
            volumes:
                - id: db-data
                  dir: /var/lib/postgresql/data
            env:
                POSTGRES_DB:
                    default: crewai
                    expose: true
                POSTGRES_PASSWORD:
                    default: secret
                    expose: true
                POSTGRES_USER:
                    default: crewai_user
                    expose: true
        - name: CrewAI-Studio
          icon: https://avatars.githubusercontent.com/u/170677839?s=200&v=4
          template: PREBUILT
          spec:
            id: crewai-studio
            source:
                image: docker.io/tham0nk/crewai-studio:latest
            ports:
                - id: web
                  port: 8501
                  type: HTTP
            volumes:
                - id: app-data
                  dir: /app
            env:
                DB_URL:
                    default: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql:5432/${POSTGRES_DB}
                POSTGRES_DB:
                    default: crewai
                POSTGRES_PASSWORD:
                    default: secret
                POSTGRES_USER:
                    default: crewai_user
