feat: transform to frontend-only app with external API integration#29
Closed
konard wants to merge 3 commits intoxierongchuan:mainfrom
Closed
feat: transform to frontend-only app with external API integration#29konard wants to merge 3 commits intoxierongchuan:mainfrom
konard wants to merge 3 commits intoxierongchuan:mainfrom
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: undefined
This commit completely refactors the application to be a frontend-only Laravel app that connects to the external TaskMate Telegram Bot API. Major changes: Backend Removal: - Removed all local authentication (User model, auth controllers, migrations) - Removed ApiProxyController (no longer needed) - Removed Settings controllers and models - Removed backend authentication middleware and routes - Simplified routes/web.php to only serve views - Removed auth.php routes file Frontend API Client: - Completely rewrote api-client.js to connect directly to external API - API URL now configured via VITE_API_URL environment variable - Authentication uses Bearer tokens stored in localStorage - Automatic token management with 401 handling and redirect Frontend Authentication: - Created auth-guard.js for client-side route protection - Updated login.blade.php with Alpine.js and API integration - Updated register.blade.php with Alpine.js and API integration - Updated header.blade.php for frontend logout and user display - Session management entirely in JavaScript/localStorage Configuration: - Added VITE_API_URL to .env.example - All authentication now handled via external API This transforms the project into a pure frontend application with all business logic handled by the external API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit ae0c21b.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 📎 Log file uploaded as GitHub Gist (328KB) Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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