3.6 KiB
3.6 KiB
Thanasoft Quick Start Guide
✅ Setup Complete!
Your Thanasoft application is now configured to automatically build the Vue.js frontend into the Laravel backend's public/build directory.
📁 Project Structure
Thanasoft v2/
├── thanasoft-front/ # Vue.js Frontend
│ ├── src/
│ ├── vue.config.js # ✨ Configured to build to ../thanasoft-back/public/build/
│ └── package.json
│
└── thanasoft-back/ # Laravel Backend
├── app/
├── routes/
│ ├── api.php # API routes (/api/*)
│ └── web.php # Frontend fallback route
└── public/
├── index.php # Laravel entry point
├── .htaccess # Routing rules
└── build/ # ✨ Vue.js build output (auto-generated)
├── index.html
├── css/
├── js/
└── img/
🚀 Development
Local Development
Terminal 1 - Start Laravel backend:
cd "thanasoft-back"
php artisan serve
Backend: http://localhost:8000
Terminal 2 - Start Vue.js frontend:
cd "thanasoft-front"
npm run serve
Frontend: http://localhost:8080
(API calls are proxied to backend)
📦 Building for Production
From the frontend directory:
cd "thanasoft-front"
npm run build
This will:
- Build optimized production files
- Output directly to
../thanasoft-back/public/build/ - Ready to deploy!
🌐 Deploy to Server
Quick Deploy (Automated)
cd "/media/creator/6226b912-8ba7-45dc-88a2-4b10d3dd1655/kandra/Thanasoft v2"
chmod +x deploy-to-server.sh
./deploy-to-server.sh
Manual Deploy
-
Build locally:
cd thanasoft-front npm run build -
Upload to server:
rsync -avz --exclude 'node_modules' --exclude 'vendor' --exclude '.git' \ thanasoft-back/ root@78.138.58.60:/var/www/html/New-Thanasoft/thanasoft-back/ -
On server, set permissions and cache:
ssh root@78.138.58.60 cd /var/www/html/New-Thanasoft/thanasoft-back # Set permissions chown -R www-data:www-data storage bootstrap/cache public/build chmod -R 775 storage bootstrap/cache # Clear and cache php artisan route:clear php artisan cache:clear php artisan config:clear php artisan route:cache php artisan config:cache # Restart Apache systemctl restart apache2
🔗 Your Live Application
- Website: http://78.138.58.60/
- API: http://78.138.58.60/api/
API Endpoints
POST /api/auth/register- Register new userPOST /api/auth/login- LoginGET /api/auth/me- Get current user (requires token)POST /api/auth/logout- LogoutPOST /api/auth/logout-all- Logout from all devices
✨ What Changed
Created/Modified Files:
-
thanasoft-front/vue.config.js✅ NEW- Configured to build to
../thanasoft-back/public/build/ - Set public path to
/build/ - Added dev server proxy for API calls
- Configured to build to
-
thanasoft-back/app/Models/User.php✅ UPDATED- Added
HasApiTokenstrait for Laravel Sanctum
- Added
-
thanasoft-back/routes/web.php✅ VERIFIED- Serves frontend from
public_path('build/index.html')
- Serves frontend from
-
thanasoft-back/composer.json✅ UPDATED- Added
laravel/sanctumdependency
- Added
🎯 Workflow Summary
Development:
# Terminal 1
cd thanasoft-back && php artisan serve
# Terminal 2
cd thanasoft-front && npm run serve
Build:
cd thanasoft-front && npm run build
Deploy:
./deploy-to-server.sh
That's it! 🎉