All Projects → Odi-ts → Odi

Odi-ts / Odi

Licence: mit
🌪🌌 Opinionated, Declarative, Idiomatic framework for building scalable, supportable and reliable enterprise applications.

Programming Languages

typescript
32286 projects
es6
455 projects
declarative
70 projects
esnext
17 projects

Projects that are alternatives of or similar to Odi

Embedio
A tiny, cross-platform, module based web server for .NET
Stars: ✭ 1,007 (+281.44%)
Mutual labels:  websockets, webserver
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+20.45%)
Mutual labels:  websockets, webserver
Wok
A cherrypy framework for multi-purpose plug-ins
Stars: ✭ 215 (-18.56%)
Mutual labels:  websockets, webserver
Microwebsrv
A micro HTTP Web server that supports WebSockets, html/python language templating and routing handlers, for MicroPython (used on Pycom modules & ESP32)
Stars: ✭ 420 (+59.09%)
Mutual labels:  websockets, webserver
Facil.io
Your high performance web application C framework
Stars: ✭ 1,393 (+427.65%)
Mutual labels:  websockets, webserver
Appweb
Appweb Community Edition Embedded Web Server
Stars: ✭ 196 (-25.76%)
Mutual labels:  websockets, webserver
EthernetWebServer
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…
Stars: ✭ 118 (-55.3%)
Mutual labels:  webserver, websockets
SadlyDistributed
Distributing your code(soul), in almost any language(state), among a cluster of idle browsers(voids)
Stars: ✭ 20 (-92.42%)
Mutual labels:  websockets
echo-server
Echo Server is a container-ready, multi-scalable Node.js application used to host your own Socket.IO server for Laravel Broadcasting.
Stars: ✭ 36 (-86.36%)
Mutual labels:  websockets
LazWebsockets
Websocket Server and Client Library written in Lazarus
Stars: ✭ 51 (-80.68%)
Mutual labels:  websockets
tineola
Blockchains. Destruction. Mayhem.
Stars: ✭ 47 (-82.2%)
Mutual labels:  enterprise
httoop
HTTOOP - a fully object oriented HTTP protocol library written in python
Stars: ✭ 15 (-94.32%)
Mutual labels:  webserver
caddy-esi
Middleware for Caddy Server integrating ESI (edge side includes) tags with parallel loading. Able to connect to HTTP/S/2, Memcache, Redis, shell scripts, gRPC and SQL backends 🐜🐜🐜
Stars: ✭ 28 (-89.39%)
Mutual labels:  webserver
cloudflare-worker-graphql-ws-template
A template for WebSockets powered Cloudflare Worker project using graphql-ws
Stars: ✭ 21 (-92.05%)
Mutual labels:  websockets
Litecable
Lightweight Action Cable implementation (Rails-free)
Stars: ✭ 255 (-3.41%)
Mutual labels:  websockets
haskell-tic-tac-toe
A multiplayer web real-time implementation of the famous Tic Tac Toe game in Haskell.
Stars: ✭ 51 (-80.68%)
Mutual labels:  websockets
Flask Uwsgi Websocket
🔌 High-performance WebSockets for your Flask apps powered by uWSGI.
Stars: ✭ 259 (-1.89%)
Mutual labels:  websockets
expross
Expross is a lightweight webserver to introduce JavaScript developers familiar with Express to Python.
Stars: ✭ 27 (-89.77%)
Mutual labels:  webserver
onesait-cloud-platform-clientlibraries
Client libraries to interact with Onesait Platform Cloud Side (Digital Broker specially)
Stars: ✭ 15 (-94.32%)
Mutual labels:  websockets
WebCam-Streaming
Web-cam live streaming with websockets and SignalR with ASP.NET Core just for fun and to learn new things. 😀👨🏻‍💻
Stars: ✭ 31 (-88.26%)
Mutual labels:  websockets

TypeScript framework for creating enterprise-grade (web) applications with simple and minimalistic API, that allows you to focus on business logic. Based on declarative and imperative programming, inspiried by ASP.NET / Spring.

Check Docs for more details.

Odi provides feature set for creation of easy supportable and scalable web applications.

Features Overview:

  • [x] MVC
  • [x] Full-typed DI / IoT
  • [x] Authentication
  • [x] WebSockets
  • [x] TypeORM integration
  • [ ] GraphQL
  • [ ] AOP
  • [ ] SSR

For future updates check Roadmap
Got an idea, proposal or feature request? Feel free to Submit it!

Edit Odi

🚀 Getting Started

  1. Install npm package
    npm install odi --save

  2. Install reflect-metadata
    npm install reflect-metadata --save

  3. Import reflect-metadata (for example in index.ts):
    import "reflect-metadata";

  4. Enabled the following settings in tsconfig.json

    "emitDecoratorMetadata":  true, 
    "experimentalDecorators":  true
    

🌪 Overview

Controller

Controllers serve as a simple yet powerful routing mechanism in a minimalistic style.

@Controller('foo') 
export class FooController extends IController {      
        
    @RoutePatch('{id}')     
    bar(id: string, payload: FooDTO) {         
        ...some updates..          
        return Ok();     
    } 

    @Get index() {
        return 'Foo';
    }
} 

So, as you see, there no need to provide any additional param decorators for injection data from the HTTP request. It's just a small controller overview, there are a lot of other possibilities.You can read more in docs.

Dependency Injection

Odi has powerful dependency injection mechanism out of the box. (Let's imagine that we already have FooRepository)

//foo.service.ts
@Service()
export class FooService {

    @Autowired()
    repository: FooRepository;

    public getFoo(id: string) {
        return this.repository.findOne(id);
    }
}


//foo.controller.ts
@Controller('foo')
export class OrderController extends IController {

    @Autowired()
    fooService: OrderService;
    
    @Get async '{id}' (id: string) {
        const foo = this.fooService.getFoo(id);
        
        if(!foo)
            return NotFound();

        return foo;
    }
} 

As you can see, all dependencies will be automatically provided to all application components.

Currently, Odi support 3 ways of injection:

  • By constructor
  • By property
  • By method

Classes that are not Odi components can participate in DI. You can simply define behaviour with preset properties and constructor args.

class Pet {
    ...
}

define(Pet)
    .set('default', {
        constructorArgs: [...],        
        props: {...},
        type: 'singleton'
    })
    .set('special', {
        constructorArgs: [...],        
        props: {...},
        type: 'scoped'
    });

DTO

It's a common scenario when web server should validate data before processing. DTO can optimize and automate this process.

@Data()
export class TodoDTO {
   
    @MaxLength(80)
    title: string;
    
    @IsOptional()
    @MaxLength(255)
    desctiption: string;
}

Then, DTO class should be added as an argument for the controller method

@Controller('todo')
export class TodoController extends IController {

    @Autowired()
    todoService: TodoService;   
     
    @Post async index(payload: TodoDTO) {
        ...
    }
}

And it's all! Odi will automatically inject the validated request body in this argument. If there are some errors during validation, 400 status code will be sent with errors description.

Odi provides a wide set for DTO description, supporting nested DTOs, arrays, enums and etc.

To Sum up

It was a small overview of some features. If you interested in more, check the Docs.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].