Guidance for building backend applications with the Orbit framework (@galaxy-stack/orbit-*), a NestJS-style framework optimized for the Bun runtime...
Orbit is a NestJS-style backend framework for Bun. Concept mapping from NestJS:
@nestjs/common ā @galaxy-stack/orbit-core; class-validator DTOs ā Zod +
orbit-validation; @nestjs/graphql ā orbit-graphql; @nestjs/microservices
ā orbit-microservices + transport packages; @nestjs/swagger ā orbit-swagger.
bun instead of node/npm/pnpm for all commands:
bun install, bun run dev, bun test.OrbitFactory.create(AppModule) then app.listen(3000).@Module({ controllers, providers, exports }) class.@Injectable() classes injected via constructor.bun test; e2e tests call app.handle(new Request(...)).SecurityModule.forRoot({ helmet: true, csrf: true }) ā OWASP headers + CSRF.ThrottlerModule for rate limiting on auth and write routes.introspection: false in production; security: { maxDepth: 10, maxComplexity: 1000, maxAliases: 30 }; playground disabled in production.import { Module } from '@galaxy-stack/orbit-core';
@Module({
controllers: [UserController],
providers: [UserService],
exports: [UserService],
})
export class UserModule {}
import { Controller, Get, Post, Body, Param, HttpCode, UseGuards } from '@galaxy-stack/orbit-core';
@Controller('users')
export class UserController {
constructor(private readonly users: UserService) {}
@Get(':id')
find(@Param('id') id: string) { return this.users.find(id); }
@Post()
@HttpCode(201)
@UseGuards(JwtAuthGuard)
create(@Body() body: CreateUserDto) { return this.users.create(body); }
}
import { Resolver, Query, Mutation, Args } from '@galaxy-stack/orbit-graphql';
@Resolver()
export class UserResolver {
@Query(() => [User])
users() { return this.userService.list(); }
@Mutation(() => User)
createUser(@Args('input') input: CreateUserInput) {
return this.userService.create(input);
}
}
Module wiring with security limits:
GraphQLModule.forRoot({
autoSchemaFile: true,
introspection: process.env.NODE_ENV !== 'production',
security: { maxDepth: 10, maxComplexity: 1000, maxAliases: 30 },
resolvers: [UserResolver],
})
bun test passes.bun run dev shows no startup errors.Run the companion MCP server (@galaxy-stack/orbit-mcp) for searchable
knowledge, scaffolding tools, and a security review tool:
{
"mcpServers": {
"orbit": { "command": "bunx", "args": ["@galaxy-stack/orbit-mcp"] }
}
}