Refactor monolithic modules and harden booking, email, and auth infrastructure.
Split oversized frontend API client, email service, and admin/booking pages into focused modules while preserving import surfaces, and add Redis-backed queues, stale booking cleanup, stronger auth, and scale deployment configs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,8 +12,11 @@ const dbType = process.env.DB_TYPE || 'sqlite';
|
||||
let db: ReturnType<typeof drizzleSqlite> | ReturnType<typeof drizzlePg>;
|
||||
|
||||
if (dbType === 'postgres') {
|
||||
// Cap connections per instance so that, when running multiple replicas,
|
||||
// DB_POOL_MAX * replicas stays below the Postgres max_connections limit.
|
||||
const pool = new pg.Pool({
|
||||
connectionString: process.env.DATABASE_URL || 'postgresql://localhost:5432/spanglish',
|
||||
max: Number(process.env.DB_POOL_MAX || 10),
|
||||
});
|
||||
db = drizzlePg(pool, { schema });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user