feat: transform to frontend-only app with external API integration #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request completely transforms the TaskMateFrontend application from a full-stack Laravel application into a pure frontend application that connects to the external TaskMate Telegram Bot API. All authentication and business logic is now handled by the external API, with Laravel serving only as a view renderer.
Changes Overview
🔥 Backend Removal (Complete)
Removed all local authentication infrastructure:
app/Models/User.php)app/Models/Setting.php)database/migrations/0001_01_01_000000_create_users_table.php)database/migrations/2025_10_24_192717_create_settings_table.php)database/factories/UserFactory.php)Removed all authentication controllers:
app/Http/Controllers/Auth/(entire directory)app/Http/Controllers/Settings/(entire directory)Removed backend routes and tests:
routes/auth.php(entire file)tests/Feature/Auth/(all auth tests)tests/Feature/Settings/(all settings tests)Removed unnecessary auth views:
resources/views/auth/confirm-password.blade.phpresources/views/auth/forgot-password.blade.phpresources/views/auth/reset-password.blade.phpresources/views/auth/verify-email.blade.php✨ Frontend API Integration (New)
1. API Client Rewrite (
resources/js/api-client.js)VITE_API_URLenvironment variable2. Frontend Auth Guard (
resources/js/auth-guard.js)3. Updated Authentication Views
Login (
resources/views/auth/login.blade.php)apiClient.login()Register (
resources/views/auth/register.blade.php)apiClient.register()Header (
resources/views/components/layouts/app/header.blade.php)apiClient.logout()🔧 Configuration
Environment Variables (
.env.example)📝 Routes Simplification (
routes/web.php)Before: Complex routes with auth middleware, CSRF protection, controllers
After: Simple view-only routes - no middleware, no controllers
All routes now just serve views:
/,/login,/register/dashboard,/tasks,/dealerships,/users,/settings🎯 How It Works
auth-guard.jschecks localStorage for token/loginapi-client.jsaddsBearer {token}header automatically/login?expired=1/login📊 Statistics
🔗 Related
✅ Testing Checklist
VITE_API_URLin.envnpm run buildornpm run dev/login- should see login form/dashboard- should be accessible/dashboardwithout token - should redirect to login📦 Deployment Notes
VITE_API_URLto production API endpointnpm run buildto compile assets🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Fixes #28