Add PostgreSQL schema and migration runner

All tables per PRD data model with default config seeds.
Migration runner tracks applied migrations in DB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:03:57 -04:00
parent 83abac52f6
commit adebe10f52
4 changed files with 156 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ const express = require('express');
const cors = require('cors');
const path = require('path');
const healthRouter = require('./routes/health');
const db = require('./db');
const app = express();
const PORT = process.env.PORT || 3000;
@@ -22,6 +23,9 @@ app.get('*', (req, res) => {
res.sendFile(path.join(clientDist, 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
(async () => {
await db.initialize();
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
})();