JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 484
  • Score
    100M100P100Q92435F
  • License MIT

Modular TypeScript Backend Framework with Dependency Injection, Plugins, Controllers, Middleware and Hot Reloading.

Package Exports

  • raiton
  • raiton/commands/artifact.command
  • raiton/commands/build.command
  • raiton/commands/develop.command
  • raiton/commands/grafts.command
  • raiton/commands/start.command
  • raiton/core
  • raiton/core/application
  • raiton/core/artifacts/artifact
  • raiton/core/artifacts/index
  • raiton/core/artifacts/runner
  • raiton/core/builder
  • raiton/core/bytes.util
  • raiton/core/command
  • raiton/core/commands
  • raiton/core/config/config
  • raiton/core/config/define
  • raiton/core/config/index
  • raiton/core/context
  • raiton/core/controller/builder
  • raiton/core/controller/compiler
  • raiton/core/controller/index
  • raiton/core/controller/metadata
  • raiton/core/directories
  • raiton/core/guards
  • raiton/core/helpers/index
  • raiton/core/helpers/raiton
  • raiton/core/hooks
  • raiton/core/index
  • raiton/core/injection/index
  • raiton/core/injection/injection
  • raiton/core/middleware/compose
  • raiton/core/middleware/index
  • raiton/core/middleware/pipeline
  • raiton/core/plugins/index
  • raiton/core/plugins/plugin
  • raiton/core/plugins/scope
  • raiton/core/process.util
  • raiton/core/raiton
  • raiton/core/router/handler
  • raiton/core/router/handler.utils
  • raiton/core/router/index
  • raiton/core/router/matcher
  • raiton/core/router/route
  • raiton/core/router/router
  • raiton/core/server
  • raiton/core/socket/index
  • raiton/core/socket/metadata
  • raiton/core/thread
  • raiton/framework
  • raiton/framework/artifacts
  • raiton/framework/constants/decorators.constant
  • raiton/framework/constants/index
  • raiton/framework/constants/microservices.constant
  • raiton/framework/controllers
  • raiton/framework/data-transfer-object
  • raiton/framework/decorators/access-guard.decorator
  • raiton/framework/decorators/api-response.decorator
  • raiton/framework/decorators/api.decorator
  • raiton/framework/decorators/controllable.decorator
  • raiton/framework/decorators/guard.decorator
  • raiton/framework/decorators/index
  • raiton/framework/decorators/injection.decorator
  • raiton/framework/decorators/middleware.decorator
  • raiton/framework/decorators/parametrable.decorator
  • raiton/framework/decorators/routable.decorator
  • raiton/framework/decorators/socket.decorator
  • raiton/framework/encryption
  • raiton/framework/enums/encrypted.enum
  • raiton/framework/enums/event.message.enum
  • raiton/framework/enums/http-method.enum
  • raiton/framework/enums/http-parameters.enum
  • raiton/framework/enums/http-status.enum
  • raiton/framework/enums/index
  • raiton/framework/enums/runtime.enum
  • raiton/framework/enums/timestamp.enum
  • raiton/framework/env
  • raiton/framework/exceptions/http-exception
  • raiton/framework/exceptions/index
  • raiton/framework/exceptions/throwable
  • raiton/framework/index
  • raiton/framework/parameter-bag
  • raiton/framework/plugins/body-parser.plugin
  • raiton/framework/plugins/index
  • raiton/framework/plugins/openapi.plugin
  • raiton/framework/plugins/security/body-limit
  • raiton/framework/plugins/security/cors
  • raiton/framework/plugins/security/headers
  • raiton/framework/plugins/security/index
  • raiton/framework/plugins/security/method-guard
  • raiton/framework/plugins/security/rate-limit
  • raiton/framework/repositories
  • raiton/framework/responses/error
  • raiton/framework/responses/helpers
  • raiton/framework/responses/http
  • raiton/framework/responses/http-throwable
  • raiton/framework/responses/index
  • raiton/framework/runtime/bun/server
  • raiton/framework/runtime/deno/server
  • raiton/framework/runtime/index
  • raiton/framework/runtime/node/reply
  • raiton/framework/runtime/node/request
  • raiton/framework/runtime/node/server
  • raiton/framework/runtime/web/server
  • raiton/framework/services
  • raiton/framework/utilities/alias-path.util
  • raiton/framework/utilities/artifact.util
  • raiton/framework/utilities/callable.util
  • raiton/framework/utilities/cookie.util
  • raiton/framework/utilities/index
  • raiton/framework/utilities/ip.util
  • raiton/framework/utilities/json.util
  • raiton/framework/utilities/openapi.utils
  • raiton/framework/utilities/path.util
  • raiton/framework/utilities/url
  • raiton/framework/utilities/utilities.util
  • raiton/framework/view-model
  • raiton/types
  • raiton/types/access-guards
  • raiton/types/application
  • raiton/types/artifact
  • raiton/types/builder
  • raiton/types/config
  • raiton/types/controller
  • raiton/types/contruct
  • raiton/types/core
  • raiton/types/directory
  • raiton/types/encryption
  • raiton/types/generic
  • raiton/types/guard
  • raiton/types/http-responses
  • raiton/types/index
  • raiton/types/injection
  • raiton/types/lifecycle
  • raiton/types/middleware
  • raiton/types/parseable
  • raiton/types/plugin
  • raiton/types/raiton
  • raiton/types/responses
  • raiton/types/router
  • raiton/types/runtime
  • raiton/types/scheme
  • raiton/types/server
  • raiton/types/socket
  • raiton/types/thread
  • raiton/types/utilities
  • raiton/types/values

Readme

Protorians Raiton

Version License: MIT

Protorians Raiton est un framework backend moderne et performant, conçu pour construire des microservices TypeScript. Optimisé pour Bun, il offre également un support complet pour Node.js et Deno.

Caractéristiques

  • Optimisé pour Bun : Utilise Bun.serve nativement pour des performances maximales.
  • Multi-Runtime : Compatible avec Bun (recommandé), Node.js et les environnements Web.
  • Architecture Décorative : Utilise les décorateurs TypeScript pour définir contrôleurs, routes et injections.
  • Modulaire : Système de plugins et de middlewares flexible.
  • CLI Puissant : Outils intégrés pour le développement, le build et le déploiement.

Installation

bun add raiton reflect-metadata
# ou
npm install raiton reflect-metadata

Note : Raiton nécessite reflect-metadata pour fonctionner avec les décorateurs. Importez-le au début de votre point d'entrée.

Démarrage Rapide

1. Créez un contrôleur (source/controllers/hello.controller.ts)

import { Controllable, Get, Param } from "raiton/framework";

@Controllable('/hello')
export class HelloController {
    @Get('/')
    index() {
        return { message: "Bonjour de Raiton !" };
    }

    @Get('/:name')
    greet(@Param("name") name?: string) {
        return { message: `Bonjour, ${name} !` };
    }
}

2. Configurez votre application (source/main.ts)

import "reflect-metadata";
import {ThreadInterface} from "raiton/types";
import {Application} from "raiton/core";

export default async function (thread: ThreadInterface) {
    const app = new Application({
        port: 3000,
        prefix: '/api'
    });

    // Enregistrez vos plugins, middlewares et contrôleurs ici
    // ...

    // Lier son application au thread
    return await thread.setup({application: app}).run()
}

Utilisation du CLI

Raiton est livré avec une interface en ligne de commande pour faciliter le développement.

# Lancer en mode développement (avec hot reload)
bun raiton develop

# Builder le projet
bun raiton build

# Démarrer le projet buildé
bun raiton start

Runtimes supportés

Raiton détecte automatiquement l'environnement d'exécution et adapte son serveur :

  • Bun : Utilisation de Bun.serve.
  • Node.js : Adaptateur pour serveurs HTTP Node.
  • Web : Compatible avec les environnements basés sur les standards Web (Fetch API).

Documentation API

Example

  import { Controllable, Get, ApiOkResponse, ApiResponse } from 'raiton/framework';

  @Controllable('/users')
  export class UserController {
      @Get()
      @ApiOkResponse({
          description: 'Returns a list of users',
          type: Array,
          isArray: true
      })
      async getUsers() {
          return [{ id: 1, name: 'John Doe' }, { id: 2, name: 'Jane Smith' }];
      }

      @Get('/:id')
      @ApiResponse({
          status: 200,
          description: 'Returns the user if found',
          type: Object
      })
      @ApiResponse({
          status: 404,
          description: 'User not found'
      })
      async getUserById() {
          // ... implementation
          return { id: 1, name: 'John Doe' };
      }
  }
import { Controllable, Get, ApiQuery } from "raiton/framework";

  @Controllable("/users")
  export class UserController {
    @Get()
    @ApiQuery("name", { description: "Filter by name", required: false, type:
  String })
    @ApiQuery("limit", { description: "Max results", required: false, type:
  Number })
    async getUsers(ctx) {
      const { name, limit } = ctx.query;
      // …
    }
  }

Licence

Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.


Développé avec ❤️ par Y. Yannick GOBOU