Installation
Installation
This guide covers different ways to install and set up LaraNode in your project.
Using Create LaraNode (Recommended)
The fastest way to start a new project:
pnpm create vest my-app
cd my-app
pnpm install
This scaffolds a complete application with all recommended packages.
Installing Individual Packages
You can install LaraNode packages individually:
# Core (required)
pnpm add @lara-node/core
# Database
pnpm add @lara-node/db
# Routing
pnpm add @lara-node/router
# Authentication
pnpm add @lara-node/auth
# Validation
pnpm add @lara-node/validator
# Cache
pnpm add @lara-node/cache
# Queue
pnpm add @lara-node/queue
# Events
pnpm add @lara-node/events
# Mail
pnpm add @lara-node/mail
# Middlewares
pnpm add @lara-node/middlewares
# Date handling
pnpm add @lara-node/carbon
# Console CLI
pnpm add @lara-node/console
# Monitoring
pnpm add @lara-node/horizon @lara-node/telescope
Peer Dependencies
Most LaraNode packages require @lara-node/core as a peer dependency. Make sure to install it:
pnpm add @lara-node/core reflect-metadata
Required Dependencies
LaraNode requires these base packages:
pnpm add express cors reflect-metadata
TypeScript Configuration
LaraNode uses decorators and requires specific TypeScript settings:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node"
}
}
Environment Setup
Create a .env file in your project root:
# Application
NODE_ENV=development
APP_KEY=base64:your-generated-key-here
APP_PORT=3000
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_NAME=vest_app
# Cache
CACHE_DRIVER=file
# Queue
QUEUE_CONNECTION=sync
# Mail
MAIL_DRIVER=log
Generate an application key:
pnpm exec artisan key:generate
Verify Installation
Create a simple test:
import { Application, Container } from "@lara-node/core";
const container = new Container();
const app = new Application(container);
await app.boot();
console.log("LaraNode is working!");
Next Steps
- Project Structure -- Understand the directory layout
- Configuration -- Configure your application
- Core Package -- Learn about the core container
Getting Started
This guide will help you create your first LaraNode application from scratch.
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.