Files
fuel-alert/resources/js/router/index.js
Ovidiu U a841a7c900 Add dedicated /pricing page and lock launch tiers to Free/Daily/Smart
Consolidate pricing onto a single source. Pro is deferred from launch
(left dormant: no Stripe price, no card), so the offered set is 3 tiers.

- Extract the pricing grid and footer into shared components
  (PricingGrid.vue, landing/SiteFooter.vue); add a /pricing route
  rendering Pricing.vue; remove the pricing section from Home
- Repoint every upgrade link to the /pricing route (LandingNav and
  SiteFooter via RouterLink, UpsellBanner CTA) — no more #pricing anchors
- Bump Smart (plus) SMS daily limit 1 -> 3 (PlanSeeder + PlanFactory),
  update PlanFeaturesTest assertion
- Rewrite /pricing card bullets to match real entitlements (drop
  unbuilt promises: multi-location tracking, 14-day trend, supermarket anchor)
- Fix stale "1/day" SMS references in notifications.md, tiers.md, docs/tiers.md
- Delete unused resources/views/components/pricing-card.blade.php

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 12:22:19 +01:00

66 lines
2.4 KiB
JavaScript

import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import { useAuth } from '../composables/useAuth.js'
const Pricing = () => import('../views/Pricing.vue')
const DashboardLayout = () => import('../views/dashboard/DashboardLayout.vue')
const Overview = () => import('../views/dashboard/Overview.vue')
const SavedStations = () => import('../views/dashboard/SavedStations.vue')
const Preferences = () => import('../views/dashboard/Preferences.vue')
const SettingsLayout = () => import('../views/dashboard/settings/SettingsLayout.vue')
const Profile = () => import('../views/dashboard/settings/Profile.vue')
const Security = () => import('../views/dashboard/settings/Security.vue')
const Appearance = () => import('../views/dashboard/settings/Appearance.vue')
const routes = [
{ path: '/', component: Home, name: 'home' },
{ path: '/pricing', component: Pricing, name: 'pricing' },
{
path: '/logout',
name: 'logout',
component: { render: () => null },
beforeEnter: () => {
window.location.href = '/logout'
return false
},
},
{
path: '/dashboard',
component: DashboardLayout,
meta: { requiresAuth: true },
children: [
{ path: '', component: Overview, name: 'dashboard' },
{ path: 'saved-stations', component: SavedStations, name: 'dashboard.saved-stations' },
{ path: 'preferences', component: Preferences, name: 'dashboard.preferences' },
{
path: 'settings',
component: SettingsLayout,
redirect: '/dashboard/settings/profile',
children: [
{ path: 'profile', component: Profile, name: 'dashboard.settings.profile' },
{ path: 'security', component: Security, name: 'dashboard.settings.security' },
{ path: 'appearance', component: Appearance, name: 'dashboard.settings.appearance' },
],
},
],
},
]
const router = createRouter({
history: createWebHistory(),
routes,
})
router.beforeEach(async (to) => {
if (to.meta.requiresAuth) {
const { isAuthenticated, fetchUser } = useAuth()
await fetchUser()
if (!isAuthenticated.value) {
window.location.href = '/login'
return false
}
}
})
export default router