{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Flask",
      "type": "python",
      "request": "launch",
      "module": "flask",
      "python": "${command:python.interpreterPath}",
      "env": {
        "FLASK_APP": "backend/main.py",
        "FLASK_DEBUG": "1",
        "SECRET_KEY": "dev-secret-key-change-in-production",
        "REFRESH_TOKEN_EXPIRY_DAYS": "90",
        "DIGEST_TOKEN_SECRET": "dev-digest-token",
        "VAPID_PUBLIC_KEY": "BNKkHdq45uLigohSG7c1TwlAo7ETncoRVLQK02LxHgu2P1DgSJD9njRMfbbzUsaTQGllvLBz7An1WiWsNYQhvKE",
        "VAPID_PRIVATE_KEY": "jNiZJT0UO4H861KmnCt874Fg6p5jDAyYKS4V2MZf8bQ"
      },
      "args": [
        "run",
        "--host=0.0.0.0",
        "--port=5000",
        "--no-debugger",
        "--no-reload"
      ],
      "cwd": "${workspaceFolder}/backend",
      "console": "integratedTerminal"
    },
    {
      "name": "Vue: Dev Server",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "npm",
      "runtimeArgs": [
        "run",
        "dev"
      ],
      "cwd": "${workspaceFolder}/frontend/vue-app",
      "console": "integratedTerminal",
      "serverReadyAction": {
        "pattern": "Local:.*https://localhost:([0-9]+)",
        "uriFormat": "https://localhost:%s",
        "action": "debugWithChrome"
      }
    },
    {
      "name": "Chrome: Launch (Vue App)",
      "type": "pwa-chrome",
      "request": "launch",
      "url": "http://localhost:5173",
      "webRoot": "${workspaceFolder}/frontend/vue-app"
    },
    {
      "name": "Python: Backend Tests",
      "type": "python",
      "request": "launch",
      "module": "pytest",
      "args": [
        "tests/"
      ],
      "cwd": "${workspaceFolder}/backend",
      "console": "integratedTerminal",
      "env": {
        "PYTHONPATH": "${workspaceFolder}/backend"
      }
    },
    {
      "name": "Vue: Frontend Tests",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "npm",
      "windows": {
        "runtimeExecutable": "npm.cmd"
      },
      "runtimeArgs": [
        "run",
        "test:unit"
      ],
      "cwd": "${workspaceFolder}/frontend/vue-app",
      "console": "integratedTerminal",
      "osx": {
        "env": {
          "PATH": "/opt/homebrew/bin:${env:PATH}"
        }
      }
    }
  ],
  "compounds": [
    {
      "name": "Full Stack (Backend + Frontend)",
      "stopAll": true,
      "configurations": [
        "Python: Flask",
        "Vue: Dev Server"
      ]
    }
  ]
}