236 lines
6.8 KiB
Markdown
236 lines
6.8 KiB
Markdown
# Portal New - Hệ thống Quản lý Hosting & VPS
|
|
|
|
[](https://laravel.com)
|
|
[](https://php.net)
|
|
[](LICENSE)
|
|
|
|
## 📋 Mô tả
|
|
|
|
Portal New là một hệ thống quản lý hosting và VPS toàn diện được xây dựng trên nền tảng Laravel 10. Hệ thống cung cấp giao diện quản trị cho admin và giao diện khách hàng để mua sắm, quản lý dịch vụ hosting, VPS, domain và các dịch vụ liên quan.
|
|
|
|
## ✨ Tính năng chính
|
|
|
|
### 🛒 Giao diện khách hàng
|
|
- **Đăng ký/Đăng nhập**: Hệ thống xác thực khách hàng
|
|
- **Mua sắm dịch vụ**: Hosting, VPS, Domain
|
|
- **Giỏ hàng**: Quản lý đơn hàng và thanh toán
|
|
- **Quản lý dịch vụ**: Theo dõi trạng thái hosting, VPS
|
|
- **Hỗ trợ**: Hệ thống ticket support
|
|
- **Thanh toán**: Tích hợp cổng thanh toán VNPay
|
|
- **Nạp tiền**: Quản lý tài khoản và giao dịch
|
|
|
|
### 🔧 Giao diện quản trị
|
|
- **Quản lý khách hàng**: Thông tin, dịch vụ, hóa đơn
|
|
- **Quản lý sản phẩm**: Hosting, VPS, Domain, Addon
|
|
- **Quản lý đơn hàng**: Xử lý đơn hàng và thanh toán
|
|
- **Quản lý hóa đơn**: Tạo và quản lý hóa đơn
|
|
- **Quản lý server**: VMware vCenter, DNS, Hosting servers
|
|
- **Hỗ trợ khách hàng**: Xử lý ticket và yêu cầu
|
|
- **Báo cáo**: Thống kê và báo cáo hệ thống
|
|
|
|
### 🚀 Tính năng kỹ thuật
|
|
- **VMware Integration**: Quản lý VPS thông qua vCenter
|
|
- **DNS Management**: Quản lý DNS servers
|
|
- **Hosting Management**: Tự động tạo hosting accounts
|
|
- **Snapshot Management**: Backup và restore VPS
|
|
- **Console Access**: Truy cập console VPS qua WMKS
|
|
- **Email System**: Gửi email thông báo tự động
|
|
- **Payment Gateway**: Tích hợp VNPay
|
|
|
|
## 🛠️ Yêu cầu hệ thống
|
|
|
|
- **PHP**: >= 8.1
|
|
- **Laravel**: 10.x
|
|
- **Database**: MySQL 8.0+ hoặc MariaDB 10.5+
|
|
- **Redis**: Cho cache và queue
|
|
- **Composer**: Để quản lý dependencies
|
|
- **Node.js**: Cho build assets (tùy chọn)
|
|
|
|
## 📦 Cài đặt
|
|
|
|
### 1. Clone repository
|
|
```bash
|
|
git clone <repository-url>
|
|
cd portal_new
|
|
```
|
|
|
|
### 2. Cài đặt dependencies
|
|
```bash
|
|
composer install
|
|
npm install
|
|
```
|
|
|
|
### 3. Cấu hình môi trường
|
|
```bash
|
|
cp .env.example .env
|
|
php artisan key:generate
|
|
```
|
|
|
|
### 4. Cấu hình database
|
|
Chỉnh sửa file `.env`:
|
|
```env
|
|
DB_CONNECTION=mysql
|
|
DB_HOST=127.0.0.1
|
|
DB_PORT=3306
|
|
DB_DATABASE=portal_new
|
|
DB_USERNAME=your_username
|
|
DB_PASSWORD=your_password
|
|
```
|
|
|
|
### 5. Chạy migration và seeder
|
|
```bash
|
|
php artisan migrate
|
|
php artisan db:seed
|
|
```
|
|
|
|
### 6. Cấu hình storage
|
|
```bash
|
|
php artisan storage:link
|
|
```
|
|
|
|
### 7. Build assets
|
|
```bash
|
|
npm run build
|
|
```
|
|
|
|
### 8. Cấu hình queue (tùy chọn)
|
|
```bash
|
|
php artisan queue:work
|
|
```
|
|
|
|
## 🔧 Cấu hình
|
|
|
|
### VMware vCenter
|
|
Cấu hình kết nối VMware vCenter trong file `.env`:
|
|
```env
|
|
VCENTER_HOST=your_vcenter_host
|
|
VCENTER_USERNAME=your_username
|
|
VCENTER_PASSWORD=your_password
|
|
VCENTER_PORT=443
|
|
```
|
|
|
|
### Payment Gateway (VNPay)
|
|
```env
|
|
VNPAY_TMN_CODE=your_tmn_code
|
|
VNPAY_HASH_SECRET=your_hash_secret
|
|
VNPAY_URL=https://sandbox.vnpayment.vn/paymentv2/vpcpay.html
|
|
```
|
|
|
|
### SMTP Configuration
|
|
```env
|
|
MAIL_MAILER=smtp
|
|
MAIL_HOST=your_smtp_host
|
|
MAIL_PORT=587
|
|
MAIL_USERNAME=your_email
|
|
MAIL_PASSWORD=your_password
|
|
MAIL_ENCRYPTION=tls
|
|
```
|
|
|
|
## 📁 Cấu trúc thư mục
|
|
|
|
```
|
|
portal_new/
|
|
├── app/
|
|
│ ├── Console/Commands/ # Artisan commands
|
|
│ ├── Events/ # Event classes
|
|
│ ├── Http/
|
|
│ │ ├── Controllers/ # Controllers
|
|
│ │ │ ├── admin/ # Admin controllers
|
|
│ │ │ └── frontend/ # Frontend controllers
|
|
│ │ ├── Livewire/ # Livewire components
|
|
│ │ ├── Middleware/ # Custom middleware
|
|
│ │ ├── Requests/ # Form requests
|
|
│ │ └── Services/ # Business logic services
|
|
│ ├── Jobs/ # Queue jobs
|
|
│ ├── Mail/ # Mail classes
|
|
│ ├── Models/ # Eloquent models
|
|
│ ├── Notifications/ # Notification classes
|
|
│ ├── Observers/ # Model observers
|
|
│ ├── Providers/ # Service providers
|
|
│ └── Repositories/ # Repository pattern
|
|
├── config/ # Configuration files
|
|
├── database/
|
|
│ ├── migrations/ # Database migrations
|
|
│ ├── seeders/ # Database seeders
|
|
│ └── factories/ # Model factories
|
|
├── public/ # Public assets
|
|
├── resources/
|
|
│ ├── views/ # Blade templates
|
|
│ ├── css/ # Stylesheets
|
|
│ └── js/ # JavaScript files
|
|
└── routes/ # Route definitions
|
|
```
|
|
|
|
## 🚀 Sử dụng
|
|
|
|
### Truy cập hệ thống
|
|
- **Admin Panel**: `http://your-domain/administrator`
|
|
- **Frontend**: `http://your-domain`
|
|
|
|
### Tài khoản mặc định
|
|
Sau khi chạy seeder, bạn có thể đăng nhập với:
|
|
- **Admin**: admin@example.com / password
|
|
- **Customer**: customer@example.com / password
|
|
|
|
## 🔒 Bảo mật
|
|
|
|
- Sử dụng Laravel Sanctum cho API authentication
|
|
- CSRF protection cho tất cả forms
|
|
- Input validation và sanitization
|
|
- Role-based access control (RBAC)
|
|
- Secure file upload handling
|
|
|
|
## 📊 Monitoring
|
|
|
|
Hệ thống sử dụng Laravel Horizon để monitoring queues:
|
|
```bash
|
|
php artisan horizon
|
|
```
|
|
|
|
## 🧪 Testing
|
|
|
|
```bash
|
|
php artisan test
|
|
```
|
|
|
|
## 📝 API Documentation
|
|
|
|
API endpoints được định nghĩa trong `routes/api.php`:
|
|
- Authentication endpoints
|
|
- Customer management
|
|
- Service management
|
|
- Payment processing
|
|
- VMware operations
|
|
|
|
## 🤝 Đóng góp
|
|
|
|
1. Fork the project
|
|
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
5. Open a Pull Request
|
|
|
|
## 📄 License
|
|
|
|
Dự án này được phân phối dưới giấy phép MIT. Xem file `LICENSE` để biết thêm chi tiết.
|
|
|
|
## 📞 Hỗ trợ
|
|
|
|
Nếu bạn gặp vấn đề hoặc có câu hỏi, vui lòng:
|
|
- Tạo issue trên GitHub
|
|
- Liên hệ qua email: support@example.com
|
|
|
|
## 🔄 Changelog
|
|
|
|
### Version 1.0.0
|
|
- Initial release
|
|
- Basic hosting and VPS management
|
|
- Customer portal
|
|
- Admin panel
|
|
- Payment integration
|
|
- VMware integration
|
|
|
|
---
|
|
|
|
**Lưu ý**: Đây là dự án đang phát triển. Vui lòng kiểm tra kỹ trước khi sử dụng trong môi trường production.
|