Convex Backend

repository·main·Indexed 10 days ago

https://github.com/get-convex/convex-backend

An open-source reactive database for web developers and LLMs, featuring a database, server function environment, and client libraries. Includes the official Convex Rust client, Fivetran source and destination connectors, and the LoadGenerator benchmarking tool.

Tokens
413.2K
Snippets
1.3K
Records
1.9K
Agent score
92%

What's inside Convex

  1. Overview of Scheduling in Convex

    main

    Convex provides two primary ways to schedule functions to run at specific times or on a recurring basis, enabling the creation of durable workflows (e.g., sending delayed emails or performing periodic account reconciliations).

    • Scheduled Functions: Allows any function to durably schedule another function to run once at a specific point in the future (minutes, days, or months).
    • Cron Jobs: Used to schedule functions to run on a recurring schedule (e.g., daily or hourly).
  2. What is Convex?

    main

    Convex is an open source, reactive database where queries are written as TypeScript code that runs directly within the database.

    Key characteristics:

    • Reactive Queries: Much like React components react to state changes, Convex queries automatically react to database changes.
    • Integrated Backend: Convex provides the database, a runtime for server functions, and client libraries in a single platform.
    • Live-Updating: It is designed to make building and scaling dynamic, live-updating applications straightforward.
  3. Overview of Convex Team Management features

    main

    Convex provides administrative features to control how members access your team, projects, and deployments. Key capabilities include:

    • Single Sign-On (SSO): Authenticate team members through your organization's identity provider.
    • Custom Roles: Define fine-grained permission policies that extend beyond the standard built-in roles.
    • Role Actions: Manage specific permissions granted by roles to control what users can do within the platform.

    For details on the standard built-in team and project roles, refer to the 'Roles and permissions' section in the Convex dashboard documentation.

  4. Overview of LoadGenerator

    main

    LoadGenerator is a load testing and benchmarking tool used to evaluate Convex performance. It measures function latency, throughput, and system stability under various load patterns.

    Core Workflow:

    1. Provisioning: Connects to a new or existing Convex instance.
    2. Execution: Sends predefined or custom scenarios to the ScenarioRunner.
    3. Collection: Gathers performance metrics from executed scenarios.
    4. Reporting: Generates detailed statistics reports with latency metrics and can optionally export metrics to monitoring systems like Datadog.
  5. Overview of the Users and Authentication Example App

    main

    This application demonstrates a complete authentication flow for a chat app using Clerk:

    • Authentication: Users start with a "Log In" button.
    • User Persistence: Upon successful login, user information is automatically persisted to a users table.
    • Data Association: Messages sent by users are associated with their respective user records.
    • Session Management: Users can terminate their session using a "Log Out" button.
  6. Overview of the WorkOS + TanStack Start demo

    main

    This demo is designed to test WorkOS AuthKit provisioning flows using the Convex CLI. It specifically validates the following workflows:

    • Creating an associated WorkOS team and disconnecting that team.
    • Provisioning an AuthKit environment across dev, preview, and production environments when a deployment does not already have one.
    • Configuring the AuthKit environment and setting local environment variables during dev or deploy processes.
  7. Use the Convex management APIs via @convex-dev/platform

    main
    The @convex-dev/platform package provides a client wrapper for interacting with Convex management APIs. It allows you to programmatically manage your Convex infrastructure by accessing both the centralized management APIs (available at https://api.convex.dev/v1/openapi.json) and the deployment-specific APIs available on every individual Convex backend.
  8. Understand the Convex Deployment API surface

    main

    A Convex deployment exposes three distinct types of interfaces:

    1. Custom Functions: The public interface of your specific deployment is defined by the functions you write in your convex/ folder.
    2. Public HTTP Endpoints: Every deployment includes custom endpoints defined via HTTP Actions and a standard public HTTP API.
    3. Platform APIs: Private endpoints available only to deployment administrators for managing the deployment itself.

    To interact with the Platform APIs programmatically, use the @convex-dev/platform package.