-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Phase: 5 - HTTP API
Estimated Effort: 4.5 hours
Tasks: Task 10, Task 11 from specs/core-pipeline/tasks.md
Checklist
Task 10: Implement Collection API (3 hours)
- Create collection router (api/collect.py)
- Implement POST /collect/{stream}
- Implement POST /collect (default stream)
- Add batch event support (array)
- Implement POST /v1/identify (routes to 'users')
- Implement POST /v1/track (routes to 'events')
- Implement POST /v1/page (routes to 'pages')
- Return 202 Accepted
- Write unit tests (TestClient)
Task 11: Implement Health Checks & App Setup (1.5 hours)
- Create health router (api/health.py)
- Implement GET /health (liveness)
- Implement GET /ready (Firestore connectivity)
- Create dependency injection (api/dependencies.py)
- Create app factory (main.py)
- Add lifespan context manager (startup/shutdown)
- Graceful shutdown flushes buffers
- Write integration tests
Acceptance Criteria
- POST /collect accepts any JSON
- Batch events work
- Segment-compatible endpoints work
- Health checks work
- Graceful shutdown works
- All tests pass
Files to Create
src/eventkit/api/collect.py
src/eventkit/api/health.py
src/eventkit/api/dependencies.py
src/eventkit/api/routes.py
src/eventkit/main.py
tests/unit/api/test_collect.py
tests/unit/api/test_health.py
tests/integration/test_api_integration.py
Dependencies: Issue #6
User Stories: Story 1, 2, 7, 8
Metadata
Metadata
Assignees
Labels
No labels