LLaraNode
Packages

Core Package

The @lara-node/core package is the foundation of the LaraNode framework. It provides the IoC container, Application bootstrap, Service Provider system, and configuration management.

Core Package

The @lara-node/core package is the foundation of the LaraNode framework. It provides the IoC container, Application bootstrap, Service Provider system, and configuration management.

Installation

pnpm add @lara-node/core express cors reflect-metadata

Overview

Core provides:

  • IoC Container -- Dependency injection with automatic resolution
  • Application -- Express wrapper with lifecycle management
  • Service Providers -- Modular service registration
  • Middleware Stack -- Laravel-style middleware management
  • Configuration -- Dot-notation config system

Quick Start

import { Application, Container } from "@lara-node/core";
import "reflect-metadata";

const container = new Container();
const app = new Application(container);

app.register(AppServiceProvider);

await app.boot();
await app.listen(3000);

Key Exports

ExportDescription
ContainerIoC container class
containerSingleton container instance
ApplicationApplication bootstrap class
ServiceProviderBase class for service providers
MiddlewareServiceProviderBase for middleware providers
MiddlewareStackMiddleware manager
FormRequestValidated request base class
Injectable()DI decorator
@Provider()Auto-discovery decorator
config()Config helper
setConfig()Set config value
hasConfig()Check config exists
allConfig()Get all config

Architecture

┌─────────────────────────────────────┐
│           Application               │
│  ┌─────────────┐  ┌──────────────┐  │
│  │  Container  │  │  Middleware  │  │
│  │   (IoC)     │  │    Stack     │  │
│  └─────────────┘  └──────────────┘  │
│  ┌───────────────────────────────┐  │
│  │     Service Providers         │  │
│  └───────────────────────────────┘  │
│  ┌───────────────────────────────┐  │
│  │     Configuration System      │  │
│  └───────────────────────────────┘  │
└─────────────────────────────────────┘

Next Steps