diff --git a/README.md b/README.md index 0e8df0a..46eadd8 100644 --- a/README.md +++ b/README.md @@ -24,37 +24,210 @@ Modern tourism website for domestic travel in Korea with comprehensive admin pan - **User Management**: Admin authentication and roles - **Dashboard**: Analytics and quick access to all features -## 🚀 Быстрый старт +## 🚀 Installation and Setup -### Автоматический деплой -```bash -./deploy.sh -``` +### Prerequisites +- Docker and Docker Compose +- Node.js 18+ (for local development) +- Git -### Ручной запуск +### 1. Clone Repository ```bash -# Клонирование репозитория git clone -cd tourism_site - -# Запуск с Docker -docker-compose up --build -d - -# Или локальная разработка -npm install -npm run dev +cd korea-tourism-agency ``` -## 📱 Доступ к приложению +### 2. Start Development Environment +```bash +# Give execute permissions to the script +chmod +x start-dev.sh -- **Основной сайт**: http://localhost:3000 -- **Админ панель**: http://localhost:3000/admin -- **База данных**: http://localhost:8080 (Adminer) +# Launch full environment +./start-dev.sh +``` -## 🔑 Учётные данные по умолчанию +### 3. Manual Setup (Alternative) +```bash +# Create .env file from example +cp .env.example .env -- **Админ**: admin / admin123 -- **База данных**: postgres / postgres +# Start containers +docker-compose up -d + +# Run database migrations +docker-compose exec app npm run db:migrate + +# Seed with test data +docker-compose exec app npm run db:seed +``` + +### 🌐 Access URLs + +After successful startup: + +- 🏠 **Main Website**: http://localhost:3000 +- ⚙️ **Admin Panel**: http://localhost:3000/admin +- 🗄️ **Adminer (DB)**: http://localhost:8080 + +### 🔐 Login Credentials + +**Admin Panel:** +- Username: `admin` +- Password: `123456` + +**Database (Adminer):** +- System: PostgreSQL +- Server: postgres +- Username: tourism_user +- Password: tourism_password +- Database: korea_tourism + +## 📁 Project Structure + +``` +korea-tourism-agency/ +├── 📂 src/ # Application source code +│ ├── 📂 config/ # Database configuration +│ ├── 📂 routes/ # Express routes +│ └── 📂 helpers/ # Utility functions +├── 📂 views/ # EJS templates +│ ├── 📂 routes/ # Tour pages +│ ├── 📂 guides/ # Guide pages +│ └── 📂 articles/ # Article pages +├── 📂 public/ # Static files +│ ├── 📂 css/ # Stylesheets +│ ├── 📂 js/ # JavaScript +│ ├── 📂 images/ # Images +│ └── 📂 uploads/ # Uploaded files +├── 📂 database/ # DB migrations and schemas +│ ├── schema.sql # Database schema +│ ├── migrate.js # Migration script +│ └── seed.js # Test data +├── 📂 docker/ # Docker configurations +└── 📂 docs/ # Documentation +``` + +## 🗄️ Database + +### Main Tables +- **routes** - Tourist routes and tours +- **guides** - Guide profiles +- **articles** - Blog articles +- **bookings** - Tour bookings +- **admins** - Administrators +- **contact_messages** - Contact form messages +- **site_settings** - Site settings + +### Tour Types +- **city** - City tours (Seoul, Busan) +- **mountain** - Mountain hiking (Seoraksan, Jirisan) +- **fishing** - Sea fishing (East Sea, Jeju Island) + +## 🛠️ Development + +### Useful Commands +```bash +# View application logs +docker-compose logs -f app + +# Restart application +docker-compose restart app + +# Execute commands in container +docker-compose exec app npm run db:migrate +docker-compose exec app npm run db:seed + +# Stop all containers +docker-compose down + +# Full cleanup (warning: deletes DB data) +docker-compose down -v +docker system prune -f +``` + +### Route Structure +- `/` - Homepage +- `/routes` - Tour catalog +- `/routes/:id` - Tour details +- `/guides` - Guide list +- `/guides/:id` - Guide profile +- `/articles` - Blog articles +- `/admin` - Admin panel +- `/api` - REST API + +### API Endpoints +- `GET /api/routes` - Get tours with filtering +- `GET /api/guides` - Get guides +- `POST /api/booking` - Create booking +- `GET /api/search` - Site search + +## 🎨 Design & UI + +### Color Scheme +- Primary Color: #2563eb (Blue) +- Korean Red: #c41e3a +- Korean Blue: #003478 +- Modern gradients and transitions + +### UI Components +- **AdminJS** - Admin panel framework +- **Bootstrap 5** - Frontend framework +- **Font Awesome** - Icon library +- **AOS** - Scroll animations +- **Chart.js** - Charts and graphs + +### Responsive Design +- ✅ Desktop (1200px+) +- ✅ Tablet (768px-1199px) +- ✅ Mobile (up to 767px) +- ✅ Touch device support + +## 🔧 Configuration + +### Environment Variables (.env) +```env +# Database +DB_HOST=postgres +DB_PORT=5432 +DB_NAME=korea_tourism +DB_USER=tourism_user +DB_PASSWORD=tourism_password + +# Application +PORT=3000 +NODE_ENV=development +SESSION_SECRET=your-secret-key + +# File Upload +UPLOAD_PATH=/app/public/uploads +MAX_FILE_SIZE=5242880 + +# Contact Information +SITE_NAME=Korea Tourism Agency +CONTACT_EMAIL=info@koreatourism.com +CONTACT_PHONE=+82-2-1234-5678 +``` + +## 🚀 Production Deployment + +```bash +# Use production compose file +docker-compose -f docker-compose.prod.yml up -d + +# Or create .env.production +cp .env.example .env.production +# Edit settings for production + +# Launch with production settings +NODE_ENV=production docker-compose up -d +``` + +## 🌍 Localization + +Site supports: +- **Korean** (primary language) +- **English** (for tourists) +- Proper fonts: Noto Sans KR for Korean text ## 🌟 Особенности