A lightweight, modular backend framework built for speed and DX.
Built for performance, simplicity, and a better developer experience.
Installation Β· Architecture Β· Dependency Injection Β· CLI Β· Documentation Β· Contributing
- Overview
- Features
- Installation
- Architecture
- Dependency Injection
- CLI
- Learn More
- Contributing
- Security
- License
LykosJS is a backend framework for Bun and TypeScript. It pairs a lightweight HTTP core with explicit, decorator-free dependency injection, built-in validation, ready-to-use middleware, and an integrated CLI, so you can build real applications without assembling a stack from scratch.
| Feature | Description | |
|---|---|---|
| π§© | Modular Architecture | Clean, reusable modules that keep your codebase organized and maintainable. |
| π | Dependency Injection | Explicit, decorator-free DI with DIModule, bind, and value. |
| π‘οΈ | Ready-to-Use Middleware | Protect routes and handle common request workflows. |
| β‘ | High Performance | Built for Bun and TypeScript, with a lightweight HTTP core. |
| β | Built-in Validation | Validate incoming data with a simple, developer-friendly API. |
| π οΈ | Integrated CLI | Generate complete modules in seconds. |
| π― | Developer Experience | Straightforward APIs and a clean architecture without unnecessary complexity. |
Note
Requires Bun 1.4 or newer. There are two ways to get started.
bun create lykosjs my-appThis is the recommended way to get started. It creates a ready-to-use project with an organized modular structure.
Example application entry point (src/launch.ts):
import { Lykos } from 'lykosjs'
import { Modules } from './modules'
async function launch() {
const app = new Lykos()
app.GET('/', async (ctx, reply) => reply.send('Welcome to LykosJS πΊ'))
app.modules(Modules)
app.listen(4000, () => console.log('πΊ LykosJS is running at http://localhost:4000'))
}
launch().catch((error: unknown) => {
console.error('πΊ [LykosJS] Failed to start application:', error)
process.exit(1)
})After the project is generated, the terminal displays:
πΊ LykosJS Β· β Project created successfully
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
Location C:\Projects\my-app
Template REST API
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
Next steps
1. $ cd "my-app"
2. $ bun install
3. $ bun run dev
Happy building with LykosJS! π
LykosJS doesn't force a project structure on you. Initialize a Bun project and install LykosJS:
bun init
bun add lykosjsThen create your application entry point and configure your routes and modules using the LykosJS API.
Organize your application into focused modules. Each module can contain its own controllers, routes, services, and configuration.
Register your modules through the application:
app.modules(Modules)This keeps features separated and makes your application easier to maintain and extend.
LykosJS ships with an explicit, decorator-free dependency injection system. There is no reflect-metadata, no magic, and no hidden global container: every dependency a class receives is declared in its module, so you can read exactly what gets wired to what.
| Building block | Purpose |
|---|---|
DIModule |
Base class for a module. Declares what the module imports, provides, and exposes. |
bind(Class, ...deps) |
Registers Class as a provider and injects deps into its constructor, in order. |
value(x) |
Registers an existing value (a schema, config object, constant) so it can be injected. |
imports |
Other modules whose providers this module can use. |
providers |
Services, middlewares, schemas, and values available inside the module. |
controllers |
Controllers instantiated with their dependencies. |
routers |
Routers that connect controllers and middlewares to the Lykos app. |
auth |
Per-module authentication, configured with defineAuth. |
import { bind, value, defineAuth, DIModule, Lykos, AuthMiddleware } from 'lykosjs'
export class PaymentsModule extends DIModule {
override imports = [NotificationsModule, ContractsModule]
override providers = [
value(PaymentSchema),
value(OrderSchema),
bind(PaymentsService, PaymentSchema, OrderSchema, NotificationsService),
UserActiveMiddleware,
bind(UserVerificationMiddleware, UserVerificationSchema),
RolesMiddleware,
]
override controllers = [bind(PaymentsController, PaymentsService)]
override routers = [
bind(
PaymentsRouter,
Lykos,
PaymentsController,
AuthMiddleware,
UserActiveMiddleware,
UserVerificationMiddleware,
RolesMiddleware,
),
]
override auth = defineAuth({
verifier: PaymentsController,
mode: 'cookie',
cookieName: 'token',
})
}value(...)makes plain values (such as schemas) injectable.bind(Class, ...deps)creates the class by passing each dependency to its constructor, in the order you list them.importslets a module use providers exposed by other modules, such asNotificationsServicefromNotificationsModule.- Controllers receive their services; routers receive the
Lykosapp, the controller, and the middlewares they apply. defineAuthconfigures how the module authenticates requests (here, cookie-based with atokencookie).
Dependencies arrive through the constructor, in the same order as in bind(...):
export class PaymentsService {
constructor(
private readonly payments: typeof PaymentSchema,
private readonly orders: typeof OrderSchema,
private readonly notifications: NotificationsService,
) {}
}Tip
Keep the constructor order in sync with the bind(...) call. Changing one without the other changes what gets injected.
- Share, don't repeat. If several modules use the same schemas or middlewares, expose them from a dedicated module (for example a database module or a guards module) and list it in
imports. - Keep services focused. A service that needs many dependencies is usually a sign it should be split.
- Test easily. Because dependencies are plain constructor arguments, you can instantiate a class in a test with fakes, with no container required.
Generate a complete module with one command:
bun run lykosjs g module usersThe generator creates the module files according to the selected project template.
| Resource | Link |
|---|---|
| Framework | LykosJS on GitHub |
| Runtime | Bun |
| Documentation | LykosJS Documentation |
Contributions are welcome. Please read:
Important
For security issues, please read SECURITY.md and report vulnerabilities privately.
LykosJS is released under the MIT License. See LICENSE.
Copyright Β© 2026 Zen Allaham β LykosJS

