Are you looking for a robust and versatile web framework for your data science and computing applications? Look no further! Meet Fluxor, a new Rust framework designed to streamline your development process and enhance your data handling capabilities.
Why Fluxor?
Inspired by popular frameworks like Express.js, Flask, and Shiny, Fluxor combines the best features of these frameworks with the powerful performance of Rust. Here are some standout features:
Asynchronous and Efficient: Built upon the Tokio runtime, Fluxor provides powerful non-blocking I/O for handling multiple connections effortlessly.
Robust Functionality: Tailored specifically for scientific computing and web development, it has rich features that cater to your needs.
Extendable: Easily integrate with data storage solutions such as MongoDB, PostgreSQL, and Redis for flexibility in your data management.
Dedicated CLI Tool: The Fluxor CLI allows for quick project scaffolding, getting you started even faster.
Modular Design: With various modules (like math, data handling, and logging), Fluxor facilitates streamlined development and project organization.
Getting Started
Getting started with Fluxor is simple. Here’s a quick overview:
Install Rust: Make sure you have Rust and Cargo installed.
Create a New Project: Use the CLI to scaffold a new Fluxor application:
cargo install fluxor
fluxor new --version latest --example helloworld
cd
cargo run
- Start Building: Your application will be up and running at http://127.0.0.1:8080.
Hello World Example
To demonstrate how easy it is to get started, here's a simple "Hello, World!" application using Fluxor:
use fluxor::prelude::*;
fn hello(_req: Req, _params: Params) -> Reply {
boxed(async {
Ok(Response::builder()
.header("Content-Type", "text/html; charset=UTF-8")
.body(Body::from("👋 Hello, World!"))
.unwrap())
})
}
#[tokio::main]
async fn main() {
let mut app = Fluxor::new(); // Initialize the application.
app.route("/", GET, hello); // Set the route (path, method, handler).
app.run("127.0.0.1", "8080").await; // Start the HTTP server (host, port).
}
When you run this code and navigate to http://127.0.0.1:8080 in your web browser, you should see a friendly "👋 Hello, World!" greeting.
Explore the Modules
- Core: Essential backbone of the framework.
- Client: An HTTP client built for easy API testing.
- Data: Modules for MongoDB, PostgreSQL, and Redis.
- Encode: For data serialization and deserialization.
- Math: Mathematical functions for computations.
- StyledLog: A slick logging mechanism.
- Cans: A lightweight literal template engine.
- Wtime: Utilities for handling time.
- Fluxio: An HTTP client wrapper for seamless integration.
Join the Community
Fluxor is open for contributions! If you’re interested in helping out, please fork the repository and submit a pull request.
With comprehensive documentation and a roadmap for future enhancements, Fluxor is set to become a go-to framework for Rust developers focused on data science.
Ready to boost your development workflow? Check out Fluxor today and see how it can transform your applications!
For more information, visit the official Fluxor documentation!
Happy coding! 🚀