SQLite best practices for Node.js with better-sqlite3 — WAL mode, pragmas, foreign keys, STRICT tables, transactions, migrations, graceful shutdown, and query patterns
97
98%
Does it follow best practices?
Impact
96%
1.65xAverage score across 5 eval scenarios
Passed
No known issues
A local coffee shop needs a backend API for their ordering system. Build it with Node.js, TypeScript, and Express. Use SQLite as the database (the shop runs everything on a single server).
The system needs to support:
Produce:
src/db.ts — Database connection and schema setupsrc/routes/menu.ts — Menu item CRUD routessrc/routes/orders.ts — Order routessrc/index.ts — Express app setuppackage.json — With required dependenciesThe code should be complete TypeScript with no placeholders or TODO comments.