jepotter1-archive / odi

πŸŒͺ🌌 Opinionated, Declarative, Idiomatic framework for building scalable, supportable, enterprise applications and servers.

Home Page:https://odi.gitbook.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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

For future updates check Roadmap

πŸš€ 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

πŸŒͺ Example

import { Controller, IController, Post, Get, Autowired } from "odi";
import { TodoService } from "./todo.service";
import { TodoDTO } from "./todo.dto";

@Controller()
export class TodoController extends IController {

   @Autowired()
   todoService: TodoService;

   @Get index() {
       return `Hello, ${this.request.ip}`;
   }

   @Post async save(toDo: TodoDTO) {
       await this.todoService.save(toDo);
   }
   
   @Get async '{id}' (id: string) {
       const todo = await this.todoService.find(id);
       
       if(!todo) 
         throw NotFound;
       
       return todo;
   }
}

About

πŸŒͺ🌌 Opinionated, Declarative, Idiomatic framework for building scalable, supportable, enterprise applications and servers.

https://odi.gitbook.io

License:MIT License


Languages

Language:TypeScript 100.0%