ĐĂNG NHẬP
Có thể tham khảo qua website qua link: https://vucci.id.vn/
Đã tích hợp chuyển khoản tự động cập nhật trạng thái thanh toán.
Bán hàng POS
API vận chuyển.
Kết nối ngay trên website để cấp tk admin để xem trước hoặc hướng dẫn triển khai lên môi trường thực tế.
XEM THÊM ==> Hướng dẫn cài đặt chi tiết
Yêu cầu hệ thống tối thiểu
PHP >= 8.1 hoặc 8.2 (kèm các extension: pdo, mbstring, openssl, curl, fileinfo)
pdo
mbstring
openssl
curl
fileinfo
Composer
Web Server (Apache hoặc Nginx / XAMPP / Laragon)
Cơ sở dữ liệu: MySQL hoặc MariaDB
Các bước cài đặt chi tiết trên môi trường Local
Bước 1: Tải mã nguồn về máy
Giải nén file source code vừa tải về vào thư mục web server (ví dụ: C:/laragon/www/ hoặc C:/xampp/htdocs/).
C:/laragon/www/
C:/xampp/htdocs/
Mở terminal (CMD / Git Bash) tại thư mục gốc của dự án.
Bước 2: Cài đặt các thư viện phụ thuộc (Dependencies)
Chạy lệnh Composer để tải thư viện PHP.
composer install
Chạy lệnh cài đặt tài nguyên giao diện (nếu dự án dùng Vite/Mix):
npm install npm run build
Bước 3: Cấu hình file môi trường (.env)
.env
Nhân bản file mẫu:
Mở file .env và cập nhật thông tin cơ sở dữ liệu:
APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost:8000 DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=ten_database_cua_ban DB_USERNAME=root DB_PASSWORD=
Bước 4: Tạo mã khóa ứng dụng (Application Key)
Chạy lệnh tạo key mã hóa:
php artisan key:generate
Bước 5: Tạo Database và nhập dữ liệu
Vào phpMyAdmin, tạo một cơ sở dữ liệu mới khớp với DB_DATABASE trong .env.
DB_DATABASE
Nhập dữ liệu theo một trong hai cách:
Cách 1 (Import file .sql): Dùng tính năng Import trên phpMyAdmin nạp file database đính kèm trong source code.
Cách 2 (Dùng Migration & Seeder):
php artisan migrate --seed
Bước 6: Tạo liên kết thư mục upload (Storage Link)
Đảm bảo hiển thị hình ảnh sản phẩm/banner:
php artisan storage:link
Bước 7: Khởi chạy dự án
Chạy server nội bộ:
php artisan serve
Truy cập vào trình duyệt theo địa chỉ: [http://127.0.0.1:8000](http://127.0.0.1:8000)
[http://127.0.0.1:8000](http://127.0.0.1:8000)
Quy trình triển khai (Deploy) Laravel lên máy chủ Production (VPS / Cloud Server)
Bước 1: Chuẩn bị máy chủ (Ubuntu/Debian)
Cài đặt Nginx, PHP (cùng các extension cần thiết), Composer, MySQL và Git:
sudo apt update && sudo apt upgrade -y sudo apt install nginx mysql-server git unzip curl php8.2-fpm php8.2-cli php8.2-mysql php8.2-curl php8.2-mbstring php8.2-xml php8.2-zip php8.2-bcmath -y
Bước 2: Đưa mã nguồn lên server
Clone mã nguồn vào thư mục chứa web (ví dụ: /var/www/):
/var/www/
cd /var/www git clone https://github.com/PhmVu102/Laravel-Ecomerce.git myapp cd myapp
Bước 3: Cài đặt dependencies và phân quyền
Chạy Composer tối ưu cho môi trường Production:
composer install --optimize-autoloader --no-dev
Phân quyền thư mục storage và bootstrap/cache cho web server (www-data):
storage
bootstrap/cache
www-data
sudo chown -R www-data:www-data /var/www/myapp/storage /var/www/myapp/bootstrap/cache sudo chmod -R 775 /var/www/myapp/storage /var/www/myapp/bootstrap/cache
Bước 4: Cấu hình môi trường Production (.env)
Copy file môi trường và sinh key:
cp .env.example .env php artisan key:generate
Cấu hình các thông số quan trọng trong .env:
Chuyển APP_ENV=production và APP_DEBUG=false.
APP_ENV=production
APP_DEBUG=false
Cập nhật APP_URL=[https://yourdomain.com](https://yourdomain.com).
APP_URL=[https://yourdomain.com](https://yourdomain.com)
Điền thông tin kết nối Database MySQL trên server (DB_DATABASE, DB_USERNAME, DB_PASSWORD).
DB_USERNAME
DB_PASSWORD
Bước 5: Database và tối ưu hóa hệ thống (Cache)
Chạy migration và link storage:
php artisan migrate --force php artisan storage:link
Tối ưu hóa hiệu năng và bộ nhớ cache của Laravel:
php artisan config:cache php artisan route:cache php artisan view:cache
Bước 6: Cấu hình Virtual Host Nginx
Tạo file cấu hình site:
sudo nano /etc/nginx/sites-available/myapp
Khai báo trỏ thư mục gốc (root) vào thư mục public của Laravel:
root
public
server { listen 80; server_name yourdomain.com; root /var/www/myapp/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; index index.php index.html; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } }
Kích hoạt cấu hình và khởi động lại Nginx:
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx
Bước 7: Cài đặt chứng chỉ bảo mật SSL (Let's Encrypt)
Kích hoạt HTTPS miễn phí:
sudo apt install certbot python3-certbot-nginx -y sudo certbot --nginx -d yourdomain.com
Nguồn: Topcode.vn
CODE NỔI BẬT
Full source website Kết Quả Xổ Số
Source code website bán quà tặng phụ kiện văn phòng phẩm đồ chơi đồ trang trí và gấu bông Share code quà tặng sinh nhật quà lưu niệm gấu bông thú bông móc khóa phụ kiện bút viết sổ tay
Source code website bán sơn tích hợp chức năng phối màu sơn Share code sơn nước sơn nội thất sơn ngoại thất và vật liệu xây dựng. Chức năng phối màu sơn trực tuyến dễ dàng lựa chọn màu sắc.
Source code website phụ kiện xe phụ tùng cáp sạc kích bình chăm sóc xe Share source code website phụ kiện ô tô xe máy phụ tùng ô tô xe máy xe đạp xe điện + Full báo cáo website phụ kiện xe
[FULL ĐỒ ÁN] Website Thi Trắc Nghiệm Online Laravel MySQL – Full Source + Database + Báo cáo Word + UML + Slide – eQuiz Pro
CODE GẦN GIỐNG