npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@riktajs/core

v0.4.1

Published

A fast and modern TypeScript backend framework with zero-config autowiring, powered by Fastify

Readme

🧭 Rikta

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.

NPM Version License


🤔 Why Rikta?

Are you tired of "Module Hell" in NestJS? 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: [], or providers: [] 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.


⚡ Quick Start

1. Install

npm install @riktajs/core

2. Create your App

No complex setup. Just one file is enough to start.

// main.ts
import { Rikta, Controller, Injectable, Get, Post, Body, Autowired, z } from '@riktajs/core';

// 1. Define a Service (Auto-discovered!)
@Injectable()
class UserService {
  private users = [{ id: 1, name: 'Rikta User' }];

  findAll() { return this.users; }
  
  create(name: string) {
    const user = { id: this.users.length + 1, name };
    this.users.push(user);
    return user;
  }
}

// 2. Define a Schema (Type-safe!)
const CreateUserSchema = z.object({
  name: z.string().min(3)
});

// 3. Define a Controller (Auto-discovered!)
@Controller('/users')
export class UserController {
  @Autowired()
  private userService!: UserService; // Dependency Injection works like magic

  @Get()
  getUsers() {
    return this.userService.findAll();
  }

  @Post()
  createUser(@Body(CreateUserSchema) body: z.infer<typeof CreateUserSchema>) {
    // 'body' is fully typed here!
    return this.userService.create(body.name);
  }
}

// 4. Run it!
// autowired paths are resolved relative to your project, not node_modules!
const app = await Rikta.create({ 
  port: 3000, 
  autowired: ['./src']  // Relative paths are resolved from YOUR project directory
});
await app.listen();
console.log('🚀 Server running on http://localhost:3000');

📚 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. | | Benchmarks | Performance comparison with Fastify & NestJS. |


⚡ Performance

Rikta is built on Fastify and delivers excellent performance. From our benchmarks:

| Metric | Rikta vs NestJS | Result | |--------|-----------------|--------| | Startup | 🟢 -37.7% | Rikta is faster | | GET requests | 🟢 -44.3% | Rikta is faster | | POST requests | 🟢 -14.8% | Rikta is faster | | Param requests | 🟢 -36.7% | Rikta is faster | | Average | 🟢 -32.0% | Rikta is faster |

For detailed tests:

cd benchmarks
npm install
npm run bench

Production Mode

For maximum performance, use silent mode:

const app = await Rikta.create({
  port: 3000,
  silent: true,   // Disable all console output
  logger: false   // Disable Fastify logging
});

✨ Key Features

🚫 No Modules, Just Logic

Forget about AppModule, UserModule, SharedModule. Rikta scans your code and resolves dependencies automatically.

✅ Native Zod Validation

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.
}

🔌 Powerful Dependency Injection

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
  ) {}
}

🤝 Contributing

We love contributions! Please check our Contributing Guide (Coming Soon) and join our community.

📄 License

Rikta is MIT licensed.