Teo: A Next-Generation Web Framework in Rust, Supporting Node and Python with Incredible Speed!

Set Script Home as “Starred to receive article updates firstTeo: A Next-Generation Web Framework in Rust, Supporting Node and Python with Incredible Speed!Source: Programmer Fisher (ID: haxgly666)

Today’s sharing theme is that with the rapid development of web technologies, development has become increasingly complex, requiring more time and effort. Today, we introduce a next-generation web framework written in Rust.

Web project development is becoming more complex, presenting many challenges for developers. It is essential to flexibly utilize the latest web development frameworks to improve development efficiency and respond to ever-changing demands.

Recently, while browsing GitHub, I came across a structure-centric next-generation web framework—TEO, a web framework suitable for Rust, Node.js, and Python, which significantly enhances the efficiency of application developers when using web servers and databases. Notably, this project has now become a GVP project on Gitee.

Teo: A Next-Generation Web Framework in Rust, Supporting Node and Python with Incredible Speed!

What is TEO?

Teo is a next-generation web framework. It consists of the following components:

  • Teo schema: An intuitive and innovative schema language with descriptiveness and readability

  • Teo server: A high-performance core written in Rust, with API bindings for Node.js, Python, and Rust

  • Teo CLI: A CLI tool for reading schemas and executing tasks, including database migrations, running servers, and seeding data

  • Teo query client: An automatically generated type-safe query builder for multiple platforms and languages

Why use TEO?

Traditional Web Frameworks

  • Excessive boilerplate code: Developers need to write repetitive code for each route, which is not only time-consuming but also prone to errors.

  • Lack of built-in features: Traditional frameworks often do not provide common functionalities such as filtering, sorting, and pagination, requiring developers to implement these features themselves.

  • Difficult debugging: Debugging SQL queries and MongoDB aggregations is complex, error-prone, and time-consuming.

  • Redundant types and interfaces: In front-end development, developers need to re-declare the data types and interfaces of back-end models, leading to redundant work.

Teo Modern Web Framework:

  • Reduces boilerplate code: The next-generation framework reduces the boilerplate code developers need to write by providing more abstractions and automation tools.

  • Built-in common features: Modern frameworks typically include built-in functionalities such as filtering, sorting, and pagination, allowing developers to easily implement these features without starting from scratch.

  • The next-generation framework provides better tools and interfaces to simplify the debugging process of database queries and aggregations, reducing the likelihood of errors.

  • Unified data types and interfaces: Modern frameworks allow developers to define data models and interfaces on the server side, then automatically generate client-side code, reducing redundant work and improving consistency between front-end and back-end code.

For more information about Teo, you can visit the official website.

Features and Characteristics

Let’s take a look at the features offered by Teo.

  • Highly innovative structure definitions inspired by GraphQL and Prisma

  • Automatic database migrations

  • Support for Rust, Node.js, and Python

  • Support for MySQL, PostgreSQL, SQLite, and MongoDB

  • Generated ORM types and interfaces

  • Query clients generated for the front end

  • Extremely efficient and high-performance

  • Data cleaning, transformation, and validation

  • Built-in user sessions

  • Built-in permission checks

  • Advanced middleware

  • Custom routes and handlers

Teo: A Next-Generation Web Framework in Rust, Supporting Node and Python with Incredible Speed!

Quick Start

A typical Teo workflow consists of the following parts:

1. Choose Your Language Stack

Teo supports three server-side programming languages: Node.js, Python, and Rust, allowing you to choose the language you are familiar with to get started.

  • Node.js integrates well with web technologies.

  • Python is excellent for interacting with AI infrastructure.

  • Rust pursues extreme performance, but it is challenging to write.

Teo cares about code duplication and productivity. Therefore, the front-end client is generated by Teo. Teo supports five front-end languages: TypeScript, Swift, Kotlin, C#, and Dart. This nearly covers mainstream front-end technologies. You can easily use these generated clients or share them with front-end developers.

Note: Currently, Swift, Kotlin, C#, and Dart are temporarily unsupported, but the Teo team aims to support them in 2024, and it should be available soon.

2. Schema Your Data

Teo features an innovative and easy-to-read schema language inspired by GraphQL and Prisma. Database configurations, server configurations, models, enums, and route handlers are all declared within it. What you write is what you think, and what you see is what you get, which is fantastic.

Teo takes your detailed schema description and performs database migrations, input validation, and transformations for you.

3. ORM Entities and Server Code

Automatically generated route handlers can meet 80% of business needs. There will always be some custom requirements that developers need to write code to handle. Teo is a mature web framework, not a no-code or low-code tool. Let Teo do the heavy lifting and generate ORM entities. Write code using Teo’s programming API in any server language supported by Teo.

4. Generate Clients for the Front End

Problems with Traditional Front-End Development:

  • Developers repeatedly write interface request and parameter handling code across multiple front-end projects, which is inefficient and error-prone.

Teo Framework’s Solution:

  • Teo automatically generates type-safe front-end code, reducing redundant work and improving development efficiency.

  • Supports multiple programming languages to adapt to different development needs.

  • Integrates into existing projects or creates new packages, providing flexibility.

Interested partners can go and experience it!

References:

  • https://github.com/teocloud/teo

  • https://teocloud.io/

  • https://teocloud.io/blog

  • https://docs.teocloud.io/

  • https://gitee.com/teocloud/teo


  Recommended Reading:

  1. Why Microsoft Strongly Supports Rust: Hear the Story Behind It
  2. February Programming Language Rankings: Go Enters the Top Ten for the First Time, “Ancient Language” COBOL Close Behind Rust
  3. After Abandoning C/C++, the New Team Announces Full Embrace of Rust!
  4. Why Learn Rust?
  5. Some Questions to Consider Before Transitioning from Java to Rust

Teo: A Next-Generation Web Framework in Rust, Supporting Node and Python with Incredible Speed!

Leave a Comment