language

Neutron Rust

Async web framework on Hyper and Tokio. Trie routing, 1,161 tests across 18 composable crates, and the auth, real-time, and database layers already wired up.

The backend that compiles into a binary you're not afraid of.

Available
1,161Tests Passing
18Composable Crates
681nsPlaintext Response
277nsRoute Lookup

Stop wiring crates together.

Most Rust web projects start with Axum or Actix plus fifteen dependencies to reach feature parity with a normal framework. Neutron Rust ships with the full stack already composed — trie router, Tower-style middleware, JWT + OAuth + WebAuthn auth, Nucleus client, WebSocket and SSE, OTel tracing, and a Stripe integration — all tested across 1,161 tests and versioned together.

You import the crates you need. You don't import the ones you don't. Feature-gate everything at the Cargo level, and the binary drops features that aren't in your build.

Trie router
277 ns lookup at 500 routes. O(segments) matching, so a 10,000-route app runs at the same speed as a five-route one.
Tower middleware
Zero-allocation chain building. Compose logger, CORS, JWT, rate limit, compression, and tracing at global or per-route scope.
Typed extractors
Path, Query, Json, Form, State, Extension — all checked at compile time. No runtime casting, no macro magic you can't read.
Full auth stack
JWT (HMAC, RSA, ECDSA), OAuth2 flows for GitHub / Google / Discord with PKCE, WebAuthn passkeys, sessions, CSRF.
WebSocket & SSE
Handle 100,000+ concurrent connections on one server. Built on Tokio with zero-copy framing. PubSub fans out across nodes through Nucleus.
Nucleus native
Typed client for all 14 data models: .kv(), .vector(), .graph(), .stream(). Pool lifecycle and prepared statements handled.

Real code, real handlers.

Here's a production-shaped handler with auth, validation, and a vector query in about thirty lines:

src/routes/recommend.rs
use neutron::prelude::*;
use neutron_nucleus::NucleusClient;
use serde::{Deserialize, Serialize};

#[derive(Deserialize)]
struct Query { prompt: String, k: usize }

#[derive(Serialize)]
struct Hit { id: String, score: f32, title: String }

pub async fn recommend(
    _user: Authed,                  // JWT-validated, rejects unauthenticated
    State(db): State<NucleusClient>,
    Json(q): Json<Query>,
) -> Result<Json<Vec<Hit>>, ApiError> {
    let embedding = embed(&q.prompt).await?;

    let hits = db.vector()
        .search("articles", &embedding)
        .k(q.k.min(50))
        .execute()
        .await?;

    Ok(Json(hits.into_iter()
        .map(|h| Hit { id: h.id, score: h.score, title: h.title })
        .collect()))
}
Compile-time validated extractors. No runtime JSON schema check.

The 18 crates, composable.

Everything is its own crate. Use what you need; the rest never touches your binary.

CrateWhat it doesDepends on
neutronCore framework: router, extractors, middleware chainhyper, tokio
neutron-cli`neutron new`, `dev`, `build`, `migrate`neutron
neutron-nucleusTyped client for all 14 Nucleus data modelspostgres, pgx wire
neutron-postgresPlain Postgres client when you don't want Nucleuspostgres
neutron-oauthOAuth2 (GitHub, Google, Discord) with PKCEreqwest, jsonwebtoken
neutron-webauthnPasskey registration and assertion (P-256 ECDSA)ring, base64
neutron-jobsBackground jobs with retries, cron, and dead-letterneutron-nucleus
neutron-cacheIn-memory + Nucleus KV tiered cacheneutron-nucleus
neutron-redisDrop-in Redis client for teams migratingredis
neutron-smtpOutbound email with templates and dry-run modelettre
neutron-storageS3-compatible object storageaws-sdk-s3
neutron-stripeStripe webhooks, subscriptions, checkoutstripe-rs
neutron-graphqlGraphQL server with Nucleus resolversasync-graphql
neutron-grpcgRPC service hosting alongside HTTPtonic, prost
neutron-rpcTyped client/server RPC (internal comms)serde
neutron-otelOpenTelemetry traces, metrics, logsopentelemetry
neutron-inferenceModel inference pipeline (CPU/GPU)candle, tch
neutron-configLayered config: env → file → CLI flagsserde, toml

What you're buying

Router
277ns lookup at 500 routes
Auth
JWT + OAuth + WebAuthn built in
Real-time
WebSocket + SSE + PubSub
Nucleus
Typed client, all 14 models
Ops
OTel, Stripe, jobs, cache, storage
Tests
1,161 across 18 crates

Deploy a binary. That's it.

Compile once, ship once. Cross-compile to any target; the binary is self-contained. No runtime to install, no Dockerfile to maintain, no dependency tree to audit at 3am.

Dockerfile (optional)
FROM scratch
COPY ./target/release/myapp /myapp
EXPOSE 8080
ENTRYPOINT ["/myapp"]
If you want a container. Otherwise just SCP the binary.

What it's for

High-throughput APIs where latency predictability matters. Real-time fan-out to tens of thousands of clients. Edge-compiled WASM services. Tauri desktop backends (the same framework powers Neutron Desktop). Anything where you want Rust's memory safety and throughput without building half a web framework first.

Production-grade by default

1,161 tests across 18 crates — unit, integration, property-based, and async. Every crate's public API is checked by cargo-semver-checks. Memory safety guaranteed by the borrow checker; no segfaults, no data races, no null dereferences. Release profile with LTO + codegen-units=1 lands production binaries at ~8–12 MB.

Part of a bigger system

Use Neutron Rust for the performance-sensitive services. Use Neutron TypeScript for the web, Go for concurrent microservices, Python for ML and data pipelines. Every SDK speaks the same contract and reads the same Nucleus database. You never hit a wall where the framework says no.