Decompose: Add HTTP service layer (FastAPI) exposing the EmbroideryPipeline — Phase 1: Service skeleton + healthcheck #46

Closed
opened 2026-06-22 16:31:07 +00:00 by Mark · 2 comments
Owner

Phase 1: Service skeleton + healthcheck

Set up the FastAPI app structure and a working /healthz endpoint. This
phase is fully isolated — no pipeline integration yet.

Files:

  • New: src/service/__init__.py
  • New: src/service/app.py (FastAPI app factory, CORS config, router
    registration stubs, /healthz handler)
  • New: src/service/config.py (pydantic settings: PORT, MAX_UPLOAD_MB,
    LOG_LEVEL, WORKER_POOL_SIZE, CORS_ALLOWED_ORIGINS)
  • New: src/service/models.py (pydantic request/response models, empty
    for now)

Acceptance:

  • uvicorn src.service.app:app --reload starts on port 8080.
  • GET /healthz returns {"status": "ok", "version": "<git-sha>"} with
    200.
  • CORS configured for ThreadCraft dev origin
    (http://localhost:3000) and a configurable prod origin.
  • A smoke test (tests/test_service_health.py) passes.
  • Dockerfile extends to CMD ["uvicorn", "src.service.app:app", ...].

Why first: every other phase adds a router under this skeleton, so
the skeleton must be in place before they can be tested.



Decomposed from easystitch#31

## Phase 1: Service skeleton + healthcheck Set up the FastAPI app structure and a working `/healthz` endpoint. This phase is fully isolated — no pipeline integration yet. **Files:** - New: `src/service/__init__.py` - New: `src/service/app.py` (FastAPI app factory, CORS config, router registration stubs, `/healthz` handler) - New: `src/service/config.py` (pydantic settings: `PORT`, `MAX_UPLOAD_MB`, `LOG_LEVEL`, `WORKER_POOL_SIZE`, `CORS_ALLOWED_ORIGINS`) - New: `src/service/models.py` (pydantic request/response models, empty for now) **Acceptance:** - `uvicorn src.service.app:app --reload` starts on port 8080. - `GET /healthz` returns `{"status": "ok", "version": "<git-sha>"}` with 200. - CORS configured for ThreadCraft dev origin (`http://localhost:3000`) and a configurable prod origin. - A smoke test (`tests/test_service_health.py`) passes. - Dockerfile extends to `CMD ["uvicorn", "src.service.app:app", ...]`. **Why first:** every other phase adds a router under this skeleton, so the skeleton must be in place before they can be tested. --- --- _Decomposed from [easystitch#31](https://forgejo.tail018ac4.ts.net/Mark/easystitch/issues/31)_
Author
Owner

Cross-link: ThreadCraft #11 (Stand up EasyStitch as an HTTP service for ThreadCraft) — this phase is the service skeleton it depends on.

**Cross-link:** ThreadCraft #11 (Stand up EasyStitch as an HTTP service for ThreadCraft) — this phase is the service skeleton it depends on.
Author
Owner

This issue has been decomposed into the following sub-issues:

# Title Phase Scope
#84 Service skeleton + healthcheck Set up the FastAPI app structure and a working /healthz endpoint. This phase i

Each sub-issue awaits triage pipeline assessment before queue routing.

This issue has been decomposed into the following sub-issues: | # | Title | Phase Scope | |---|-------|-------------| | #84 | Service skeleton + healthcheck | Set up the FastAPI app structure and a working `/healthz` endpoint. This phase i | Each sub-issue awaits triage pipeline assessment before queue routing.
Mark closed this issue 2026-06-26 17:57:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch#46
No description provided.