Fix: Stable Prisma 6 setup, database seeding, and routing improvements

This commit is contained in:
Quintine committed 2026-05-20 13:38:01 +10:00
1 parent eed1ef4266
commit 108184ba68
8 files changed
+680 -868

No files matched your search

+601 -850
View File
File diff suppressed because it is too large. Load diff
+5 -2
View File
@@ -13,16 +13,19 @@
"license": "ISC",
"type": "commonjs",
"dependencies": {
"@prisma/client": "^7.8.0",
"@prisma/adapter-better-sqlite3": "^7.8.0",
"@prisma/client": "^6.19.3",
"better-sqlite3": "^12.10.0",
"cors": "^2.8.6",
"dotenv": "^17.4.2",
"express": "^5.2.1"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/node": "^25.9.1",
"prisma": "^7.8.0",
"prisma": "^6.19.3",
"ts-node-dev": "^2.0.0",
"typescript": "^6.0.3"
}
-14
View File
@@ -1,14 +0,0 @@
// This file was generated by Prisma, and assumes you have installed the following:
// npm install --save-dev prisma dotenv
import "dotenv/config";
import { defineConfig } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
},
datasource: {
url: process.env["DATABASE_URL"],
},
});
+1
View File
@@ -7,6 +7,7 @@ generator client {
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model StockItem {
+1 -2
View File
@@ -159,8 +159,7 @@ app.post('/api/reset', async (req, res) => {
const frontendPath = path.join(__dirname, '../../frontend/dist');
app.use(express.static(frontendPath));
app.get('*', (req, res) => {
if (req.path.startsWith('/api')) return;
app.get(/^\/(?!api).*/, (req, res) => {
res.sendFile(path.join(frontendPath, 'index.html'));
});