Today I will share the topic. With the rapid development of web technology, development has become increasingly complex and requires more time and effort. Today, I will introduce this new generation web framework written in Rust.
Web project development is becoming increasingly complex, which also brings many challenges to developers. It is necessary to flexibly use the latest web development frameworks to improve development efficiency and respond to constantly changing needs.
Recently, while browsing Github, I came across a new generation of web framework with structure as its core - TEO, a web framework suitable for Rust, Node.js, and Python , which can greatly improve the work efficiency of application developers when using web servers and databases. It is worth mentioning that this project has now become GVP project of Gitee.
What is TEO?
Teo is a new generation web framework. It consists of the following parts:
- Teo schema: an intuitive and innovative schema language that is descriptive and readable
- Teo Server: High-performance core written in Rust and API bindings for Node.js, Python, and Rust
- Teo CLI: A CLI tool for reading schemas and performing tasks, including database migration, running servers, and seeding data
- Teo Query Client: Automatically generated type-safe query builder for multiple platforms and languages
Why use TEO?
Traditional web frameworks
- Many boilerplate codes : developers need to write duplicate code for each route, which is not only time-consuming but also error-prone.
- Lack of built-in features : Traditional frameworks often do not provide common functions such as filtering, sorting, and pagination, and developers need to implement these functions themselves.
- Debugging Difficulty : Debugging SQL queries and MongoDB aggregation is complex, error-prone, and time-consuming.
- Type and interface duplication : In front-end development, developers need to re-declare the data types and interfaces of the back-end model, resulting in duplication of work.
Teo Modern Web Framework:
- Reduce boilerplate code : The new generation of frameworks reduces the amount of boilerplate code developers need to write by providing more abstraction and automation tools.
- Built-in common features : Modern frameworks often have common features such as filtering, sorting, and pagination built in, making it easy for developers to implement these features without having to write them from scratch.
- The new generation framework provides better tools and interfaces to simplify the debugging process of database queries and aggregation, reducing the possibility of errors.
- Unified data types and interfaces : Modern frameworks allow developers to define data models and interfaces on the server side, and then automatically generate Client code, reducing duplication of effort and improving consistency between front-end and back-end code.
More information about Teo can be found on the official website.
Functions and features
Let’s take a look at what features Teo provides.
- Innovative structural definition inspired by GraphQL and Prisma
- Automatic database migration
- Supports Rust, Node.js, and Python
- Supports MySQL, PostgreSQL, SQLite, and MongoDB.
- Generated ORM types and interfaces
- Query Client generated for frontend
- Very efficient and high performance
- Data cleaning, transformation, and validation
- Built-in user sessions
- Built-in permission check
- First in, last out Middleware
- Custom routes and handlers
Quick Start
A typical Teo workflow consists of the following parts:
1. Select your language stack
Teo supports three server-side programming languages: Node.js, Python, and Rust. You can choose a language you are familiar with to work with.
- Node.js works well with web technologies.
- Python is great for interacting with artificial intelligence infrastructures.
- Aimed for the Highest Performance, Rust is hard to write.
Teo cares about code repetition and productivity. Therefore, the front-end Client is generated by Teo. Teo supports 5 front-end languages: TypeScript, Swift, Kotlin, C #, and Dart. This almost covers mainstream front-end technologies. Easily use these generated Clients or share them with front-end developers.
Note: Currently, Swift, Kotlin, C #, and Dart are not yet supported, but the Teo team has set a goal for 2024, and I believe it should be supported soon.
2. Structure your data
Teo has an innovative and easy-to-read schema language inspired by GraphQL and Prisma. Database configuration, server configuration, models and enumerations, and routing handlers are all declared in it. What you write is what you think, what you see is what you get, which is really great.
Teo adopts the pattern you described in detail and performs database migration, input validation, and transformation for you.
3. ORM entity and server code
Automatically generated routing handlers can meet 80% of business needs. There are always some custom requirements that require developers 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. Use Teo’s programming API to write code in any server language supported by Teo.
4. Generate Client for Front-end
Issues with traditional front-end development:
- Developers repeatedly write interface request and parameter processing code in multiple front-end projects, which is inefficient and error-prone.
Teo framework solution:
- Teo automatically generates type-safe front-end code, reducing repetitive work and improving development efficiency.
- Supports multiple programming languages to adapt to different development needs.
- Integrate into existing projects or create new packages to provide flexibility.
Interested partners can go and experience it now!
Reference materials: