Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teo-0.3.9.tar.gz (160.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl (17.5 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARMv7l

teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl (18.5 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ ARM64

teo-0.3.9-cp313-cp313-win_amd64.whl (15.2 MB view details)

Uploaded CPython 3.13Windows x86-64

teo-0.3.9-cp313-cp313-win32.whl (13.3 MB view details)

Uploaded CPython 3.13Windows x86

teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl (19.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl (17.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARMv7l

teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl (18.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl (14.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl (15.7 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file teo-0.3.9.tar.gz.

File metadata

  • Download URL: teo-0.3.9.tar.gz
  • Upload date:
  • Size: 160.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for teo-0.3.9.tar.gz
Algorithm Hash digest
SHA256 1c1b6735c83227b75236ba651be149878990ec7b83c19d79087e7a5a1ee09535
MD5 b805cdcb75f257fb9925b05692aaf659
BLAKE2b-256 2fa1371d94c14f6cafaaf0ad3cd9624c6713cedf3ee119ea0dd4959b3c1a336a

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313t-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 c0f079aa4decd1ec24ac00b610a7cd97a7c08d19302a908809a40480ab7b45d0
MD5 44a29b53847d31c26873988838bedb71
BLAKE2b-256 5f94e3b374d29949fe00f97ffb78f324bbdc275f29f50041aa09cc74df35241c

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b2ad5f56ba5f779b8bd9c6063f01d0efd6186e0e5fb9cab14b449d42db00af8c
MD5 7cf6eb9be911d57d94b6ad0d1606f8f1
BLAKE2b-256 069e6fc0723202413a7504edd741ea6ce3bf5af55fca5fba78927d133647133c

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: teo-0.3.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 15.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for teo-0.3.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fe52b2f91a2cfcf208be6fcf28e6a679bc4662c67b79f3f5e31641310bd53854
MD5 e0079276045ba740f8d60e7bc4a712a9
BLAKE2b-256 0029ff773ca517b7ef89d64f24a66badf583a0fc43ee95ebed5396cbb57f2a38

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-win32.whl.

File metadata

  • Download URL: teo-0.3.9-cp313-cp313-win32.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for teo-0.3.9-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 db22d1083c7f257c1134a3622fc88c56448562aa02f16f8d33d8776e7cfd0751
MD5 e3c6e283c08947cd8a89a92647763a75
BLAKE2b-256 8123c466977670a1732c152f048b8a653c89635feee5b410a98799a7d5c39f25

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 aa3fe88bd09b3e6dc1bb0afeba12ef9ee6d5aaaf1361b8d8656b88ca94701bed
MD5 aa9026e65a43b26e86b4ff35d5f85b4d
BLAKE2b-256 0fb94aaed404836efdd069654085ca2c2a515a6e823696148f03b241d9a55b85

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 36c974b440adca9a1cd5231ff348775428105d43e8def78aeb735b7ada5583c7
MD5 09013aa28236cc19e2adf315d6727ac3
BLAKE2b-256 91944e8b280d6737b30f6be4d4d4e457825f13df0c69a5ee40e69b1b3f2a6c88

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 01e066574d8b8d5b1ed037129d34d6ad795b0c41355f9292c1e05c265d183851
MD5 5438140d39eae074b98ca0beb8848780
BLAKE2b-256 0f62f1d21a3eff2fdcb1aaaf66de5ec10bfb08313835d7cc467c1556cdf93403

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fd5c02e0c1d18cc24c07fba27cbf09402355ba190dd76bf4f96bd4288a51873
MD5 32ec1b4b61d7fefab652fab6087ae0f2
BLAKE2b-256 72446be02666847c215869a881ef76b591deeff07c379320c93590d372507424

See more details on using hashes here.

File details

Details for the file teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for teo-0.3.9-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0c00909181b911b13dc5c25d6c740a682444cba45388b5c765119715331c3b93
MD5 deb2ee30aa93bd55cfab4738c8e19f01
BLAKE2b-256 16e3442b3cfe6caa7669763cc13b87457e88208d9cf290c35cac73c36bbef8dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page