In Progress
Warning: This project is still Purpose
I want to create a web framework with really Najs
and elegant syntax like Laravel for Node Js, use Typescript.
Najs must have:
- Type-Safety: Written 100% in Typescript with strict rules
- Beautiful code: Use Class as must as possible, just like Java
- Reliable: Rely on strong and trusted frameworks such as
express
(for routing),bull
(for Task Queue) - High-Quality: Every single line of
Najs
must have unit test, coverage up to100%
Syntax
This is the syntax looks like
Binding
Register a class
// file: UserRepository.ts
Extend class
// file: UserRepositoryCached.ts
Bind class
// file: index.ts // before binding return instance of UserRepositorymake'Namespace.UserRepository' Najs.bind'Namespace.UserRepository', 'Namespace.UserRepositoryCached' // after binding return instance of UserRepositoryCachedmake'Namespace.UserRepository'
Autoload
// file: UserService.ts
Routing
Route.middleware'csrf', 'cors'.group
Model
Please check out this package Najs Eloquent
Controller
// file: UserController.ts
Status and Road map
I. Class Binding (In Progress - 90%)
register()
[Released] - register a classsingleton()
[Released] - register a class as a singletonmake()
[Released] - make an instance of class which registered byregister()
bind()
[Release] - simple binding (primitives binding is delayed)
II. Model [Released] - It's developed and released in separate package Najs Eloquent
III. Routing [Released] - I'm going to use express
as a routing framework
IV. Controller & Endpoint [Released]
V. Session & Cookie [In Progress]
Contribute
If you want to be a contributor, please let me know.