3 unstable releases
Uses new Rust 2024
| 0.2.0 | Nov 17, 2025 |
|---|---|
| 0.1.2 | Nov 15, 2025 |
| 0.1.1 | Nov 15, 2025 |
#25 in WebSocket
1MB
18K
SLoC
[]()
Warning: Nexustack is a work in progress. Do not use in production environments yet
[]()
[]()
Nexustack is not just another HTTP web framework. While there are countless web frameworks available, Nexustack aims to unify multiple functionalities under a single, cohesive system. It is designed to provide a stable, tested, and enterprise-ready solution for building modern applications.
Unified Functionality
Nexustack stands out by integrating multiple functionalities into a single framework. Instead of relying on separate libraries for HTTP, WebSockets, MQTT, AMQP, and cron jobs, Nexustack provides a unified solution. This eliminates the need to manage multiple dependencies and ensures that all features work seamlessly together. By combining these capabilities, Nexustack simplifies the development of modern, multi-protocol applications.
Dependency Injection (DI)
A robust dependency injection (DI) system is at the core of Nexustack. Inspired by frameworks like NestJS and ASP.NET Core, the DI system ensures modularity and testability. Developers can register services with different lifetimes (singleton, scoped, or transient) and resolve them effortlessly. This approach promotes clean architecture, reduces coupling, and makes it easier to write unit tests for individual components.
Modular Architecture
Nexustack encourages developers to structure their applications into coherent modules. Each module encapsulates a specific feature or domain, making the application easier to maintain and scale. This modular design aligns with best practices for enterprise software development, enabling teams to work on different parts of the application independently.
API Documentation
Documentation is a critical aspect of any application, and Nexustack makes it effortless. The framework automatically generates OpenAPI documentation for HTTP services and AsyncAPI documentation for WebSockets, MQTT, and AMQP services. This ensures that your APIs are well-documented and ready for integration with other systems, saving time and effort during development.
Enterprise Focus
Nexustack is designed with enterprise environments in mind. It prioritizes stability, testing, and consistency, making it suitable for large-scale applications. The framework provides a unified way to use its features, reducing the learning curve for developers and ensuring that applications are built on a solid foundation. Nexustack aims to be a reliable choice for organizations looking to adopt Rust for their enterprise solutions.
Features
HTTPServer · ServeRESTfulAPIs with ease.WebSockets· Real-time communication usingWebSockets.MQTT· Support forMQTTprotocol forIoTand messaging.AMQP· Integration withAMQPfor message brokers likeRabbitMQ.- Cron Jobs · Schedule and manage periodic tasks.
- Dependency Injection · A powerful DI system inspired by
NestJSandASP.NET Core. - Modular Design · Structure your application into reusable modules.
OpenAPIDocumentation · Automatically generateOpenAPIdocumentation for yourHTTPservices.AsyncAPIDocumentation · GenerateAsyncAPIdocumentation forWebSockets,MQTT, andAMQPservices.
Note: Not all features are implemented yet. Nexustack is a work in progress.
Quick-Start Guide
Installation
Add nexustack by adding in as dependency to your Cargo.toml:
[dependencies]
nexustack = "0.1"
You can also add it by running the following command:
cargo add nexustack
Basic Setup
Create a new Rust project and set up a simple Nexustack application:
use nexustack::{
application_builder,
Application as _,
ApplicationBuilder as _,
};
#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = application_builder().build()?;
app.run().await?;
Ok(())
}
Adding Features
Cron Jobs
use nexustack::{
application_builder,
Application as _,
ApplicationBuilder as _,
cron::{
cron,
cron_jobs,
Cron as _,
CronApplicationBuilder as _,
CronResult,
},
};
#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = application_builder()
.add_cron_with_default_clock()
.configure_cron(cron_jobs![my_cron_job])
.build()?;
app.run().await?;
Ok(())
}
#[cron(schedule = "0 0 * * * *")]
async fn my_cron_job() -> CronResult {
println!("Running my cron job!");
Ok(())
}
For more examples, refer to the documentation of each feature.
License
Nexustack is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! If you'd like to contribute to Nexustack, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Write tests for your changes.
- Submit a pull request.
Before contributing, please ensure that your code adheres to the project's coding standards and passes all tests.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nexustack by you, shall be licensed as MIT, without any additional terms or conditions.
Dependencies
~4–16MB
~160K SLoC