Add web front-end and fix API issues
CI/CD Pipeline / test (push) Failing after 2m38s
CI/CD Pipeline / deploy-internal (push) Has been skipped

This commit is contained in:
chris committed 2026-08-28 21:47:05 -04:00
1 parent 45ca4de0ad
commit a7524412f0
2571 files changed
+86998 -5

No files matched your search

+2 -1
View File
@@ -1,10 +1,11 @@
{
"name": "book-test",
"name": "book-test api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node --import tsx --test \"src/**/*.test.ts\"",
"start": "tsx src/index.ts",
"db:migrate": "dotenv dbmate up"
},
"keywords": [],
+1 -1
View File
@@ -23,7 +23,7 @@ export function createCategoryRouter(repository: CategoryRepository): Router {
}
const flatRows = await repository.findAllDescendants(parentPath);
const nestedTree = buildCategoryTree(flatRows);
const nestedTree = flatRows.length > 0 ? buildCategoryTree(flatRows) : [];
res.json({ success: true, data: nestedTree });
} catch (error) {
+26
View File
@@ -0,0 +1,26 @@
// api/src/dev-seed.ts
import { Pool } from 'pg';
import { seedCategoryTable } from './test-seed.ts';
import process from 'node:process';
import { join } from 'node:path';
// Load environmental variables manually
try {
process.loadEnvFile(join(import.meta.dirname, '../.env'));
} catch (e) { }
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
async function run() {
console.log('🌱 Seeding local development database...');
try {
await seedCategoryTable(pool);
console.log('✅ Local database seeded successfully!');
} catch (error) {
console.error('❌ Seeding failed:', error);
} finally {
await pool.end();
}
}
run();
+9 -1
View File
@@ -2,13 +2,21 @@ import express from 'express';
import { Pool } from 'pg';
import { CategoryRepository } from './category.repository.ts';
import { createCategoryRouter } from './category.router.ts';
import { join } from 'node:path';
import process from 'node:process';
try {
process.loadEnvFile(join(import.meta.dirname, '../.env'));
} catch (e) {
console.warn('⚠️ API Warning: Could not locate local .env file natively.');
}
const app = express();
const port = process.env.API_PORT || 8300;
// Initialize your database pool
const pool = new Pool({
connectionString: process.env.DATABASE_URL
connectionString: process.env.DATABASE_URL || process.env.INTERNAL_PROD_DB_URL
});
app.use(express.json());