arvox-backend
Version:
Un framework backend moderne et modulaire basé sur Hono, TypeScript et l'architecture hexagonale avec authentification Better Auth + Drizzle intégrée
102 lines • 2.93 kB
TypeScript
import { OpenAPIHono } from '@hono/zod-openapi';
import { IModule } from '../interfaces/module.interface';
import { IService } from '../interfaces/service.interface';
import { FrameworkConfig } from '../types/config.type';
/**
* Main framework class that orchestrates the entire application
* Handles module registration, service initialization, and server setup
*/
export declare class ArvoxFramework {
private app;
private modules;
private services;
private config;
private isInitialized;
constructor(config: FrameworkConfig);
/**
* Configure OpenAPI documentation
*/
/**
* Setup OpenAPI 3.1 doc and Swagger UI (ou apiReference) inspiré de l'exemple fourni
*/
private initializeSwaggerUI;
/**
* Register a module with the framework
* @param module - Module to register
* @returns Framework instance for chaining
*/
registerModule(module: IModule): ArvoxFramework;
/**
* Register a service with the framework
* @param service - Service to register
* @returns Framework instance for chaining
*/
registerService(service: IService): ArvoxFramework;
/**
* Get a registered service by name
* @param name - Service name
* @returns Service instance or undefined
*/
getService<T extends IService>(name: string): T | undefined;
/**
* Get a registered module by name
* @param name - Module name
* @returns Module instance or undefined
*/
getModule<T extends IModule>(name: string): T | undefined;
/**
* Initialize all registered services and modules
*/
initialize(): Promise<void>;
/**
* Setup global middleware
*/
private setupGlobalMiddleware;
/**
* Setup global error handling
*/
private setupErrorHandling;
/**
* Start the HTTP server
* @returns Promise that resolves when server is ready
*/
start(): Promise<void>;
/**
* Gracefully shutdown the framework
*/
shutdown(): Promise<void>;
/**
* Get health status of all services and modules
* @returns Health check results
*/
getHealthStatus(): Promise<{
overall: 'healthy' | 'degraded' | 'unhealthy';
services: {
[name: string]: {
healthy: boolean;
message?: string;
};
};
modules: {
[name: string]: {
healthy: boolean;
message?: string;
};
};
}>;
/**
* Get the underlying Hono app instance
* @returns Hono app instance
*/
getApp(): OpenAPIHono;
/**
* Get framework configuration
* @returns Framework configuration
*/
getConfig(): FrameworkConfig;
/**
* Setup additional documentation endpoints
*/
private setupAdditionalDocs;
}
//# sourceMappingURL=arvox-framework.d.ts.map