feat: enhance database environment handling and cleanup project
Some checks failed
Deploy to Vercel / deploy (push) Has been cancelled
Deploy to Railway / deploy (push) Has been cancelled

- Add environment-specific database selection (SQLite for local, MariaDB for NAS)
- Remove edit button from admin detail view modal for cleaner UX
- Clean up project files: remove redundant docs and test files
- Update deployment script with improved SSH handling
- Maintain backward compatibility while supporting both database types

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-25 13:13:19 +09:00
parent 896e42d9cc
commit ed5fa15814
9 changed files with 66 additions and 524 deletions

View File

@@ -6,12 +6,26 @@ const fs = require('fs');
const bcrypt = require('bcrypt');
const session = require('express-session');
const { v4: uuidv4 } = require('uuid');
const DatabaseHelper = require('./database/db-helper');
// 환경에 따른 데이터베이스 헬퍼 선택
const isNAS = process.env.NODE_ENV === 'production' || process.env.DEPLOY_ENV === 'nas';
const isWindows = process.platform === 'win32' && !isNAS;
let DatabaseHelper;
if (isNAS) {
DatabaseHelper = require('./database/mariadb-helper');
console.log('🗄️ NAS 환경: MariaDB 사용');
} else if (isWindows) {
DatabaseHelper = require('./database/db-helper');
console.log('🗄️ 로컬 Windows 환경: SQLite 사용');
} else {
DatabaseHelper = require('./database/mariadb-helper');
console.log('🗄️ Linux 환경: MariaDB 사용');
}
const app = express();
const PORT = process.env.PORT || 3005;
// 데이터베이스 헬퍼 인스턴스 (SQLite - 로컬 테스트용)
// 데이터베이스 헬퍼 인스턴스
const db = new DatabaseHelper();
// 미들웨어 설정