Custom Modules & BYODB

Visually model your database, generate type-safe endpoints, or hook up your own PostgreSQL/Supabase database.

Axolot CMS provides a flexible, developer-first Custom Module Engine. When standard modules like Blogs or Shops are not enough, you can define your own database schemas directly from the visual dashboard and consume them with full type-safety.

How to Create a Custom Module

Building a custom content structure takes three simple steps:

  1. Visually define columns: Go to the sidebar in the Axolot Dashboard, click + Añadir Módulo, and select Módulo Personalizado. Set your module identifier (e.g., real_estate) and add columns like title (text), price (integer), or features (jsonb).
  2. Database Schema Generation: Upon saving, the backend automatically performs a migration to create the table under your isolated site schema:
    CREATE TABLE site_123.real_estate (
      id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
      title text NOT NULL,
      price integer NOT NULL,
      features jsonb DEFAULT '{}'
    );
  3. Bring Your Own Database (BYODB): If you want full control or want to query your own existing PostgreSQL cluster (like Supabase, AWS RDS, or Render), head to Settings -> Database and input your DB Connection String. Axolot will route all custom module queries directly to your database cluster.

Querying Custom Tables via the SDK

The Axolot SDK exposes a thin, Drizzle-inspired query builder. You can fetch records in your Astro components with full TypeScript autocomplete:

import { axolot } from '@axolot/sdk';

// Fetch all custom properties priced under $500k
const properties = await axolot.query('real_estate').findMany({
  where: {
    price: { lt: 500000 }
  },
  orderBy: { title: 'asc' }
});

AI Assistant Integration

When you create a custom module, its schema details are dynamically registered in the AI Assistant Registry. This means the Copilot immediately learns the table name and columns, allowing you to ask questions like: "Add a section to list the real estate properties by price". The AI will write the correct Astro syntax using the SDK query.

Enterprise Scale: Because each custom module data is isolated at the database level, queries perform at native PostgreSQL speeds with zero overhead from typical headless CMS layers.