Skip to content

Decouple feder-server from Axum with a Tower-compatible HTTP interface #45

Description

@sij411

Currently, feder-server is tightly coupled with Axum, a web framework. The goal of this issue is to make the server framework-agnostic so that Axum becomes only one possible adapter.

Requirments

  1. Remove Axum dependencies from feder-server

    • feder-server must not depend on axum::Router, Axum request/response types, extractors, IntoResponse, or other Axum-specific APIs.
    • Axum-specific integration should move into a separate adapter such as feder-axum.
  2. Introduce a reusable HTTP boundary

    • Shared HTTP request/response types and ActivityPub-over-HTTP behaviour should live in feder-http.
    • feder-server should consume and produce these HTTP types rather than Axum-specific ones.
    • Prefer standard http crate types where practical.
  3. Make feder-server Tower-compatible

    • Tower should only define the request/response processing contract; it should not dictate the request and response types themselves.
    • feder-server should expose a tower_service::Service interface.
Service<FederRequest, Response = FederResponse>
  1. Move Axum integration into feder-axum

    • feder-axum should handle routing, extractors, Axum body conversion, and conversion between Axum and feder-http.
    • Applications should be able to combine feder-server with feder-axum explicitly.
application
    ↓
feder-axum
    ↓
feder-server
    ↓
feder-http / feder-core

Notes

  • The design should allow another adapter, such as an embedded HTTP runtime, to use feder-server without depending on Axum.
  • Embedded support does not need to be implemented in this issue; the architecture only needs to avoid preventing it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions