npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

quick-n-easy-api

v0.1.0

Published

API utilities for quick-n-easy applications

Readme

Quick-n-Easy API: Complete CRUD API with Admin UI in Minutes

Why Does Python Have All the Easy Tools?

Ever wondered why Python has Django, FastAPI, and other frameworks that make building APIs with admin interfaces so simple? Well, now JavaScript has its answer: Quick-n-Easy API provides the same rapid development experience for JS developers.

🚀 Features

  • Complete CRUD API: Automatically generates RESTful endpoints for your data models
  • Admin UI: Built-in admin interface to manage your data without writing a single line of code
  • Documentation: Auto-generated API documentation to help you and your team
  • Authentication: Simple authentication with minimal configuration
  • ORM Integration: Seamless integration with quick-n-easy-orm for database operations
  • Framework Agnostic: Works with any JavaScript framework (built on Hono)

📦 Installation

npm install quick-n-easy-api

🎮 Quick Start

Get a complete API with admin interface up and running in minutes:

import { DatabaseDeclaration, QuickNEasyORM } from "quick-n-easy-orm/quickNEasyOrm";
import { createDB } from "quick-n-easy-orm/shims/bunSqliteShim";
import { Hono } from 'hono';
import { QuickNEasyAPI } from "quick-n-easy-api";

// Create a Hono app
const app = new Hono();

// Define your database schema
const dbDeclaration: DatabaseDeclaration = {
    post: {
        title: "text",
        body: "long text",
        author: { type: "one-to-one", ref: "user" },
        image: "image",
    },
    user: {
        email: "text",
        password: "text",
        posts: { type: "one-to-many", ref: "post" },
    }
};

// Initialize the database and ORM
const db = createDB(":memory:");
const orm = new QuickNEasyORM(db, dbDeclaration);

// Create a user for testing
await orm.insert("user", { email: "[email protected]", password: "password123" });

// Initialize the API with basic authentication
const api = new QuickNEasyAPI(
    app, 
    dbDeclaration, 
    (c) => orm,
    "securePassword" // Optional: Add password protection
);
// Add your custom routes if needed
app.get('/', (c) => c.text('Welcome to my API!'));

export default app;

Or with cloudflare D1

import { DatabaseDeclaration, QuickNEasyORM } from "quick-n-easy-orm/quickNEasyOrm";
import { Hono } from 'hono';
import { QuickNEasyAPI } from "quick-n-easy-api";

import { createDB } from "quick-n-easy-orm/shims/d1Shim";

const app = new Hono<{ Bindings: Bindings }>()
const dbDeclaration: DatabaseDeclaration = {
    post: {
        title: "text",
        body: "long text",
        author: { type: "one-to-one", ref: "user" },
        image: "image",
    },
    user: {
        email: "text",
        password: "text",
        posts: { type: "one-to-many", ref: "post" },
    }
};

const api = new QuickNEasyAPI(
    app, 
    dbDeclaration, 
    (c) => {
        const db = createDB(c.env.DB)
        const orm = new QuickNEasyORM(db, dbDeclaration);
        return orm
    },
    "securePassword" // Optional: Add password protection
);


// Add your custom routes if needed
app.get('/', (c) => c.text('Welcome to my API!'));

export default app;

🔐 Authentication

Adding basic authentication is as simple as providing a password:

const api = new QuickNEasyAPI(
    app, 
    dbDeclaration, 
    (c) => orm,
    "yourSecurePassword" // Add password protection
);

By default, the username is set to "admin", but you can customize it:

const api = new QuickNEasyAPI(
    app, 
    dbDeclaration, 
    (c) => orm,
    "yourSecurePassword", // Password
    "customUsername"      // Custom username
);

🌐 Generated Endpoints

For each model in your database declaration, the following RESTful endpoints are automatically created:

  • GET /api/{model} - List all records
  • POST /api/{model} - Create a new record
  • GET /api/{model}/:id - Get a single record
  • PUT /api/{model}/:id - Update a record
  • DELETE /api/{model}/:id - Delete a record

📊 Admin UI

Access your admin interface at /admin to manage your data with a user-friendly interface. No additional configuration required! Admin UI Admin UI

📚 API Documentation

Auto-generated API documentation is available at /api to help you understand and use your API endpoints. API Documentation

🔄 Integration with Quick-n-Easy Ecosystem

This library is designed to work seamlessly with other Quick-n-Easy packages:

  • quick-n-easy-orm: For database operations
  • quick-n-easy-inputs: For form generation

When used together, these packages provide a complete solution for rapidly building web applications with minimal effort.

🤔 Why Use Quick-n-Easy API?

  • Rapid Development: Go from idea to working API in minutes
  • Zero Configuration: No complex setup or boilerplate code
  • Full-Featured: Get CRUD operations, admin UI, and documentation out of the box
  • JavaScript Native: Built for JavaScript/TypeScript developers

Stop envying Python developers - now JavaScript has its own quick and easy solution for building APIs with admin interfaces!