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.
- Auto-generates endpoints for all tables
- Reflects schema using
DESCRIBE
– no hardcoded logic - Supports full CRUD:
GET /api/:table
(withwhere
,orderby
,limit
)POST /api/:table
PUT /api/:table/:id
DELETE /api/:table/:id
- Handles “dirty URLs” (non-standard query formats)
- Configurable via environment variables
npm install reflective-backend
Or clone manually:
git clone https://github.com/Cruftcam/reflective-backend.git
cd reflective-backend
npm install
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
node reflective-backend.js
The server will start at: http://localhost:5000
You can use any table name from your MySQL database in the :table placeholder.
fetch("http://localhost:5000/api/film")
.then(res => res.json())
.then(console.log);
fetch("http://localhost:5000/api/film?where=rating='PG'&limit=5")
.then(res => res.json())
.then(console.log);
fetch("http://localhost:5000/api/category", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: "Example Category",
last_update: new Date().toISOString()
})
});
fetch("http://localhost:5000/api/category/2", {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name: "Updated Category" })
});
fetch("http://localhost:5000/api/category/2", {
method: "DELETE"
});
-
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
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.
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
.
Developed with ❤️ & 🍺 in Bavaria by Stefan aka crufty from Cruftcam.com
Contributions, issues and feedback welcome. If you improve it, fork it and send a pull request!