Skip to main content

Teo



Schema-driven web server framework.

Quickstart   •   Official website   •   Docs   •   Blog   •   Discord

Introduction

Teo is schema-driven web server framework. The server side API is native to Rust, Node.js and Python.

Highlights & Features

  • Native to Rust, Node.js and Python
  • Innovative schema definition inspired by GraphQL and Prisma
  • Auto database migration
  • Supports MySQL, PostgreSQL, SQLite and MongoDB
  • Generated ORM types and interfaces
  • Generated query clients for frontend
  • Very efficient and performant
  • Data sanitization, transformation and validation
  • Builtin user sessions
  • Builtin permission check
  • First in last out middlewares
  • Custom route handlers
  • Generated customizable admin dashboard
  • Plays great with AI tools

Getting started

The fastest way to get started with Teo is by following the Quickstart guide.

Installation

Install Node.js edition.

npm install @teodevgroup/teo

Install Python edition.

pip install teo

Install Rust edition.

cargo install teo

Write a schema-only server

To write a server is quite simple with Teo. Create a file named schema.teo. Specify which database to connect and which port to listen.

connector {
  provider: .sqlite,
  url: "sqlite::memory:"
}
 
server {
  bind: ("0.0.0.0", 5050)
}
 
model User {
  @id @autoIncrement @readonly
  id: Int
  @unique @onSet($if($presents, $isEmail))
  email: String
  name: String?
  @relation(fields: .id, references: .authorId)
  posts: Post[]
}
 
model Post {
  @id @autoIncrement @readonly
  id: Int
  title: String
  content: String?
  @default(false)
  published: Bool
  @foreignKey
  authorId: Int
  @relation(fields: .authorId, references: .id)
  author: User
}

Start the server with teo serve command. Now you can create, update, delete, read, aggregate and group by. Read our Query client guide for detailed usage.

Write custom handlers

Declare the handler in the schema.

@map(.get, "/echo/:data", interface: "EchoCaptures")
declare nonapi handler echo(): Any

Implement the handler with program code.

Node.js implementation

import { App, Response, Request } from '@teodevgroup/teo'
import { EchoPathArguments } from './entities'
 
const app = new App()
app.mainNamespace().defineHandler("echo", (request: Request) => {
    const captures: EchoCaptures = request.captures()
    return Response.string(captures.data, "text/plain")
})
app.run()

Python implementation

from asyncio import run
from teo import App, Response, Request
from entities import EchoCaptures
 
async def main():
    app = App()
    def echo_handler(request: Request):
        captures: EchoCaptures = request.captures()
        return Response.string(captures["data"], "text/plain")
    app.main_namespace.define_handler("echo", echo_handler)
    await app.run()
 
run(main())

Rust implementation

mod entities;
 
use tokio::main;
use teo::prelude::{App, Response, Result, path};
use crate::entities::EchoCaptures;
 
#[main]
async fn main() -> Result<()> {
    let app = App::new()?;
    app.main_namespace_mut().define_handler("echo", |captures: EchoCaptures| async move {
        Ok::<Response, Error>(Response::string(captures.data(), "text/plain"))
    });
    app.run().await
}

Tutorials

We prepared a Beginner tutorial series to help you learn and understand Teo.

Issues

Welcome to submit issues in this repo.

Contributing

Read our Contributing guide to set projects up and start contributing.

License

TEO is under Apache 2.0 license.

Metadata

Release files for teo 0.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teo 0.3.9
File Size Uploaded
teo-0.3.9.tar.gz 160.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for teo 0.3.9
File
teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl CPython 3.13 CPython 3.13 free-threading Linux glibc 2.28+ ARMv7l Details
teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 free-threading Linux glibc 2.28+ ARM64 Details
teo-0.3.9-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
teo-0.3.9-cp313-cp313-win32.whl CPython 3.13 CPython 3.13 Windows x86-32 Details
teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARMv7l Details
teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details
teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details

Total release size: 150.1 MB

Release files / teo-0.3.9.tar.gz

Download URL teo-0.3.9.tar.gz
Size 160.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1c1b6735c83227b75236ba651be149878990ec7b83c19d79087e7a5a1ee09535
BLAKE2b-256 checksum
How to use checksums
2fa1371d94c14f6cafaaf0ad3cd9624c6713cedf3ee119ea0dd4959b3c1a336a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl

Download URL teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl
Size 17.5 MB
Tags CPython 3.13 CPython 3.13 free-threading Linux glibc 2.28+ ARMv7l
SHA-256 checksum
How to use checksums
c0f079aa4decd1ec24ac00b610a7cd97a7c08d19302a908809a40480ab7b45d0
BLAKE2b-256 checksum
How to use checksums
5f94e3b374d29949fe00f97ffb78f324bbdc275f29f50041aa09cc74df35241c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl

Download URL teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl
Size 18.5 MB
Tags CPython 3.13 CPython 3.13 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
b2ad5f56ba5f779b8bd9c6063f01d0efd6186e0e5fb9cab14b449d42db00af8c
BLAKE2b-256 checksum
How to use checksums
069e6fc0723202413a7504edd741ea6ce3bf5af55fca5fba78927d133647133c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-win_amd64.whl

Download URL teo-0.3.9-cp313-cp313-win_amd64.whl
Size 15.2 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
fe52b2f91a2cfcf208be6fcf28e6a679bc4662c67b79f3f5e31641310bd53854
BLAKE2b-256 checksum
How to use checksums
0029ff773ca517b7ef89d64f24a66badf583a0fc43ee95ebed5396cbb57f2a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-win32.whl

Download URL teo-0.3.9-cp313-cp313-win32.whl
Size 13.3 MB
Tags CPython 3.13 Windows x86-32
SHA-256 checksum
How to use checksums
db22d1083c7f257c1134a3622fc88c56448562aa02f16f8d33d8776e7cfd0751
BLAKE2b-256 checksum
How to use checksums
8123c466977670a1732c152f048b8a653c89635feee5b410a98799a7d5c39f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl
Size 19.0 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
aa3fe88bd09b3e6dc1bb0afeba12ef9ee6d5aaaf1361b8d8656b88ca94701bed
BLAKE2b-256 checksum
How to use checksums
0fb94aaed404836efdd069654085ca2c2a515a6e823696148f03b241d9a55b85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl

Download URL teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl
Size 17.5 MB
Tags CPython 3.13 Linux glibc 2.28+ ARMv7l
SHA-256 checksum
How to use checksums
36c974b440adca9a1cd5231ff348775428105d43e8def78aeb735b7ada5583c7
BLAKE2b-256 checksum
How to use checksums
91944e8b280d6737b30f6be4d4d4e457825f13df0c69a5ee40e69b1b3f2a6c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl

Download URL teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl
Size 18.5 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
01e066574d8b8d5b1ed037129d34d6ad795b0c41355f9292c1e05c265d183851
BLAKE2b-256 checksum
How to use checksums
0f62f1d21a3eff2fdcb1aaaf66de5ec10bfb08313835d7cc467c1556cdf93403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl

Download URL teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl
Size 14.8 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3fd5c02e0c1d18cc24c07fba27cbf09402355ba190dd76bf4f96bd4288a51873
BLAKE2b-256 checksum
How to use checksums
72446be02666847c215869a881ef76b591deeff07c379320c93590d372507424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release files / teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl

Download URL teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl
Size 15.7 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0c00909181b911b13dc5c25d6c740a682444cba45388b5c765119715331c3b93
BLAKE2b-256 checksum
How to use checksums
16e3442b3cfe6caa7669763cc13b87457e88208d9cf290c35cac73c36bbef8dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.1

Release history Release notifications | RSS feed

This release

0.3.9 This release

10 release files

0.3.8

10 release files

0.3.7

10 release files

0.3.4

8 release files

0.3.3

8 release files

0.3.2

8 release files

0.3.1

8 release files

0.3.0

8 release files

0.2.36

8 release files

0.2.35

8 release files

0.2.34

8 release files

0.2.33

8 release files

0.2.32

8 release files

0.2.31

8 release files

0.2.30

8 release files

0.2.29

8 release files

0.2.24

8 release files

0.2.22

8 release files

0.2.21

8 release files

0.2.20

8 release files

0.2.19

8 release files

0.2.8

10 release files

0.2.6

10 release files

0.2.5

10 release files

0.2.4

10 release files

0.2.3

10 release files

0.2.2

10 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page