title: 'Overview · Nael Framework' description: 'Learn about Nael Framework philosophy, installation options, Better Auth integration, GraphQL, and microservices support.'
Nael Framework Overview
A NestJS-inspired framework that runs entirely on Bun. Combine Better Auth, Apollo Federation, Dapr microservices, and schedulers without juggling multiple ecosystems. This page mirrors nestjs.com depth so you can ship production-ready services quickly.
Decorator-driven modules, Bun-native HTTP and GraphQL servers, shared DI contexts, and full Better Auth integration (single-tenant and multi-tenant) with zero CommonJS shims.
Weekly alpha releases keep the framework aligned with Bun updates and Better Auth changes. Subscribe to the changelog in the right rail or star the repo to follow along.
Philosophy
Inspired by NestJS but optimized for Bun, Nael keeps the “lego-brick” approach to modules while shedding layered build steps. Everything is native ESM, meaning faster cold starts, effortless workers, and aligned tooling.
- Decorators + DI you already know from NestJS.
- Unified HTTP, GraphQL, federation gateway, and microservices factories via
NaelFactory. - Better Auth-first mindset: guards, middleware, tenant-aware resolvers, and HTTP proxies included.
- CLI automation with
nl newandnl g *commands.
Start from the CLI or clone the repo
Choose the workflow that matches your team. The CLI scaffolds clean services, while the monorepo unlocks every example and package.
CLI workflow
bun install --global @nl-framework/clinl new platform-democd platform-demobun run devGenerates HTTP + GraphQL boilerplate, registers Better Auth, and wires config/logging. Run nl g module billing or
nl g resolver user as you grow the surface area.
Monorepo workflow
git clone https://github.com/Nael-Studio/nael-platform.gitcd nael-platformbun installbun run buildIdeal for contributing or exploring every package. Each example has its own start script and shares dependencies via Bun workspaces.
Prefer to skip commit history?
git clone https://github.com/Nael-Studio/nael-platform.git --depth=1 --single-branchcd nael-platformbun run --cwd examples/basic-http startGreat for CI examples or one-off demos. Run dapr init and start the microservices example without keeping git history around.
Better Auth everywhere
Shared guards, middleware, and HTTP proxies mean REST + GraphQL stay in sync. Enable tenant-aware sessions with a single config block.
import { BetterAuthModule } from '@nl-framework/auth';@Module({ imports: [ BetterAuthModule.register({ baseUrl: env.BETTER_AUTH_URL, multiTenant: true, }), ],})export class AuthModule {}- Expose the Better Auth HTTP router via
BetterAuthProxyModulefor SPA compatibility. - Use
BetterAuthMultiTenantGuardto hydrate the active tenant. - Reuse guards inside GraphQL resolvers with
@UseGuards().
GraphQL & Federation
Schema-first development with Apollo Server under the hood. Run a gateway and subgraphs from the same NaelFactory instance or deploy them independently.
GraphqlModule.forRoot({ schemaPath: './src/schema.graphql', federation: true, playground: true,});Each resolver module can opt-in to federation without toggling feature flags. Subgraphs share the logging + config stack automatically.
- Decorators such as
@UseInterceptors()now wrap GraphQL resolvers, allowing shared caching/logging envelopes across transports. - Register global resolver middleware with
registerGraphqlInterceptor()to apply observability or auth layers everywhere.
Microservices & schedulers
Dapr pub/sub transports, Bun Worker schedulers, and message pattern decorators mirror the NestJS API you already know.
createMicroservicesModule({ controllers: [BillingController], dapr: { pubsubName: 'redis-pubsub', },});- Decorators:
@MessagePattern,@EventPattern,@Cron,@Interval,@Timeout. - CLI command
nl g worker invoicesscaffolds workers tied to the scheduler module. - Examples cover Redis pub/sub, Dapr sidecars, and Kubernetes deployment manifests.
Hands-on references
Browse repo
Hands-on references
Examples directory
Every capability in the README ships with a runnable sample. Switch the folder name to explore a different scenario.
auth-multi-tenant-graphql
Combines Better Auth, tenant guards, and GraphQL resolvers with shared session middleware.
bun run --cwd examples/auth-multi-tenant-graphql startfederated-graphql
Schema-first Apollo Federation subgraph with resolver discovery and NaelFactory wiring.
bun run --cwd examples/federated-graphql startmicroservices
Dapr-based pub/sub microservice with message patterns, cron workers, and deployment notes.
bun run --cwd examples/microservices daprscheduler
Bun Worker-powered cron, interval, and timeout decorators with runtime registry APIs.
bun run --cwd examples/scheduler startSupport us
Nael is MIT + Apache 2.0 and depends on sponsors. If the framework powers your platform, consider funding maintenance and roadmap items.
Trilon, Mach10, and the Nael Studio collective keep CI running and ensure Better Auth parity. Your company can join them.
Become a sponsor