The Zero-Config TypeScript Framework for Modern Backends.
Build scalable APIs with the power of Fastify and the elegance of decorators. No modules. No boilerplate. Just code.
Do you miss the simplicity of Express but need the structure of a real framework?
Rikta is designed for developers who want to move fast without breaking things.
- π Zero-Config Autowiring: No
imports: [],exports: [], orproviders: []arrays. Just decorate your class, and it works. - β‘ Fastify Powered: Built on top of Fastify for maximum performance and low overhead.
- π‘οΈ Type-Safe by Default: Native Zod integration for validation that infers your TypeScript types automatically.
- π Hybrid Lifecycle: Powerful hooks and an event bus for complex application flows.
Rikta is nordic for "guide". Let Rikta guide you to build better backends, faster.
Get up and running in seconds with the Rikta CLI:
# Create a new project
npx @riktajs/cli new my-app
# Start development
cd my-app
npm run devThat's it! π Your API is running at http://localhost:3000
The CLI generates a complete project with:
- β TypeScript configuration optimized for Rikta
- β Example controller with REST endpoints
- β Example service with dependency injection
- β Hot reload development server
- β Production build for serverless deployment
// src/controllers/app.controller.ts
import { Controller, Get, Autowired } from '@riktajs/core';
import { GreetingService } from '../services/greeting.service.js';
@Controller()
export class AppController {
@Autowired()
private greetingService!: GreetingService;
@Get('/')
index() {
return { message: this.greetingService.getGreeting() };
}
@Get('/health')
health() {
return { status: 'ok', timestamp: new Date().toISOString() };
}
}// src/services/greeting.service.ts
import { Injectable } from '@riktajs/core';
@Injectable()
export class GreetingService {
getGreeting(): string {
return 'Welcome to Rikta! π';
}
}| Package | Description | Version |
|---|---|---|
| @riktajs/core | Core framework with DI, routing, and validation | |
| @riktajs/cli | CLI for scaffolding and development | |
| @riktajs/swagger | OpenAPI/Swagger documentation | |
| @riktajs/typeorm | TypeORM integration | |
| @riktajs/queue | BullMQ-based job queue integration for Rikta |
| Command | Description |
|---|---|
rikta new <name> |
Create a new Rikta project |
rikta dev |
Start development server with hot reload |
rikta build |
Build for production (serverless optimized) |
# Global installation (optional)
npm install -g @riktajs/cli
# Or use npx directly
npx @riktajs/cli new my-appSee the CLI Guide for full documentation.
Everything you need to build production-ready APIs.
| Guide | Description |
|---|---|
| Architecture | How Rikta's auto-discovery works under the hood. |
| Dependency Injection | Using @Autowired, tokens, and scopes. |
| Configuration | Type-safe configuration with .env and Zod validation. |
| Routing | Controllers, methods, and parameter handling. |
| Validation | New! Type-safe validation with Zod. |
| Lifecycle | Hooks (OnProviderInit) and the Event Bus. |
| Error Handling | Exception filters and standard JSON responses. |
| CLI Guide | Using the Rikta CLI. |
| Benchmarks | Performance comparison with Fastify & NestJS. |
Rikta is built on Fastify and delivers excellent performance. From our benchmarks:
| Metric | Rikta vs NestJS | Result |
|---|---|---|
| Startup | π’ -43% | Rikta is faster |
| GET requests | π’ -41% | Rikta is faster |
| POST requests | π’ -25% | Rikta is faster |
| Param requests | π’ -46% | Rikta is faster |
| Average | π’ ~40% | Rikta is faster |
Rikta adds minimal overhead (~2-5%) over vanilla Fastify while providing DI, decorators, and structured architecture.
For detailed tests:
cd benchmarks
npm install
npm run benchFor maximum performance, use silent mode:
const app = await Rikta.create({
port: 3000,
silent: true, // Disable all console output
logger: false // Disable Fastify logging
});Forget about AppModule, UserModule, SharedModule. Rikta scans your code and resolves dependencies automatically.
Don't duplicate your types. Define a Zod schema, and Rikta validates the request and gives you the TypeScript type.
@Post()
create(@Body(UserSchema) user: z.infer<typeof UserSchema>) {
// If we get here, 'user' is valid and typed.
// If not, Rikta returns a 400 Bad Request automatically.
}Support for Singleton (default) and Transient scopes, factory providers, and value tokens.
@Injectable()
class AuthService {
constructor(
@Autowired(DB_CONFIG) private config: Config,
@Autowired() private logger: LoggerService
) {}
}Rikta is proudly sponsored by:
Artiforge - AI-powered development tools
We love contributions! Please check our Contributing Guide (Coming Soon) and join our community.
Rikta is MIT licensed.
