init commit
This commit is contained in:
170
routes/web.php
Normal file
170
routes/web.php
Normal file
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Web Routes
|
||||
* Professional Resume Builder - Laravel Application
|
||||
*
|
||||
* @author David Valera Melendez <david@valera-melendez.de>
|
||||
* @created 2025-08-08
|
||||
* @location Made in Germany 🇩🇪
|
||||
*/
|
||||
|
||||
use App\Http\Controllers\Auth\AuthController;
|
||||
use App\Http\Controllers\DashboardController;
|
||||
use App\Http\Controllers\ResumeBuilderController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\TemplateController;
|
||||
use App\Http\Controllers\ProfileController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider and all of them will
|
||||
| be assigned to the "web" middleware group. Make something great!
|
||||
|
|
||||
*/
|
||||
|
||||
// Public Routes
|
||||
Route::get('/', [HomeController::class, 'index'])->name('home');
|
||||
Route::get('/features', [HomeController::class, 'features'])->name('features');
|
||||
Route::get('/pricing', [HomeController::class, 'pricing'])->name('pricing');
|
||||
Route::get('/help', [HomeController::class, 'help'])->name('help');
|
||||
Route::get('/contact', [HomeController::class, 'contact'])->name('contact');
|
||||
Route::get('/privacy', [HomeController::class, 'privacy'])->name('privacy');
|
||||
Route::get('/terms', [HomeController::class, 'terms'])->name('terms');
|
||||
Route::get('/support', [HomeController::class, 'support'])->name('support');
|
||||
|
||||
// Public Resume Views
|
||||
Route::get('/resume/{publicUrl}', [ResumeBuilderController::class, 'showPublic'])->name('public.resume');
|
||||
|
||||
// Authentication Routes
|
||||
Route::middleware('guest')->group(function () {
|
||||
// Login
|
||||
Route::get('/login', [AuthController::class, 'showLoginForm'])->name('login');
|
||||
Route::post('/login', [AuthController::class, 'login']);
|
||||
|
||||
// Registration
|
||||
Route::get('/register', [AuthController::class, 'showRegistrationForm'])->name('register');
|
||||
Route::post('/register', [AuthController::class, 'register']);
|
||||
|
||||
// Password Reset
|
||||
Route::get('/forgot-password', [AuthController::class, 'showForgotPasswordForm'])->name('password.request');
|
||||
Route::post('/forgot-password', [AuthController::class, 'sendResetLinkEmail'])->name('password.email');
|
||||
Route::get('/reset-password/{token}', [AuthController::class, 'showResetPasswordForm'])->name('password.reset');
|
||||
Route::post('/reset-password', [AuthController::class, 'resetPassword'])->name('password.update');
|
||||
});
|
||||
|
||||
// Authenticated Routes
|
||||
Route::middleware('auth')->group(function () {
|
||||
// Logout
|
||||
Route::post('/logout', [AuthController::class, 'logout'])->name('logout');
|
||||
|
||||
// Dashboard
|
||||
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
|
||||
|
||||
// Profile Management
|
||||
Route::prefix('profile')->name('profile.')->group(function () {
|
||||
Route::get('/', [ProfileController::class, 'show'])->name('show');
|
||||
Route::get('/edit', [ProfileController::class, 'edit'])->name('edit');
|
||||
Route::put('/', [ProfileController::class, 'update'])->name('update');
|
||||
Route::delete('/', [ProfileController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
|
||||
// Account Settings
|
||||
Route::prefix('account')->name('account.')->group(function () {
|
||||
Route::get('/settings', [ProfileController::class, 'settings'])->name('settings');
|
||||
Route::put('/password', [ProfileController::class, 'updatePassword'])->name('password.update');
|
||||
Route::put('/preferences', [ProfileController::class, 'updatePreferences'])->name('preferences.update');
|
||||
});
|
||||
|
||||
// Resume Builder
|
||||
Route::prefix('resume-builder')->name('resume-builder.')->group(function () {
|
||||
Route::get('/', [ResumeBuilderController::class, 'index'])->name('index');
|
||||
Route::get('/create', [ResumeBuilderController::class, 'create'])->name('create');
|
||||
Route::post('/', [ResumeBuilderController::class, 'store'])->name('store');
|
||||
Route::get('/{resume}/edit', [ResumeBuilderController::class, 'edit'])->name('edit');
|
||||
Route::put('/{resume}', [ResumeBuilderController::class, 'update'])->name('update');
|
||||
Route::get('/{resume}/preview', [ResumeBuilderController::class, 'preview'])->name('preview');
|
||||
Route::get('/{resume}/download-pdf', [ResumeBuilderController::class, 'downloadPdf'])->name('download-pdf');
|
||||
Route::delete('/{resume}', [ResumeBuilderController::class, 'destroy'])->name('destroy');
|
||||
|
||||
// Resume Actions
|
||||
Route::post('/{resume}/duplicate', [ResumeBuilderController::class, 'duplicate'])->name('duplicate');
|
||||
Route::post('/{resume}/make-public', [ResumeBuilderController::class, 'makePublic'])->name('make-public');
|
||||
Route::post('/{resume}/make-private', [ResumeBuilderController::class, 'makePrivate'])->name('make-private');
|
||||
});
|
||||
|
||||
// Templates
|
||||
Route::prefix('templates')->name('templates.')->group(function () {
|
||||
Route::get('/', [TemplateController::class, 'index'])->name('index');
|
||||
Route::get('/{template}', [TemplateController::class, 'show'])->name('show');
|
||||
Route::get('/{template}/preview', [TemplateController::class, 'preview'])->name('preview');
|
||||
});
|
||||
});
|
||||
|
||||
// API Routes for AJAX requests
|
||||
Route::middleware(['auth', 'throttle:60,1'])->prefix('api')->name('api.')->group(function () {
|
||||
// Resume API
|
||||
Route::prefix('resumes')->name('resumes.')->group(function () {
|
||||
Route::get('/', [ResumeBuilderController::class, 'apiIndex'])->name('index');
|
||||
Route::post('/{resume}/autosave', [ResumeBuilderController::class, 'autosave'])->name('autosave');
|
||||
Route::get('/{resume}/analytics', [ResumeBuilderController::class, 'analytics'])->name('analytics');
|
||||
});
|
||||
|
||||
// Profile API
|
||||
Route::prefix('profile')->name('profile.')->group(function () {
|
||||
Route::put('/avatar', [ProfileController::class, 'updateAvatar'])->name('avatar.update');
|
||||
Route::get('/completion', [ProfileController::class, 'completion'])->name('completion');
|
||||
});
|
||||
});
|
||||
|
||||
// Admin Routes (Future Enhancement)
|
||||
// Route::middleware(['auth', 'admin'])->prefix('admin')->name('admin.')->group(function () {
|
||||
// Route::get('/dashboard', [AdminController::class, 'dashboard'])->name('dashboard');
|
||||
// Route::resource('users', AdminUserController::class);
|
||||
// Route::resource('templates', AdminTemplateController::class);
|
||||
// });
|
||||
|
||||
// Webhook Routes (Future Enhancement)
|
||||
// Route::prefix('webhooks')->name('webhooks.')->group(function () {
|
||||
// Route::post('/payment/stripe', [WebhookController::class, 'stripe'])->name('stripe');
|
||||
// Route::post('/analytics', [WebhookController::class, 'analytics'])->name('analytics');
|
||||
// });
|
||||
|
||||
// Health Check
|
||||
Route::get('/health', function () {
|
||||
return response()->json([
|
||||
'status' => 'ok',
|
||||
'timestamp' => now()->toISOString(),
|
||||
'version' => config('app.version', '1.0.0'),
|
||||
'environment' => app()->environment(),
|
||||
'author' => 'David Valera Melendez',
|
||||
'location' => 'Made in Germany 🇩🇪'
|
||||
]);
|
||||
})->name('health');
|
||||
|
||||
// Sitemap (SEO)
|
||||
Route::get('/sitemap.xml', [SeoController::class, 'sitemap'])->name('sitemap');
|
||||
|
||||
// Robots.txt (SEO)
|
||||
Route::get('/robots.txt', function () {
|
||||
$content = "User-agent: *\n";
|
||||
$content .= "Allow: /\n";
|
||||
$content .= "Disallow: /admin/\n";
|
||||
$content .= "Disallow: /api/\n";
|
||||
$content .= "Sitemap: " . route('sitemap') . "\n";
|
||||
|
||||
return response($content, 200, ['Content-Type' => 'text/plain']);
|
||||
})->name('robots');
|
||||
|
||||
// Fallback for SPA-like behavior (if needed)
|
||||
Route::fallback(function () {
|
||||
return response()->view('errors.404', [
|
||||
'title' => 'Page Not Found',
|
||||
'message' => 'The page you are looking for could not be found.'
|
||||
], 404);
|
||||
});
|
||||
Reference in New Issue
Block a user