carno.js README

The project's README from github.com/carnojs/carno.js. As one markdown file: README.md.

Carno.js logo

Carno.js

An opinionated application framework and ORM ecosystem for Bun and TypeScript.

Documentation · Getting started · GitHub

Bun native TypeScript first MIT license

Overview

Carno.js is an opinionated application framework for Bun, shaped for teams that want the familiar structure of NestJS and the enterprise patterns popularized by Spring in the Java ecosystem.

It combines a fast Bun-native HTTP core, dependency injection, decorators, validation, middleware, lifecycle hooks, and optional packages for data access, queues, scheduling, static files, views, WebSockets, and logging. The goal is to keep applications organized as they grow, with clear boundaries between controllers, services, modules, and infrastructure.

This repository is the monorepo for the Carno.js ecosystem. The README is intentionally concise; feature guides, examples, and API details live in the documentation site.

Why Carno.js

Packages

Package Purpose
@carno.js/core HTTP framework, routing, dependency injection, middleware, validation, lifecycle hooks, and testing utilities.
@carno.js/orm Lightweight SQL ORM for PostgreSQL and MySQL, including repositories, query builder, relationships, migrations, identity map, and sessions.
@carno.js/queue Background job processing built around BullMQ.
@carno.js/schedule Cron, interval, and timeout scheduling.
@carno.js/static Static file serving for Bun applications.
@carno.js/views Optional MVC views with Handlebars, EJS, Pug, or a custom engine.
@carno.js/websocket WebSocket gateways, rooms, namespaces, and broadcasting.
@carno.js/live Server-owned reactive state: live resources, dependency-graph invalidation, and framework-native client stores.
@carno.js/logger Logging utilities for Carno.js applications.
@carno.js/client Type-safe HTTP client generated from controllers.
@carno.js/cli Command-line tools, including ORM migration workflows.

Getting Started

Install the core package:

bun install @carno.js/core

On Windows, wrap scoped package names in quotes:

bun install "@carno.js/core"

Then follow the full setup guide in the documentation:

Installation and setup

Documentation

The documentation site is the source of truth for usage examples and API guidance:

Repository Workflow

Install dependencies:

bun install

Run the TypeScript build:

npm run build

Run tests:

bun test

Run ORM tests against PostgreSQL or MySQL:

npm run test:postgres
npm run test:mysql

Documentation Site

The site is built with Docusaurus and lives in docs/carno.

cd docs/carno
npm install
npm run start

Use the site for new guides, examples, and API explanations. Keep this README focused on project positioning, package discovery, and contributor orientation.

Contributing

Issues, pull requests, bug reports, and documentation improvements are welcome. Before opening a large change, prefer starting with an issue or discussion so the scope and expected behavior are clear.

License

Carno.js is released under the MIT License. See LICENSE for details.

carno.js (carnojs/carno.js)

Searching Database…

Что это такое?Это фреймворк для приложений с продуманной структурой под Bun и TypeScript: организация в духе NestJS и enterprise-паттерны как в Spring — контроллеры, сервисы, модули, внедрение зависимостей — на быстром рантайме Bun.
Это один пакет или целый набор?Набор. Этот репозиторий — монорепозиторий: @carno.js/core — это HTTP-фреймворк (роутинг, DI, middleware, валидация), а всё остальное — ORM, очереди, планировщик задач, views, WebSockets — оформлено как опциональные пакеты, которые подключаешь, только если они нужны.
Как добавить его в новый проект?Установите @carno.js/core с помощью своего пакетного менеджера, затем следуйте инструкции по настройке на сайте документации. В Windows имя пакета со скоупом нужно заключить в кавычки.
Обязательно именно Bun, или Node.js тоже подойдёт?Bun обязателен: фреймворк построен прямо на рантайме и HTTP-сервере самого Bun — именно отсюда его производительность.
Какие базы данных поддерживает встроенный ORM?PostgreSQL и MySQL. В ORM входят репозитории, построитель запросов, связи, миграции, identity map и сессии; workflow миграций описан в пакете @carno.js/cli.
Если моя команда уже использует NestJS, насколько просто перейти?Как раз для такой аудитории фреймворк и сделан: он намеренно повторяет опыт работы с NestJS и архитектуру в духе Spring, а в документации есть отдельный гайд 'Coming from NestJS'.
Что умеют опциональные пакеты из коробки?Фоновые задачи на BullMQ, планировщик с cron, интервалами и таймаутами, WebSocket-гейтвеи с комнатами и рассылкой сообщений всем подписчикам, MVC-views с Handlebars, EJS или Pug, раздачу статических файлов и утилиты для логирования.
Что такое @carno.js/live?Реактивное состояние, которым владеет сервер: live-ресурсы с инвалидацией по графу зависимостей в связке со встроенными во фреймворк клиентскими сторами, чтобы интерфейс реагировал на изменение состояния на сервере.
Он помогает вызывать API из фронтенда?Да — @carno.js/client генерирует типобезопасный HTTP-клиент прямо из ваших контроллеров, так что вызовы на фронтенде всегда соответствуют типам бэкенда.
Зачем это, если можно просто запустить NestJS на Bun?Заявленная цель — сохранять порядок в приложении по мере его роста: чёткие границы между контроллерами, сервисами, модулями и инфраструктурой, при этом производительность заложена в сам Bun, а не разменивается на структуру.
What are similar projects?sails, beego, hestjs, laravel, iris, effect-mq, remix, Perfect
Creator
carnojs
Size
5.2 MB
Stars
111
Age
2y
Commits · 90 Days