Type-safe Appwrite ORM

Build with
Type Safety

A powerful TypeScript ORM for Appwrite with automatic migrations, schema validation, and join support. Works seamlessly in both server and client environments.

npm install appwrite-orm node-appwrite
orm-setup.ts
import { ServerORM } from 'appwrite-orm/server';

const orm = new ServerORM({
  endpoint: process.env.APPWRITE_ENDPOINT!,
  projectId: process.env.APPWRITE_PROJECT_ID!,
  databaseId: process.env.APPWRITE_DATABASE_ID!,
  apiKey: process.env.APPWRITE_API_KEY!,
  autoMigrate: true
});

const db = await orm.init([{
  name: 'users',
  schema: {
    name: { type: 'string', required: true },
    email: { type: 'string', required: true },
    age: { type: 'integer', min: 0 }
  },
  indexes: [
    { key: 'email_idx', type: 'unique', 
      attributes: ['email'] }
  ]
}]);

const user = await db.table('users').create({
  name: 'John Doe',
  email: 'john@example.com',
  age: 30
});

Everything you need

Powerful features for modern application development

Type-Safe ORM

Full TypeScript support with automatic type inference for your Appwrite collections

Auto Migrations

Automatic schema synchronization and index creation without manual intervention

Caching

Built in caching system for web and servers

Custom MCP server

A custom MCP server, so your AI model doesn't make stuff up about Appwrite-ORM

Development Mode

Use the ORM in web clients with cookie-based storage for easy local development

Export database

Built in functions to export your database to SQL, firebase rules, etc

New Features

Latest additions in the current version (0.3.1)

  • Export to SQL / Firebase / Text

    Migrations from Appwrite to SQL, Firebase and text. So you're never stuck on 1 of these

    Built in caching

    A simple, built-in caching system using appwrite listeners

Future Plans

Exciting features coming soon

  • Optimize code quality, security and optimize for production
  • Better error handling
  • Make the code battle ready for production

Ready to build something amazing?

Get started with Appwrite ORM today and experience the power of type-safe database operations.