Quick Start

Get up and running with Query-2jz in 5 minutes.

5 Minutes

From installation to your first API call in under 5 minutes.

Zero Config

No complex setup. Just define your models and start building.

Auto-Generated

CRUD operations and types are automatically generated.

Step 1: Installation

Install Query-2jz CLI

bash
npm install -g query-2jz

Create New Project

bash
query-2jz init my-app
cd my-app

Step 2: Define Your Models

Edit the generated query-2jz.config.js file to define your data models.

javascript
// query-2jz.config.js
module.exports = {
  database: {
    type: 'sqlite',
    connection: './database.sqlite'
  },
  models: [
    {
      name: 'User',
      fields: {
        id: { type: 'id' },
        name: { type: 'string', required: true },
        email: { type: 'string', required: true, unique: true },
        posts: { type: 'relation', model: 'Post', many: true }
      }
    },
    {
      name: 'Post',
      fields: {
        id: { type: 'id' },
        title: { type: 'string', required: true },
        content: { type: 'string' },
        authorId: { type: 'string', required: true },
        author: { type: 'relation', model: 'User' }
      }
    }
  ]
}

Step 3: Start the Server

bash
query-2jz dev
Server Started!

Your API is now available at http://localhost:3000

Step 4: Test Your API

Your API endpoints are automatically generated. Let's test them:

Query Users

GET
GET /api/query-2jz/User

Retrieve all users with their posts

Create User

POST
POST /api/query-2jz/User

Create a new user with name and email

Step 5: Generate Types

Generate TypeScript types for your models and operations.

bash
query-2jz generate-types
typescript
// Generated types in ./generated/models.ts
export interface User {
  id: string;
  name: string;
  email: string;
  posts?: Post[];
}

export interface Post {
  id: string;
  title: string;
  content: string;
  authorId: string;
  author?: User;
}

What's Next?

You're all set! Here are some next steps to explore Query-2jz's features:

Learn Core Concepts

Understand models, queries, mutations, and more

Try the Playground

Experiment with Query-2jz in your browser

Framework Integration

Learn how to integrate with your favorite framework

Advanced Features

Explore caching, real-time, and performance features

Quick Start Checklist

Install Query-2jz CLI
Create new project
Define your models
Start development server
Test your API endpoints
Generate TypeScript types