LLaraNode
Guide

Introduction

LaraNode is a Laravel-inspired Node.js framework built on top of Express.js. It brings the elegant developer experience of Laravel to the Node.js ecosystem, with a focus on developer productivity, clean architecture, and convention over configuration.

Introduction

LaraNode is a Laravel-inspired Node.js framework built on top of Express.js. It brings the elegant developer experience of Laravel to the Node.js ecosystem, with a focus on developer productivity, clean architecture, and convention over configuration.

Why LaraNode?

If you love Laravel's expressive syntax and architecture but need to work in the Node.js ecosystem, LaraNode is for you. It provides:

  • Familiar patterns -- Service providers, facades, Eloquent ORM, Artisan CLI
  • TypeScript first -- Full TypeScript support with decorators and type inference
  • Modular architecture -- 16 focused packages you can use independently
  • Production ready -- Queue workers, caching, rate limiting, monitoring dashboards

Philosophy

LaraNode follows Laravel's core principles:

  1. Developer Experience -- Expressive, readable APIs that make sense
  2. Convention over Configuration -- Sensible defaults with flexibility to override
  3. Batteries Included -- Everything you need out of the box
  4. Elegant Architecture -- IoC container, service providers, facades

Core Concepts

Service Providers

Service providers are the central place for configuring your application. They register bindings in the IoC container and boot services:

import { ServiceProvider } from "@lara-node/core";

export class AppServiceProvider extends ServiceProvider {
  register() {
    this.app.bind("myService", () => new MyService());
  }

  boot() {
    const service = this.app.make("myService");
    service.initialize();
  }
}

IoC Container

The container manages class dependencies and performs dependency injection:

import { container, Injectable } from "@lara-node/core";

@Injectable()
class UserService {
  constructor(private db: DatabaseService) {}
}

const service = container.make(UserService);

Eloquent Models

Models provide an expressive way to interact with your database:

import { Model, use } from "@lara-node/db";
import { SoftDeletes, Timestamps } from "@lara-node/db";

@use(SoftDeletes, Timestamps)
class User extends Model {
  static table = "users";
  static fillable = ["name", "email", "password"];
  static hidden = ["password"];
}

const users = await User.where("active", true).get();

Routing

Define routes with a fluent builder or controller decorators:

import { Route } from "@lara-node/router";

@Route("/api/users")
class UserController {
  @Route.get("/")
  async index() {
    return User.all();
  }

  @Route.post("/")
  async store(req: Request) {
    return User.create(req.body);
  }
}

Package Ecosystem

LaraNode is organized into focused packages:

PackageDescription
@lara-node/coreIoC container, Application, Service Providers
@lara-node/dbEloquent ORM with MySQL & MongoDB
@lara-node/routerExpressive routing with decorators
@lara-node/authJWT authentication & password hashing
@lara-node/validator50+ validation rules
@lara-node/cacheMulti-driver caching & rate limiting
@lara-node/queueJob queues with workers
@lara-node/eventsEvent dispatcher & broadcasting
@lara-node/mailMulti-driver email system
@lara-node/middlewaresPre-built middleware
@lara-node/carbonLaravel Carbon-inspired dates
@lara-node/consoleArtisan-style CLI
@lara-node/horizonQueue monitoring dashboard
@lara-node/telescopeDebug dashboard

Next Steps