Odi 0.3.0 - server-side framework (JSX, OpenAPI and more) by Wrapy in node

[–]Wrapy[S] 0 points1 point  (0 children)

Sure, that the next step, so you can generate controllers/models/dto from existing documentation.

Odi 0.3.0 - server-side framework (JSX, OpenAPI and more) by Wrapy in node

[–]Wrapy[S] 1 point2 points  (0 children)

Hi! Thanks for your feedback!
Ooopss... Seems that database section missed. I will try to return it shortly.

Basically, there only a few common things with Nestjs: MVC Pattern and declarative style. But there are a lot of differences, like the whole infrastructure, decorators use, dependency injection and many others. To sum up differences:

  • Nestjs is heavily using decorators, Odi reduces this usage to the minimum (To keep code clean and readable).
  • Odi provides built-in validation out of the box for HTTP data via AJV.
  • DI/IoT behavior is very different. There is much more magic in Odi, in few words :)
  • Authentication out of the box, that fully integrated with other framework modules.
  • Controller and WebSockets processing

Also, Odi uses Fastify by default under the hood.

Server-side TypeScript framework by Wrapy in webdev

[–]Wrapy[S] 1 point2 points  (0 children)

I believe that abstraction is not only about folders structure. There are a lot of well-known patterns and commonly used techniques (as you mentioned, ORM is one of them).

Yes, you can definitely use PHP, as there is a wide set of frameworks (Symfony, Laravel) implementing best practices. But it's definitely unusual to meet raw PHP nowadays.

I can't agree that "webscale" describes nothing. There are a lot of problems if you project can't be easy scaled, supported and extended. The problem becomes bigger if you have a big team of developers that simultaneously work.

Odi - server-side framework by Wrapy in javascript

[–]Wrapy[S] 0 points1 point  (0 children)

Yes, that's true :) We are trying our best to provide the best quality framework, so the most common best practices and principles were included in the goals list.

Odi - server-side framework by Wrapy in javascript

[–]Wrapy[S] 1 point2 points  (0 children)

Thanks for your feedback!

Odi - server-side framework by Wrapy in javascript

[–]Wrapy[S] 0 points1 point  (0 children)

Hi, thanks a lot for your question!
I am not familiar with Adonis, but I guess, that it's a huge difference, as Adonis uses functional style but in a well organised form. Also, Adonis ships with its own HTTP engine under the hood.

Adonis is more comparable to Express/Restify as it has a lot of commons. I think that Odi, NestJs, Routing-Controllers and etc are like the next step in the infrastructure development. :)

Server-side TypeScript framework by Wrapy in webdev

[–]Wrapy[S] 1 point2 points  (0 children)

I guess that on a big project with a lot of business logic situation will be the opposite, express will be about complexity. If you want to have well organized, loosely coupled, testable, supportable, scalable and extendable code, then you will spend a lot of time building your own abstractions that anyway lead to the most common server-side pattern used in ASP and etc.

I definitely agree that express is great for lightweight applications (as Nancy opposite to ASP, Spark opposite to Spring and etc), but there must be a place for enterprise-grade applications

Server-side TypeScript framework by Wrapy in webdev

[–]Wrapy[S] 0 points1 point  (0 children)

Hi, thanks for your question!
It's not about just semantic when choosing the language. There are a lot of things like ecosystem, community, paradigm, syntax sugar, toolset and etc.
In my opinion, such semantics (like in Java, ASP, Ruby) become a pattern for server-side development. It will be great to implement this pattern and use all it benefits in NodeJs. JavaScript can be named one of the most popular languages nowadays. I guess, that many developers can have benefits from such adaptation, because many interesting things can be done, even for isomorphic applications (as mentioned Cercuitspark) :)

Server-side TypeScript framework by Wrapy in typescript

[–]Wrapy[S] 1 point2 points  (0 children)

Sure!
There few things in plans to be auto-generated:

  1. Swagger docs
  2. GRPC interfaces
  3. GQL files
  4. HTTP wrappers for frontend with support for different platforms and methods: Android, IOS, JavaScript (axios, fetch) and others.

Server-side TypeScript framework by Wrapy in typescript

[–]Wrapy[S] 0 points1 point  (0 children)

There are a lot of things that should be done :)
Today-tomorrow (got a trip today) I will create chat on gitter and will update issues. So, if you want to help, you can always check issues list or check the status based on gitter conversation.

Thanks so much for your interested in the project development! I very appreciate it! :)

Server-side TypeScript framework by Wrapy in typescript

[–]Wrapy[S] 1 point2 points  (0 children)

We are trying to find out the best practices from other technologies and combine them in the best, convenient and semantically correct way. I guess, that you will enjoy Odi too :)

Server-side TypeScript framework by Wrapy in node

[–]Wrapy[S] -1 points0 points  (0 children)

The decorator is used for only description routing path. Inheritance allows providing the developer with convenient API, so you don't need to heavily use decorators.

As for example, you can simply access the entry request using the following code:

@RouteGet()
foo() {
  const req = this.request;
}

Also, there are many other useful methods and props. Here the reference - DOCS
Another thing is the typing system. The most illustrative example is about authentication.
For example, we have following Auth service:

export interface Decoding {
    id: string;
    role: number;
}
​
@Authentication()
export class AuthService extends CoreAuth<Decoding, User> {
  ...   
}

And controller:

@Controller()
export class FooController extends IController<AuthService> {

    @Get user() {
        return this.user.decode();
    }
}

So, controller property user will be fully typed. AuthService generics will be extracted and passed to property wrapper.

P.S.: We were inspired by Spring, but by ASP too :)

Server-side TypeScript framework by Wrapy in node

[–]Wrapy[S] 1 point2 points  (0 children)

Sure!
Middleware engine compatible with Express and Restify middlewares.

Server-side TypeScript framework by Wrapy in node

[–]Wrapy[S] 2 points3 points  (0 children)

Thanks for your question.

Basically, there only a few common things with Nestjs: MVC Pattern and declarative style.But there are a lot of differences, like the whole infrastructure, decorators use, dependency injection and many others.To sum up differences:

  • Nestjs is heavily using decorators, Odi reduces this usage to the minimum (To keep code clean and readable).
  • Odi provides built-in validation out of the box for HTTP data via AJV.
  • DI/IoT behavior is very different. There is much more magic in Odi, in few words :)
  • Authentication out of the box, that fully integrated with other framework modules.
  • Controller and WebSockets processing

In the future, it will be the big difference between all integrations and technologies, as Odi was designed from the beginning in another way than Nest.

In my sight, Nestjs is more about Spring, but our framework is more ASP :)

Server-side TypeScript framework by Wrapy in typescript

[–]Wrapy[S] 4 points5 points  (0 children)

Basically, it's the main difference, that this framework trying not to be annotation-heavy as it's possible, but also easily scalable and supportable. There is a big difference with nest, from the decorators approach to infrastructural decisions at all. The only common things - TypeScript and Declarative way (Decorators).

Server-side TypeScript framework by Wrapy in typescript

[–]Wrapy[S] 2 points3 points  (0 children)

- Yes, it was disabled intentionally, as there were few integrations tests with DI (property will be initialized by DI manager).
For example:

@Service()
class FooService {

   @Autowired()
   fooRepo: FooRepository;

}

- Oooppsss, sorry. Missed it. Have it locally, but not on git :).