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 🙏

© 2026 – Pkg Stats / Ryan Hefner

reflective-backend

v1.0.5

Published

A dynamic MySQL REST backend (reflective, zero-config)

Downloads

7

Readme

Reflective Backend

Reflective Backend is a zero-config, dynamic REST backend for any MySQL-compatible database. It lets you interact with your data instantly via standard HTTP requests, using real-time schema introspection.

Developed with support from OpenAI's GPT-4, guided by a reevy mindset.

Features

  • Auto-generates endpoints for all tables
  • Reflects schema using DESCRIBE – no hardcoded logic
  • Supports full CRUD:
    • GET /api/:table (with where, orderby, limit)
    • POST /api/:table
    • PUT /api/:table/:id
    • DELETE /api/:table/:id
  • Handles “dirty URLs” (non-standard query formats)
  • Configurable via environment variables

Getting Started

1. Install

npm install reflective-backend

Or clone manually:

git clone https://github.com/Cruftcam/reflective-backend.git
cd reflective-backend
npm install

2. Configure your database connection

You can either edit directly in reflective-backend.js or use environment variables:

DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=your_database

3. Run the server

node reflective-backend.js

The server will start at: http://localhost:5000

Example API Usage (with fetch)

You can use any table name from your MySQL database in the :table placeholder.

🔹 GET all records from a table

fetch("http://localhost:5000/api/film")
  .then(res => res.json())
  .then(console.log);

🔹 GET with WHERE + LIMIT

fetch("http://localhost:5000/api/film?where=rating='PG'&limit=5")
  .then(res => res.json())
  .then(console.log);

🔹 POST new record

fetch("http://localhost:5000/api/category", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    name: "Example Category",
    last_update: new Date().toISOString()
  })
});

🔹 PUT update a record

fetch("http://localhost:5000/api/category/2", {
  method: "PUT",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name: "Updated Category" })
});

🔹 DELETE a record

fetch("http://localhost:5000/api/category/2", {
  method: "DELETE"
});

Notes

  • Automatically determines the table’s primary key for updates and deletions.

  • Designed for internal development use — use with care in production.

  • Great for dashboards, editors, internal tools, or scaffolding apps

  • Built with Express, MySQL2, CORS

License

Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)

This software is free to use for non-commercial projects. You must give credit to the original author. For commercial use, please contact the author.

Credits

This tool was developed using OpenAI's GPT-based assistant and published with appreciation for all contributors behind open source libraries like express, cors and mysql2.

Author

Developed with ❤️ & 🍺 in Bavaria by Stefan aka crufty from Cruftcam.com

❤️ Contributions

Contributions, issues and feedback welcome. If you improve it, fork it and send a pull request!