diff --git a/.env.example b/.env.example index ee273ba..e872649 100644 --- a/.env.example +++ b/.env.example @@ -13,3 +13,6 @@ CORS_ORIGINS=http://localhost:1577 # Server BACKEND_HOST=0.0.0.0 BACKEND_PORT=8000 + +# AI Design Analysis (optional — leave empty to disable) +ANTHROPIC_API_KEY= diff --git a/backend/=0.40 b/backend/=0.40 deleted file mode 100644 index c8c6c93..0000000 --- a/backend/=0.40 +++ /dev/null @@ -1 +0,0 @@ -(eval):1: command not found: pip diff --git a/backend/Dockerfile b/backend/Dockerfile index 7c8ce02..8e6e28a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -6,10 +6,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1-mesa-glx libglib2.0-0 curl git && \ rm -rf /var/lib/apt/lists/* +# Copy dependency spec first for layer caching COPY pyproject.toml . -RUN pip install --no-cache-dir -e . && \ + +# Install dependencies (non-editable, just deps) +RUN pip install --no-cache-dir . && \ pip install --no-cache-dir "deepgaze-pytorch @ git+https://github.com/matthias-k/DeepGaze.git" +# Copy application source COPY . . RUN mkdir -p data/uploads diff --git a/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py b/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py index b00af67..e237b69 100644 --- a/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py +++ b/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py @@ -45,6 +45,10 @@ def upgrade() -> None: sa.Column('gaze_sequence', sa.JSON(), nullable=True), sa.Column('hotspots', sa.JSON(), nullable=True), sa.Column('overall_score', sa.Float(), nullable=True), + sa.Column('ai_insights', sa.JSON(), nullable=True), + sa.Column('ai_score', sa.Integer(), nullable=True), + sa.Column('ai_score_reason', sa.String(length=500), nullable=True), + sa.Column('ai_cost_usd', sa.Float(), nullable=True), sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False), sa.ForeignKeyConstraint(['project_id'], ['projects.id'], ), sa.PrimaryKeyConstraint('id') diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 963cf3b..1a4cee8 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -3,6 +3,8 @@ services: build: context: ./backend command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload + environment: + ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-} volumes: - ./backend:/app - uploads:/app/data/uploads diff --git a/docker-compose.yml b/docker-compose.yml index 4e0954c..0469ebc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: UPLOAD_DIR: /app/data/uploads DEVICE: auto CORS_ORIGINS: http://localhost:1577 + ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-} volumes: - uploads:/app/data/uploads depends_on: