A modern, type-safe, and feature-rich framework for enterprise-grade web applications.
OneJs is a high-performance boilerplate built on top of Elysia.js and Bun, implementing Hexagonal Architecture and Domain-Driven Design (DDD). It provides a robust foundation for building scalable, maintainable, and type-safe backend services.
- 🚀 Extreme Performance - Leverages Bun's runtime and Elysia's optimized router.
- 🏗️ Architectural Excellence - Strict Hexagonal Architecture and DDD principles.
- 💉 Powerful DI - Built-in Dependency Injection container with decorator support.
- 📡 Event-Driven - Seamless communication using a built-in Event Bus.
- 👷 Background Processing - Managed background tasks with BullMQ & Redis.
- 🛡️ Built-in Security - JWT and Clerk authentication strategies out of the box.
- 🗄️ Schema Harmony - Automated Prisma schema merging for multi-module projects.
| Category | Technology |
|---|---|
| Runtime | Bun |
| Web Framework | Elysia.js |
| Database/ORM | PostgreSQL & Prisma |
| Task Queue | BullMQ & Redis |
| Code Quality | Biome |
| Environment | Docker / Podman |
OneJs enforces a clear separation of concerns, ensuring your domain logic remains pure and decoupled from infrastructure details.
graph TD
subgraph Infrastructure [Infrastructure Layer]
Controllers[Controllers / API]
Persistence[Prisma / Repositories]
External[External Adapters]
end
subgraph Application [Application Layer]
UseCases[Use Cases]
Services[Application Services]
end
subgraph Domain [Domain Layer]
Entities[Entities]
ValueObjects[Value Objects]
Events[Domain Events]
end
Infrastructure --> Application
Application --> Domain
Infrastructure --> Domain
-
Clone & Install
git clone <repository-url> cd OneJs_Boilerplate bun install
-
Launch Dev Environment
bun run start:api:dev
This starts the DB, merges schemas, runs migrations, and launches the API server.
Explore our comprehensive guides to master OneJs:
- Overview & Setup
- Hexagonal Architecture Deep Dive
- Dependency Injection & Core
- Routing & Controllers
- Database & Persistence
- Events & Background Jobs
- Authentication & Security
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git checkout -b feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.