Skip to content

Add FastAPI REST API adapter#8

Merged
CosmicDreamer17 merged 1 commit into
mainfrom
feature/fastapi-adapter
Mar 29, 2026
Merged

Add FastAPI REST API adapter#8
CosmicDreamer17 merged 1 commit into
mainfrom
feature/fastapi-adapter

Conversation

@CosmicDreamer17

Copy link
Copy Markdown
Owner

Summary

  • Adds FastAPI as an HTTP infrastructure adapter for both bounded contexts
  • Pydantic request/response schemas separate from domain entities (no ORM leakage)
  • Domain exceptions mapped to appropriate HTTP status codes (404 not found, 409 conflict, 422 validation)
  • Application factory pattern in shared/infrastructure/app.py
  • make serve target for local development with uvicorn --reload

Endpoints

Work Items: POST /work-items, POST /work-items/{id}/assign, POST /work-items/{id}/activate, POST /work-items/{id}/complete

Integration Jobs: POST /integration-jobs, POST /integration-jobs/{id}/start, POST /integration-jobs/{id}/deliver, POST /integration-jobs/{id}/fail, POST /integration-jobs/{id}/retry

Test plan

  • 14 new API integration tests (58 total, all passing)
  • Route handlers delegate to use cases only — no business logic in API layer
  • Architecture enforcement still green (import-linter 3/3 contracts, pytest-archon 5/5)
  • make all-checks passes

Closes #2

🤖 Generated with Claude Code

Adds HTTP API layer as an infrastructure adapter demonstrating
Hexagonal Architecture's pluggable delivery mechanisms:

- FastAPI routers for work_management and integration_management
- Pydantic request/response schemas separate from domain entities
- Domain exceptions mapped to HTTP status codes (404, 409, 422)
- Application factory in shared/infrastructure/app.py
- 14 new API tests (58 total), make serve target
- Updated conftest with StaticPool for in-memory SQLite test isolation

Closes #2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CosmicDreamer17
CosmicDreamer17 merged commit 9f178bf into main Mar 29, 2026
3 checks passed
@CosmicDreamer17
CosmicDreamer17 deleted the feature/fastapi-adapter branch March 29, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add FastAPI REST API adapter

1 participant