Quickstart

Get your first zMesh project running in under 5 minutes.

1. Install the CLI

pip install zmesh-cli

2. Login

Authenticate with your zMesh account:

zmesh login

3. Create a Project

Initialize a new backend project:

zmesh init --name "My App"

This creates a project with its own PostgreSQL database, storage bucket, and API key.

4. Create a Table

Define your schema and push it:

-- schema.sql
CREATE TABLE posts (
  id SERIAL PRIMARY KEY,
  title TEXT NOT NULL,
  body TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW()
);
zmesh db push

5. Query via Auto REST API

Your table is instantly queryable via the PostgREST-style API:

# Insert a row
curl -X POST https://<your-subdomain>.zmesh.in/v1/rest/posts \
  -H "apikey: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"title": "Hello World", "body": "My first post"}'

# Query rows
curl https://<your-subdomain>.zmesh.in/v1/rest/posts \
  -H "apikey: <your-api-key>"

6. Deploy an Edge Function

Create a serverless function:

// hello.js
export default async function handler(req) {
  return new Response(JSON.stringify({ message: "Hello from zMesh!" }), {
    headers: { "Content-Type": "application/json" },
  });
}
zmesh functions deploy hello.js --name hello

7. Upload a File

zmesh storage upload ./photo.png --path avatars/

File is now available at https://assets.zmesh.in/<project>/avatars/photo.png

You now have a database, REST API, serverless function, and file storage — all in under 5 minutes. Explore the full feature docs to learn more.