{
  "app": "ai-atlas",
  "label": "AI Atlas — the global intelligence layer for artificial intelligence",
  "domain": "www.ai-atlas.co",
  "port": 8320,
  "health_path": "/api/v1/health",
  "dir": "~/apps/ai-atlas",
  "extra_paths": [],
  "sync_excludes": [
    ".venv/", "__pycache__/", ".pytest_cache/", ".ruff_cache/", "*.egg-info/", ".git/", ".env", ".env.*", "!.env.example",
    "node_modules/", "apps/web/.next/", "apps/web/next-env.d.ts", "*.tsbuildinfo", "apps/web/qa/screens/", "apps/web/AGENTS.md", "apps/web/CLAUDE.md",
    "/data/", "/tmp/", "logs/", ".DS_Store", ".claude/", "deploy/.admin-token", "deploy/.llm-key", "deploy/rendered/", "tests/fixtures/"
  ],
  "requires": {
    "runtimes": ["pm2", "node", "pnpm", "uv", "uv-python@3.12"],
    "ram_gb": 8,
    "ports": [8320, 8321]
  },
  "ram_mb_observed": 3000,
  "size_mb": 60,
  "placement": {
    "pin": "M2M32c",
    "prefer": null,
    "avoid": ["M3U96b", "M1M32"],
    "reason": "Mac Studio M2 12 c / 32 Go dédié à AI Atlas (aucune autre app) ; Postgres 17 + pgvector + Redis Homebrew installés le 2026-09-11, raccordé au tunnel wg1 (10.67.0.20)"
  },
  "processes": [
    {
      "name": "ai-atlas-api",
      "manager": "pm2",
      "script": "{{HOME}}/apps/ai-atlas/.venv/bin/python",
      "args": ["-m", "uvicorn", "aiatlas.api.main:app", "--host", "127.0.0.1", "--port", "8321", "--no-access-log", "--proxy-headers", "--timeout-keep-alive", "75", "--workers", "2"],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/ai-atlas",
      "env": {
        "APP_ENV": "production",
        "AIA_SITE_URL": "https://www.ai-atlas.co",
        "DATABASE_URL": "postgresql+asyncpg://aiatlas:aiatlas@127.0.0.1:5432/aiatlas",
        "REDIS_URL": "redis://127.0.0.1:6379/5",
        "AIA_DATA_DIR": "{{HOME}}/ai-atlas-data",
        "AIA_API_HOST": "127.0.0.1",
        "AIA_API_PORT": "8321",
        "AIA_ADMIN_TOKEN": "{{ADMIN_TOKEN}}",
        "AIA_LLM_BASE_URL": "https://www.llm-api.io/v1",
        "AIA_LLM_API_KEY": "{{LLM_KEY}}",
        "AIA_LOG_JSON": "1",
        "PYTHONUNBUFFERED": "1"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "3G"
    },
    {
      "name": "ai-atlas-scheduler",
      "manager": "pm2",
      "script": "{{HOME}}/apps/ai-atlas/.venv/bin/aia",
      "args": ["schedule"],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/ai-atlas",
      "env": {
        "APP_ENV": "production",
        "AIA_SITE_URL": "https://www.ai-atlas.co",
        "DATABASE_URL": "postgresql+asyncpg://aiatlas:aiatlas@127.0.0.1:5432/aiatlas",
        "REDIS_URL": "redis://127.0.0.1:6379/5",
        "AIA_DATA_DIR": "{{HOME}}/ai-atlas-data",
        "AIA_ADMIN_TOKEN": "{{ADMIN_TOKEN}}",
        "AIA_LLM_BASE_URL": "https://www.llm-api.io/v1",
        "AIA_LLM_API_KEY": "{{LLM_KEY}}",
        "AIA_WORKER_CONCURRENCY": "1",
        "AIA_LOG_JSON": "1",
        "PATH": "/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:/usr/bin:/bin",
        "PYTHONUNBUFFERED": "1"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "6G"
    },
    {
      "name": "ai-atlas-web",
      "manager": "pm2",
      "script": "/opt/homebrew/bin/node",
      "args": ["node_modules/next/dist/bin/next", "start", "-p", "8320", "-H", "0.0.0.0"],
      "interpreter": null,
      "cwd": "{{HOME}}/apps/ai-atlas/apps/web",
      "env": {
        "NODE_ENV": "production",
        "API_URL": "http://127.0.0.1:8321",
        "NEXT_PUBLIC_SITE_URL": "https://www.ai-atlas.co",
        "AIA_ADMIN_TOKEN": "{{ADMIN_TOKEN}}",
        "NEXT_TELEMETRY_DISABLED": "1"
      },
      "cron_restart": null,
      "autorestart": true,
      "max_memory_restart": "2G"
    }
  ],
  "ngrok": null,
  "launchd": [],
  "env_overrides": {},
  "hooks": {
    "post_sync": [
      "set -o pipefail; mkdir -p $HOME/ai-atlas-data/{raw,text,logs,backups,cache,seed} && echo '  data dirs ok'",
      "set -o pipefail; export PATH=\"$HOME/.local/bin:/opt/homebrew/bin:$PATH\"; (test -x .venv/bin/python || uv venv --python 3.12 .venv) && uv pip install -q --python .venv/bin/python -e . && echo '  python deps ok'",
      "set -o pipefail; export PATH=\"/opt/homebrew/opt/postgresql@17/bin:/opt/homebrew/bin:$PATH\"; export DATABASE_URL=postgresql+asyncpg://aiatlas:aiatlas@127.0.0.1:5432/aiatlas AIA_DATA_DIR=$HOME/ai-atlas-data AIA_LOG_JSON=0; .venv/bin/aia migrate 2>&1 | tail -1 && .venv/bin/aia seed 2>&1 | tail -1 && echo '  migrate + seed ok'",
      "set -o pipefail; export PATH=\"/opt/homebrew/bin:$PATH\"; pnpm install --frozen-lockfile --silent && echo '  web deps ok'",
      "set -o pipefail; export PATH=\"/opt/homebrew/bin:$PATH\"; cd apps/web && API_URL=http://127.0.0.1:8321 NEXT_PUBLIC_SITE_URL=https://www.ai-atlas.co NEXT_TELEMETRY_DISABLED=1 pnpm build 2>&1 | tail -3 && echo '  web build ok'"
    ],
    "post_start": []
  },
  "notes": "v0.1.0 (2026-09-11) : Next 16 :8320 (rewrites /api/v1/* → FastAPI 127.0.0.1:8321, 2 workers uvicorn), scheduler APScheduler + worker de jobs (connecteurs adaptatifs, extraction LLM via llm-api.io, embeddings pgvector, stats/qualité horaires, backup pg_dump 04:40). Postgres 17 + pgvector + Redis Homebrew locaux ; données hors repo ~/ai-atlas-data (archive brute content-addressed, texte, backups, logs). Secrets : AIA_ADMIN_TOKEN (laptop deploy/.admin-token) et AIA_LLM_API_KEY (laptop deploy/.llm-key, clé llm-api.io « ai-atlas »). Après le premier deploy : bash deploy/first-run.sh sur le nœud (corpus initial).",
  "tunnel": {
    "domain": "www.ai-atlas.co",
    "gateway": "BHS64",
    "redirects": ["ai-atlas.co"],
    "note": "DNS GoDaddy A www + A @ → 51.161.112.61 posés par l'utilisateur le 2026-09-11 (vérifiés par dig)."
  }
}
