@sindev95/laminajs
v0.0.7
Published
LaminaJS - A type-safe, Laravel-inspired backend framework for Bun + ElysiaJS
Downloads
1,100
Maintainers
Readme
LaminaJS
A type-safe, Laravel-inspired backend framework for Bun + ElysiaJS.
LaminaJS brings the ergonomics of Laravel — Eloquent models, migrations, controllers, service providers, queues, notifications, and more — to the Bun runtime with first-class TypeScript throughout.
Requirements
- Bun
>= 1.2.0
Create a new project
# Pick any package executor
bunx @sindev95/laminajs new my-app
npx @sindev95/laminajs new my-app
yarn create @sindev95/laminajs new my-app
cd my-app
bun install
bun run devThe CLI
The lamina binary is available inside scaffolded apps. Pass --help to see
everything.
lamina --helpScaffolding code
LaminaJS mirrors Laravel's generator flags, so you can spin up a whole resource stack in one command.
# Model + migration + resource controller + factory
lamina make:model Post -a
# same as: lamina make:model Post --all
# Combine any short flags (migration, controller, resource, factory)
lamina make:model Post -mrf
# Resource controller (7 RESTful methods)
lamina make:controller PostController --resource
lamina make:controller PostController -r
# API controller (5 methods, no create/edit) with a model hint
lamina make:controller PostController --api --model=Post
# Standalone generators
lamina make:model Post
lamina make:migration create_posts_table
lamina make:factory Post
lamina make:view home| make:model flag | Effect |
|-------------------|--------|
| -m, --migration | also create a migration |
| -c, --controller | also create a plain controller |
| -r, --resource | also create a resource controller |
| -f, --factory | also create a factory |
| -a, --all | migration + factory + resource controller |
| --api | use an API controller (combine with -c/-r/-a) |
| make:controller flag | Effect |
|------------------------|--------|
| -r, --resource | full RESTful controller (7 methods) |
| --api | API controller (5 methods, no create/edit) |
| -m, --model=Name | type-hint the given model |
Database
lamina migrate # run pending migrations
lamina migrate:rollback # roll back the last batch
lamina migrate:status # show migration status
lamina migrate:fresh # drop all tables and re-migrateTinker
An interactive REPL with the booted application in scope.
lamina tinkerEcosystem
lamina client:generate treaty # generate an Eden Treaty client from routes
lamina docs:generate # build a documentation site from markdown
lamina plugins:list # list official pluginsApp scripts
| Script | Description |
|--------|-------------|
| bun run dev | Dev server with hot reload |
| bun start | Production server |
| bun run assets:build | Compile frontend assets |
| bun run migrate | Run migrations |
Features
- MVC architecture — controllers, models, and Pop Engine views
- Eloquent-style ORM — models, relationships, factories, query builder
- Migrations — versioned schema changes with rollback support
- Service providers — Laravel-style bootable service containers
- Routing — type-safe routing on top of ElysiaJS
- Queues & jobs — Redis-backed queues, workers, and job tracking
- Notifications — Mail, Database, Broadcast, and Slack channels
- Caching — pluggable cache stores with a Redis driver
- Authentication — sessions, tokens (Sanctum-style), and password hashing
- Security — CSRF, CORS, CSP headers, SQL-injection-safe query builder
- Ecosystem — Eden Treaty client generator, plugin system, docs generator
License
MIT
