---
id: T02
parent: S01
milestone: M015
provides: []
requires: []
affects: []
key_files: []
key_decisions: ["Compose service name is 'chrysopedia-web' not 'chrysopedia-web-8096'"]
patterns_established: []
drill_down_paths: []
observability_surfaces: []
duration: ""
verification_result: "All verification checks passed: popular endpoint returns items array, search_log count > 0 after searches, empty query not logged, all slice-level import/route checks pass."
completed_at: 2026-04-03T04:07:03.459Z
blocker_discovered: false
---

# T02: Deployed search logging and popular searches endpoint to ub01, ran Alembic migration 013, verified end-to-end with real HTTP requests

> Deployed search logging and popular searches endpoint to ub01, ran Alembic migration 013, verified end-to-end with real HTTP requests

## What Happened
---
id: T02
parent: S01
milestone: M015
key_files:
  - (none)
key_decisions:
  - Compose service name is 'chrysopedia-web' not 'chrysopedia-web-8096'
duration: ""
verification_result: passed
completed_at: 2026-04-03T04:07:03.460Z
blocker_discovered: false
---

# T02: Deployed search logging and popular searches endpoint to ub01, ran Alembic migration 013, verified end-to-end with real HTTP requests

**Deployed search logging and popular searches endpoint to ub01, ran Alembic migration 013, verified end-to-end with real HTTP requests**

## What Happened

Pushed T01 commit to origin, pulled on ub01, rebuilt API and worker containers. Applied Alembic migration 013 creating the search_log table. Restarted nginx container for stale DNS. Verified three real searches logged correctly, empty queries excluded, and GET /search/popular returns valid cached JSON.

## Verification

All verification checks passed: popular endpoint returns items array, search_log count > 0 after searches, empty query not logged, all slice-level import/route checks pass.

## Verification Evidence

| # | Command | Exit Code | Verdict | Duration |
|---|---------|-----------|---------|----------|
| 1 | `curl -sf http://ub01:8096/api/v1/search/popular | python3 assert items` | 0 | ✅ pass | 1000ms |
| 2 | `ssh ub01 docker exec chrysopedia-db psql SELECT count FROM search_log` | 0 | ✅ pass | 1000ms |
| 3 | `cd backend && python -c from models import SearchLog` | 0 | ✅ pass | 1000ms |
| 4 | `cd backend && python -c from schemas import PopularSearchItem` | 0 | ✅ pass | 1000ms |
| 5 | `cd backend && python -c assert popular in routes` | 0 | ✅ pass | 1000ms |


## Deviations

Slice verification check 3 expected '/popular' but router returns '/search/popular' with prefix — adjusted assertion. Docker compose service name is 'chrysopedia-web' not 'chrysopedia-web-8096'.

## Known Issues

None.

## Files Created/Modified

None.


## Deviations
Slice verification check 3 expected '/popular' but router returns '/search/popular' with prefix — adjusted assertion. Docker compose service name is 'chrysopedia-web' not 'chrysopedia-web-8096'.

## Known Issues
None.
