version: 1
applications:
  - appRoot: .
    frontend:
      phases:
        preBuild:
          commands:
            - nvm install 20.19.0
            - nvm use 20.19.0
            - npm ci --include=dev
        build:
          commands:
            - npm run build
      artifacts:
        baseDirectory: dist
        files:
          - '**/*'
      cache:
        paths:
          - node_modules/**/*
    backend:
      phases:
        build:
          commands:
            - echo "Backend build not required (Express)"
      artifacts:
        baseDirectory: .
        files:
          - '**/*'
    customHeaders:
      - pattern: '**/*'
        headers:
          - key: Cache-Control
            value: max-age=0,no-cache,no-store,must-revalidate
