{
  "name": "psyche-api-gateway",
  "$schema": "../../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/psyche/api-gateway/src",
  "projectType": "application",
  "tags": ["scope:psyche", "layer:service", "type:python", "runtime:fastapi"],
  "targets": {
    "serve": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry run uvicorn api_gateway.app:create_app --factory --reload --host 0.0.0.0 --port 8000"
      }
    },
    "serve-prod": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry run uvicorn api_gateway.app:create_app --factory --host 0.0.0.0 --port 8000 --workers 4"
      }
    },
    "build": {
      "executor": "nx:run-commands",
      "outputs": ["{projectRoot}/dist"],
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "commands": ["poetry build"]
      }
    },
    "install": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry install"
      }
    },
    "lint": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "commands": ["poetry run ruff check src/", "poetry run mypy src/"]
      }
    },
    "format": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "commands": ["poetry run black src/", "poetry run ruff check --fix src/"]
      }
    },
    "test": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry run pytest"
      }
    },
    "test-cov": {
      "executor": "nx:run-commands",
      "outputs": ["{projectRoot}/htmlcov"],
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry run pytest --cov=api_gateway --cov-report=html"
      }
    },
    "docker-build": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "docker build -t psyche-api-gateway:latest ."
      }
    },
    "openapi": {
      "executor": "nx:run-commands",
      "outputs": ["{projectRoot}/openapi.json"],
      "options": {
        "cwd": "apps/psyche/api-gateway",
        "command": "poetry run python -c \"from api_gateway.app import create_app; import json; app = create_app(); print(json.dumps(app.openapi(), indent=2))\" > openapi.json"
      }
    }
  }
}
