Skip to content

Issue one make verbs matter#2

Merged
jrkosinski merged 4 commits intojrkosinski:v0.0.2from
Andyrug:issue-one-make-verbs-matter
Mar 2, 2026
Merged

Issue one make verbs matter#2
jrkosinski merged 4 commits intojrkosinski:v0.0.2from
Andyrug:issue-one-make-verbs-matter

Conversation

@Andyrug
Copy link
Copy Markdown
Contributor

@Andyrug Andyrug commented Feb 21, 2026

ok - so this is a toe in the water refactor of the way the router works - see docs/CompositionalRefcator.md for the reasoning and benefits of the approach. DI containers seem a bit heavy to me for composing services and controllers, I changed things up so the router is built from a pipeline and wrapped in Result, its Result all the way down. I did not really add any unit tests or anything - but it will be easy to do that as the controllers are pure now, so they are isolated and testable. Anyhoo - have a look see, if you like where this is going I can add tests and build out validations with tests. If you would prefer not to that is ok as well, but be waned I may continue with this fork and see how far I can push rust to use my FP ways. Me and my arrow!

…ign docs

- Replace DI container with RouterPipeline (Kleisli composition via >=>)
- Bake HTTP verb into route constant as (&str, &str) tuple — enforced by mount_handlers!
- Add middleware.rs: require_bearer (constant-time bearer auth as Router->Router transform)
  and guard (predicate-based request filter)
- Add pipeline combinators: mount_if, mount_guarded, group, fold, layer_all
- Strip axum from user crate surface — all types re-exported via rust_api::prelude::*
- Add basic-api example: group, mount_if, mount_guarded, require_bearer in action
- Add .cursor/rules/rust-api-design.mdc (alwaysApply design invariants)
- Add docs/CompositionalRefactor.md (design rationale, NestJS comparison, next steps)
@jrkosinski jrkosinski changed the base branch from main to v0.0.2 March 2, 2026 06:05
@jrkosinski jrkosinski merged commit 7a75199 into jrkosinski:v0.0.2 Mar 2, 2026
8 of 10 checks passed
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.

2 participants