Backed byY Combinator

All-in-one TypeScript Platform for Startups

Ship production AI apps 10x faster with built-in auth, database and LLM integration

Get Started

Backend Focused

Either add Modelence to an existing Next.js project or set up from scratch using the built-in Vite + React frontend.

MongoDB Data Models

Define your schema and indexes along with your collection in one place, then store and retrieve data anywhere in your code.

Authentication

Ready-to-use user system in your own database, with provided login, signup and logout methods, password hashing and management.

Works with

TypeScript
React
Vite
Next.js
MongoDB
OpenAI

Build full-stack apps in minutes

import { Store, Module, schema } from 'modelence/server';
import { dbTodos } from './store';

export const dbTodos = new Store('todos', {
  schema: {
    title: schema.string(),
    isCompleted: schema.boolean(),
    userId: schema.ref('users'),
    createdAt: schema.date(),
  },
  indexes: [
    { key: { userId: 1, createdAt: -1 } },
    { key: { isCompleted: 1 } },
  ],
});

export default new Module('todos', {
  stores: [dbTodos],
  
  queries: {
    async getAll(args, { user }) {
      return await dbTodos.fetch({
        userId: user.id
      }).sort({ createdAt: -1 });
    }
  },

  mutations: {
    async create({ title }, { user }) {
      const { insertedId } = await dbTodos.insertOne({
        title,
        isCompleted: false,
        userId: user.id,
        createdAt: new Date()
      });
      return insertedId;
    },
  }
});

Live Demo

Build landing page
Add interactive demo
Deploy to production

Database: todos

3 documents
_id: ObjectId("66d5f1a7bcf86cd799e3e000")
title: "Build landing page"
isCompleted: true
userId: ObjectId("507f1f77bcf86cd799e3a42")
createdAt: 2025-01-15T10:30:00.000Z
_id: ObjectId("66d5f1a7bcf86cd799e3e001")
title: "Add interactive demo"
isCompleted: false
userId: ObjectId("507f1f77bcf86cd799e3a42")
createdAt: 2025-01-16T10:30:00.000Z
_id: ObjectId("66d5f1a7bcf86cd799e3e002")
title: "Deploy to production"
isCompleted: false
userId: ObjectId("507f1f77bcf86cd799e3a42")
createdAt: 2025-01-17T10:30:00.000Z

Built for modern AI apps

Complete toolkit for building and running production-ready AI agents.

LLM Integration

Effortlessly connect to OpenAI, Anthropic, Google Gemini and other models with built-in API key management.

AI Observability

Get instant visibility into every LLM and AI agent action with automatic tracing, error tracking, and real-time metrics.

Agentic Workflows

Build persistent, stateful AI agents with built-in cron jobs, background workers, and a modular system for scheduling at scale.

AI monitoring dashboard showing recent prompt runs with tokens, duration, and model information
AI integrations dashboard showing OpenAI, Anthropic, and Gemini configurations

Use the AI SDK to call any LLM provider, with built-in API keys and observability

import { generateText } from '@modelence/ai';

const response = await generateText({
  provider: 'openai',
  model: 'gpt-4o',
  messages: [{
    role: 'user',
    content: 'Hi there'
  }]
});

Define cron jobs by simply passing a handler function, with intervals as short as one second

import { Module, time } from 'modelence/server';

export default new Module('todo', {
  stores: [dbTodos],
  cronJobs: {
    sendReminders: {
      description: 'Send reminders for overdue todos',
      interval: time.hours(24),
      async handler() {
        const overdueTodos = await dbTodos.fetch({
          isCompleted: false,
          dueDate: { $lt: new Date() }
        });
        overdueTodos.forEach(todo => {
          // Send reminder email
        });
      }
    }
  }
});

Built-in observability

Every method call and cron job comes with built-in telemetry by default

Monitoring performance dashboard

Cron Jobs

Simply define a handler function and it will run at your specified time interval, with sub-second precision and cron job orchestration for multiple application instances.

Data Loading

Define queries and mutations to send and retrieve data between the client and server. Use React hooks on the client to fetch data, handle errors and loading state with a single statement.

Telemetry

All cron jobs and method calls are automatically logged and traced, so you can see full insights in your application's performance dashboard in Modelence Cloud.

App Configuration

Define dynamic app configuration values, and call getConfig on both client & server to use your configuration values anywhere in your code.

Database Migrations

Seamless migration scripts and versioning support to manage your database structure changes in multiple environments without any manual steps.

Type-Safe Development

End-to-end TypeScript support with automatic type inference for your data models, methods and database queries.