Skip to main content

Nakago (中子)

A lightweight Rust toolkit for sharp dependency injection

Nakago Logo

A Flexible Foundation

Nakago provides a flexible foundation for building precise and performant services in Rust. It uses dependency injectoin to complement existing tools in the Tokio ecosystem and beyond, making it easy to bring powerful libraries like Axum, SeaORM, and Async-GraphQL together in an easily testable and configurable way.

Crates.io Docs.rs CI Coverage Status Rust Tokio Axum

logistics

Dependency Injection

Nakago is a fully async dependency injection system based on Any from the Rust standard library, and Shared Futures that allow multiple threads to await the same async dependency Provider.

Framework Agnostic

Nakago already plays nicely with Axum and Warp, and can be smoothly integrated with other libraries or in-house frameworks. It focuses on making dependency injection useful and flexible, so that you can focus on scaling your application.

Comprehensive Testing

Easily swap in mock dependencies for unit testing to isolate and exercise individual components. Put everything together and validate your solution with realistic integration tests that can be automatically executed in CI for each change.

Etymology

Nakago (中子) is a Japanese word meaning "core", or less commonly the "middle of a nest of boxes". It often refers to the tang of a Japanese katana - the foundation of the hilt and the mechanism through which a sword is wielded. The nakago must be sound and resilient, allowing the holder to guide the blade with confidence.

頑張ってください!