- Implement PostgreSQL database schema with users and bookmarks tables - Add database connection pooling with retry logic and error handling - Create migration system with automatic schema initialization - Add database CLI tools for management (init, status, validate, etc.) - Include comprehensive error handling and diagnostics - Add development seed data and testing utilities - Implement health monitoring and connection pool statistics - Create detailed documentation and troubleshooting guide Database features: - Users table with authentication fields and email verification - Bookmarks table with user association and metadata - Proper indexes for performance optimization - Automatic timestamp triggers - Transaction support with rollback handling - Connection pooling (20 max connections, 30s idle timeout) - Graceful shutdown handling CLI commands available: - npm run db:init - Initialize database - npm run db:status - Check database status - npm run db:validate - Validate schema - npm run db:test - Run database tests - npm run db:diagnostics - Full diagnostics
37 lines
955 B
JSON
37 lines
955 B
JSON
{
|
|
"name": "backend",
|
|
"version": "1.0.0",
|
|
"description": "",
|
|
"main": "index.js",
|
|
"scripts": {
|
|
"start": "node server.js",
|
|
"dev": "nodemon server.js",
|
|
"test": "node test-db-setup.js",
|
|
"db:init": "node scripts/db-cli.js init",
|
|
"db:status": "node scripts/db-cli.js status",
|
|
"db:reset": "node scripts/db-cli.js reset",
|
|
"db:validate": "node scripts/db-cli.js validate",
|
|
"db:cleanup": "node scripts/db-cli.js cleanup",
|
|
"db:diagnostics": "node scripts/db-cli.js diagnostics",
|
|
"db:test": "node test-db-setup.js"
|
|
},
|
|
"keywords": [],
|
|
"author": "",
|
|
"license": "ISC",
|
|
"type": "commonjs",
|
|
"dependencies": {
|
|
"bcrypt": "^6.0.0",
|
|
"cookie-parser": "^1.4.7",
|
|
"dotenv": "^17.2.0",
|
|
"express": "^5.1.0",
|
|
"express-rate-limit": "^8.0.1",
|
|
"helmet": "^8.1.0",
|
|
"jsonwebtoken": "^9.0.2",
|
|
"nodemailer": "^7.0.5",
|
|
"pg": "^8.16.3"
|
|
},
|
|
"devDependencies": {
|
|
"nodemon": "^3.1.10"
|
|
}
|
|
}
|