🚀 Korea Tourism Agency - Complete implementation
✨ Features: - Modern tourism website with responsive design - AdminJS admin panel with image editor integration - PostgreSQL database with comprehensive schema - Docker containerization - Image upload and gallery management 🛠 Tech Stack: - Backend: Node.js + Express.js - Database: PostgreSQL 13+ - Frontend: HTML/CSS/JS with responsive design - Admin: AdminJS with custom components - Deployment: Docker + Docker Compose - Image Processing: Sharp with optimization 📱 Admin Features: - Routes/Tours management (city, mountain, fishing) - Guides profiles with specializations - Articles and blog system - Image editor with upload/gallery/URL options - User management and authentication - Responsive admin interface 🎨 Design: - Korean tourism focused branding - Mobile-first responsive design - Custom CSS with modern aesthetics - Image optimization and gallery - SEO-friendly structure 🔒 Security: - Helmet.js security headers - bcrypt password hashing - Input validation and sanitization - CORS protection - Environment variables
This commit is contained in:
25
database/create-test-admin.cjs
Normal file
25
database/create-test-admin.cjs
Normal file
@@ -0,0 +1,25 @@
|
||||
// Создание тестового администратора для AdminJS
|
||||
const crypto = require('crypto');
|
||||
|
||||
function generateBcryptHash(password) {
|
||||
// Упрощенная версия - используем готовый хеш
|
||||
// Пароль: admin123
|
||||
return '$2a$10$rOjLbFbCqbCQPZdJQWb1gO6WvhzJP1O5VuItXwDJV4tTJYg4oEGoC';
|
||||
}
|
||||
|
||||
function createTestAdmin() {
|
||||
const hashedPassword = generateBcryptHash('admin123');
|
||||
|
||||
console.log('🔐 Создаем тестового администратора...');
|
||||
console.log('📧 Email: admin@koreatour.ru');
|
||||
console.log('👤 Username: admin');
|
||||
console.log('🔑 Password: admin123');
|
||||
console.log('🔒 Hashed password:', hashedPassword);
|
||||
|
||||
const sql = `INSERT INTO admins (username, password, name, email, role, is_active) VALUES ('admin', '${hashedPassword}', 'Главный администратор', 'admin@koreatour.ru', 'admin', true) ON CONFLICT (username) DO UPDATE SET password = EXCLUDED.password, name = EXCLUDED.name, email = EXCLUDED.email, role = EXCLUDED.role, is_active = EXCLUDED.is_active;`;
|
||||
|
||||
console.log('\n▶️ Запустите эту команду:');
|
||||
console.log(`docker-compose exec db psql -U tourism_user -d korea_tourism -c "${sql}"`);
|
||||
}
|
||||
|
||||
createTestAdmin();
|
||||
Reference in New Issue
Block a user