Phase 1: FastAPI backend with async job model

- backend/app: FastAPI API wrapping the CAD skill modules
  - upload -> job -> poll -> model / BOM / artifacts -> geometry query
  - SQLite via SQLModel (Model, Job, BomRow, QueryLog)
  - ThreadPoolExecutor worker, serialized, with live stage updates
- docker-compose.yml: dev server (mounts source, --reload) on :8000
- api-test.sh: end-to-end live validation script
- requirements.txt: add fastapi, uvicorn, python-multipart, sqlmodel
- external_diagram.py: port active-area detection OCC.Core -> OCP
- .gitignore, PHASE1.md

Validated live: MR16 round-trip passes (28 BOM rows, 12 artifacts,
bounding-box query, xlsx download; active-area detection working).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jason Stedwell
2026-06-17 16:38:26 -05:00
parent c1abe36822
commit b3c3e2a3b2
15 changed files with 701 additions and 5 deletions
+28
View File
@@ -0,0 +1,28 @@
# Dev compose for the Phase 1 API.
#
# Mounts the repo into the image and runs uvicorn with --reload, so editing
# backend/ or skill.src/ takes effect without a rebuild. The image only needs
# rebuilding when requirements.txt changes (./build.sh).
#
# docker compose up # http://localhost:8000 (docs at /docs)
#
# On Unraid this becomes a real service on br0; for now it's a localhost dev loop.
services:
api:
image: step-parser:dev
platform: linux/amd64
entrypoint: ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
working_dir: /app
environment:
PYTHONPATH: /app
DATA_DIR: /data
# ANTHROPIC_API_KEY: set in a .env file (compose reads it automatically) for --translate
ports:
- "8000:8000"
volumes:
- ./backend:/app/backend
- ./skill.src:/app/skill.src
- step_parser_data:/data
volumes:
step_parser_data: