@nexusts/core
NexusTS Core — Bun-native fullstack framework. Install this and you have a working MVC + DI + routing + validation stack.
What's included
| Capability | Description |
|---|---|
| MVC | @Controller, @Module, @Injectable, @Inject |
| DI | Field injection with singleton / transient / request scopes. No experimentalDecorators or reflect-metadata required. |
| Routing | Three styles: Nest decorators, Adonis-style router, Hono functional |
| Validation | @Validate() with Zod schemas, automatic 422 responses |
| View engines | Rendu (default), Edge, Eta, Inertia.js v3 (React + Vue) |
| CLI | nx command runner: new, init, make:*, db:*, repl |
| Hono server | Underlying HTTP server (Bun / Cloudflare Workers) |
Install
bun add @nexusts/core
bunx @nexusts/core initThat's it. No additional dependencies required to get a working app.
Optional modules
@nexusts/core is enough for most apps. Add individual @nexusts/* packages
as you need them — each is a separately-installed npm package with its own
peer dependencies. The peer deps below are optional — the module
loads without them, but its public methods throw a clear error pointing
to the install command on first call.
| Module | What it adds | Extra install |
|---|---|---|
@nexusts/auth |
better-auth integration | bun add better-auth |
@nexusts/cache |
Application cache (memory / Drizzle) | (none) |
@nexusts/cli |
CLI command runner (nx) |
(bundled with core) |
@nexusts/config |
Zod-validated configuration | (none) |
@nexusts/crypto |
AES-256-GCM + HMAC + scrypt/argon2 | (none) |
@nexusts/drive |
File storage (Local / S3 / R2 / memory) | (none) |
@nexusts/drizzle |
Drizzle ORM (default, 5 dialects) | bun add drizzle-orm |
@nexusts/events |
Event emitter with wildcards / priorities | (none) |
@nexusts/graphql |
SDL-first GraphQL endpoint | bun add graphql |
@nexusts/grpc |
gRPC server + client (reflection-based) | (none) |
@nexusts/health |
Health check endpoints | (none) |
@nexusts/i18n |
Internationalization (Intl-based) | (none) |
@nexusts/limiter |
Rate limiting (3 strategies) | (none) |
@nexusts/logger |
Pino-backed structured logging | (none) |
@nexusts/mail |
Outbound email (SMTP / File / Null) | (none) |
@nexusts/metrics |
Prometheus / OpenMetrics | (none) |
@nexusts/openapi |
OpenAPI 3.1 spec generation | (none) |
@nexusts/queue |
Background jobs (BullMQ / Cloudflare / memory) | bun add bullmq + bun add ioredis |
@nexusts/redis |
Runtime-aware Redis client | bun add ioredis |
@nexusts/resilience |
Retry + Circuit Breaker + Bulkhead | (none) |
@nexusts/schedule |
Cron scheduling (@Cron decorator) |
(none) |
@nexusts/session |
Cookie / Memory / Drizzle sessions | (none) |
@nexusts/shield |
CSRF / HSTS / CSP security | (none) |
@nexusts/sse |
Server-Sent Events streaming | (none) |
@nexusts/static |
Static file serving (ETag / Range) | (none) |
@nexusts/tracing |
OpenTelemetry distributed tracing | bun add @opentelemetry/api |
@nexusts/upload |
Multipart file upload | (none) |
@nexusts/view |
View engines + Inertia.js v3 | (none) |
@nexusts/ws |
WebSockets (Bun native) | (Bun has WS built-in) |
See docs/user-guide/ for the full module list.
Usage
import { Application, Controller, Get, Module } from "@nexusts/core";
@Controller("/")
class HelloController {
@Get("/")
index(ctx: any) {
return { message: "Hello from NexusTS!" };
}
}
@Module({
controllers: [HelloController],
})
class AppModule {}
const app = new Application(AppModule);
await app.listen(3000);License
MIT — see the root LICENSE.