📦

MHT Inventory & Ledger MySQL REST API

Next.js App Router API with MySQL connection pooling, CORS enabled, and Hostinger ready.

MySQL Disconnected
📝 Enter Data (Form)

🗄️ Active MySQL Connection

Host:127.0.0.1Port:3306Database:inventory_dbMySQL Version:Detecting...

🚀 Hostinger Webhost Deployment

1. Import database.sql in Hostinger phpMyAdmin.
2. In Hostinger Node.js manager, set root folder to api.
3. Set environment variables from .env.example (DB_HOST, DB_USER, etc.).

★ CORS is enabled for all endpoints — your frontends can call this API directly!

API Endpoints

15 routes
GETDatabase Health Check
/api/health
POSTInitialize / Seed Database
/api/init-db
POSTUser Login
/api/auth/login
GETList Users
/api/auth/users
GETDashboard Analytics
/api/dashboard
GETList Inbound Batches
/api/inbound
POSTCreate Inbound Batch
/api/inbound
GETList Scans
/api/scans?limit=10
POSTRecord Stock Scan
/api/scans
GETList Damages
/api/damages
POSTRecord Damage
/api/damages
GETExpense Ledger
/api/expenses
POSTAdd Expense Voucher
/api/expenses
POSTOffline Sync Queue
/api/sync
GETExport CSV Report
/api/reports?type=scans&format=json
GET

Database Health Check

Ping MySQL database and check connection pool status

http://your-domain
Response
// Click "Send Request" to test this endpoint against your MySQL database