Skip to main content

Introduction

Rocket API Framework Logo

Rocket is a configuration-driven API framework designed to accelerate backend development by automating standard engineering tasks. By defining models in a structured JSON format, Rocket automatically handles database schema generation, RESTful routing, request validation, and interactive documentation.

Features​

  • Automated API Generation: Instant creation of CRUD, Search, and Aggregate endpoints from JSON configurations.
  • Database Schema Management: Automatic handling of table creation, multi-column indexes, and foreign key constraints.
  • Multi-Engine Database Support: Native support for both PostgreSQL and SQLite.
  • Interactive Documentation: Integrated Swagger/OpenAPI UI available at the specified documented path.
  • Robust Validation: Driven by AJV (JSON Schema) for strict and customizable request validation.
  • Advanced Querying: Native support for filtering, sorting, and complex search operations.

Quick Start​

1. Installation​

Clone the repository and install dependencies:

git clone https://github.com/imdeepmind/rocket.git
cd rocket
npm install

2. Initialize the Server​

Start the server using an existing configuration file:

npm run dev -- -c example_config.json

3. API Exploration​

Once the server is initialized, refer to the Swagger UI for interactive API documentation: http://localhost:3000/api/docs

01 Barebone Configuration​

The smallest config that boots a working API needs only an application name and one model:

{
"application": { "name": "Barebone API" },
"data": {
"models": {
"notes": {
"fields": {
"id": { "type": "integer", "primaryKey": true, "autoIncrement": true },
"title": { "type": "string", "nullable": false },
"body": { "type": "text", "nullable": true }
}
}
}
}
}
npm run dev -- -c examples/01-barebone/barebone_config.json

The single model exposes POST /api/v1/notes/, GET /api/v1/notes/, GET /api/v1/notes/id/:id, GET /api/v1/notes/search/title, PATCH/PUT /api/v1/notes/title/:title, and PATCH/DELETE /api/v1/notes/status/:status on a dev SQLite database, with Swagger at /docs.

Configuration defaults​

Rocket resolves your configuration before validating it. Only application.name and data.models are required — omitted sections receive defaults:

  • docs are enabled in dev and disabled in prod
  • the dev database defaults to SQLite (./database.db); prod requires infrastructure.database
  • the cache defaults to in-memory; Redis is only used when configured
  • authentication defaults to disabled
  • rate limiting defaults to disabled (100 requests / 1m)
  • CORS defaults to disabled
  • the API variant defaults to v1

Inspect the fully resolved configuration (with secrets redacted) before starting the server:

npm run dev -- -c config.json --print-config

Technology Stack​

  • Runtime: Node.js
  • Framework: Fastify
  • Architecture: TypeScript
  • Database: PostgreSQL and SQLite
  • Validation: AJV
  • Documentation: Swagger / OpenAPI
  • Testing: Vitest