MySQL data layer: accounts, sessions, campaigns, burns (Marty: real concurrency)

Coolify MySQL (instantadpay-db) via DATABASE_URL; db.js bootstraps schema
and one-time imports the volume JSON. accounts/auth/ads are dual-mode: the
MySQL path uses guarded UPDATEs for the concurrent ad-serving hot path;
without DATABASE_URL the JSON stores remain (local dev). All data functions
async; server boots through db.init. Chain index stays a file: it is a
rebuildable cache of the blockchain, which remains the money truth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-04 14:13:37 -05:00
parent f3d2f7db88
commit 6680e154d0
7 changed files with 616 additions and 333 deletions
+2 -1
View File
@@ -5,5 +5,6 @@
"description": "InstantAdPay membership advertising site - immutable on-chain settlement, transparent ledger.",
"main": "server.js",
"scripts": {"start": "node server.js", "dev": "node --watch server.js"},
"engines": {"node": ">=20"}
"engines": {"node": ">=20"},
"dependencies": {"mysql2": "^3.11.0"}
}