Installation

Get Query-2jz up and running in your project in minutes.

Prerequisites

Node.js

Node.js 18.0.0 or higher is required.

npm/yarn

Package manager for installing dependencies.

Database

SQLite, PostgreSQL, MySQL, or MongoDB.

Installation Methods

Method 1: Using the CLI (Recommended)

The easiest way to get started is using our CLI tool to initialize a new project.

bash
# Install Query-2jz CLI globally
npm install -g query-2jz
bash
# Create a new project
cd my-app
bash
# Install dependencies
npm install
bash
# Start development server
query-2jz dev

Method 2: Manual Installation

Install Query-2jz manually in your existing project.

bash
# Install Query-2jz
npm install query-2jz
bash
# Or with yarn
yarn add query-2jz
bash
# Or with pnpm
pnpm add query-2jz

Database Setup

Choose your database and configure the connection.

SQLite (Development)

Perfect for development and small applications

javascript
// query-2jz.config.js
module.exports = {
  database: {
    type: 'sqlite',
    connection: './database.sqlite'
  }
}

PostgreSQL (Production)

Recommended for production applications

javascript
// query-2jz.config.js
module.exports = {
  database: {
    type: 'postgresql',
    connection: process.env.DATABASE_URL
  }
}

MySQL

Great for web applications

javascript
// query-2jz.config.js
module.exports = {
  database: {
    type: 'mysql',
    connection: {
      host: 'localhost',
      user: 'root',
      password: 'password',
      database: 'myapp'
    }
  }
}

MongoDB

Perfect for document-based applications

javascript
// query-2jz.config.js
module.exports = {
  database: {
    type: 'mongodb',
    connection: process.env.MONGODB_URI
  }
}

Framework Integration

Query-2jz works with all major Node.js frameworks. Choose your preferred framework:

Express.js

Most popular Node.js framework

Next.js

React framework with API routes

Fastify

Fast and low overhead framework

Koa

Expressive middleware framework

NestJS

Enterprise-grade framework

Hapi

Rich framework for building APIs

Verification

Verify your installation by running a simple test.

bash
# Check Query-2jz version
query-2jz --version

# Test the installation
query-2jz init test-project
cd test-project
query-2jz dev

# You should see:
# 🚀 Query-2jz server running at http://localhost:3000
# Available endpoints:
#   GET  /api/query-2jz/:model     - Query data
#   POST /api/query-2jz/:model     - Mutate data
#   GET  /health              - Health check

Next Steps

Quick Start Guide

Learn the basics of Query-2jz in 5 minutes

Configuration

Learn how to configure Query-2jz for your needs