Skip to content
/ venok Public

Blazing-fast framework for building highly efficient, infinitely scalable, and battle-tested enterprise-grade full-stack applications with TypeScript.

License

Notifications You must be signed in to change notification settings

venokjs/venok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

522 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Blazing-fast framework for building highly efficient, infinitely scalable, and battle-tested enterprise-grade full-stack applications with TypeScript.

npm version License TypeScript

Website β€’ Documentation β€’ Examples

πŸš€ Why Venok?

Venok is a cutting-edge TypeScript framework that combines the best of modern development practices with enterprise-grade performance. Built from the ground up for scale, Venok delivers unparalleled developer experience while maintaining lightning-fast runtime performance.

Venok's architecture is built around a powerful dependency injection container that manages the entire application lifecycle:

πŸ”₯ Key Features

  • ⚑ Lightning Fast: Optimized for performance with minimal overhead
  • πŸ—οΈ Enterprise-Grade DI: Powerful dependency injection system with full control over the application lifecycle
  • 🌐 Multi-Protocol Support: Built-in HTTP and WebSocket support out of the box
  • πŸ”§ NestJS Compatible: Seamless integration with existing NestJS packages and ecosystem
  • 🎯 Type-Safe: First-class TypeScript support with full type inference
  • πŸ“¦ Modular Architecture: Clean, scalable module system for better code organization
  • πŸ”„ RxJS Integration: Reactive programming with Observable streams
  • πŸ›‘οΈ Battle-Tested: Production-ready with comprehensive error handling
  • πŸ“Š Advanced DI: Request-scoped providers, circular dependency resolution, and more

πŸš€ Quick Start

Installation

bun add @venok/core @venok/http reflect-metadata

Hello World Example

import { Injectable, Module, Controller, Get } from '@venok/core';
import { VenokFactory } from '@venok/core';
import { HttpModule } from '@venok/http';

@Injectable()
export class AppService {
  getHello(): string {
    return 'Hello, World from Venok! πŸš€';
  }
}

@Controller('api')
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get('hello')
  getHello(): string {
    return this.appService.getHello();
  }
}

@Module({
  imports: [HttpModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

async function bootstrap() {
  const app = await VenokFactory.createApplicationContext(AppModule);
  await app.listen(3000);
  console.log('πŸš€ Application running on http://localhost:3000');
}

bootstrap();

WebSocket Example

import { Module } from '@venok/core';
import { WebSocketModule, WebSocketGateway, SubscribeMessage, MessageBody } from '@venok/websocket';

@WebSocketGateway({ port: 8080 })
export class ChatGateway {
  @SubscribeMessage('message')
  handleMessage(@MessageBody() data: string): string {
    return `Echo: ${data}`;
  }
}

@Module({
  imports: [WebSocketModule],
  providers: [ChatGateway],
})
export class AppModule {}

πŸ”§ Core Concepts

Dependency Injection

Venok's DI system is designed for enterprise applications with advanced features:

import { Injectable, Scope } from '@venok/core';

// Singleton provider (default)
@Injectable()
export class SingletonService {}

// Request-scoped provider
@Injectable({ scope: Scope.REQUEST })
export class RequestScopedService {}

// Transient provider
@Injectable({ scope: Scope.TRANSIENT })
export class TransientService {}

Modules

Organize your application with a clean modular structure:

import { Module, Global } from '@venok/core';

@Global() // Makes this module globally available
@Module({
  providers: [DatabaseService, LoggerService],
  exports: [DatabaseService], // Export for other modules
})
export class CoreModule {}

@Module({
  imports: [CoreModule],
  controllers: [UserController],
  providers: [UserService],
})
export class UserModule {}

Guards & Interceptors

Implement cross-cutting concerns with ease:

import { CanActivate, ExecutionContext, Injectable, UseGuards, UseInterceptors } from '@venok/core';

@Injectable()
export class AuthGuard implements CanActivate {
  canActivate(context: ExecutionContext): boolean {
    // Authentication logic
    return true;
  }
}

@Injectable()
export class LoggingInterceptor implements VenokInterceptor {
  intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
    console.log('Before...');
    return next.handle().pipe(
      tap(() => console.log('After...'))
    );
  }
}

@Controller('protected')
@UseGuards(AuthGuard)
@UseInterceptors(LoggingInterceptor)
export class ProtectedController {
  @Get()
  getProtectedResource() {
    return { message: 'Access granted!' };
  }
}

πŸ“¦ Available Packages

Package Description Version
@venok/core Core framework with DI container npm
@venok/http HTTP server and routing npm
@venok/websocket WebSocket gateway support npm
@venok/integration NestJS compatibility layer npm

πŸ”Œ NestJS Compatibility

Venok maintains compatibility with the NestJS ecosystem:

// Use your existing NestJS packages
import { ValidationPipe } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'postgres',
      // ... configuration
    }),
  ],
  // ... rest of your module
})
export class AppModule {}

🀝 Contributing

We welcome contributions from the community! Please read our Contributing Guide for details on how to get started.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

🌟 Support

If you find Venok helpful, please consider giving it a ⭐ on GitHub!

For questions and support:


Built with ❀️ for the TypeScript community

By shiz-ceo

About

Blazing-fast framework for building highly efficient, infinitely scalable, and battle-tested enterprise-grade full-stack applications with TypeScript.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •