Appearance
Root Index Page ​
File Information ​
- Path:
app/pages/index.vue - Route:
/ - Purpose: Landing page for brand URL entry
- Layout:
login-layout(custom) - Middleware: None
Overview ​
The Root Index page is the landing page when users visit the root URL. It allows users to enter their brand URL to navigate to their brand's portal. This page provides a simple interface for brand URL entry and validation.
Key Features ​
Brand URL Input
- Text input for brand URL
- Real-time validation
- Placeholder and example display
- Error handling
Domain Verification
- Validates brand URL via API
- Verifies domain exists
- Handles invalid domains
Navigation
- Redirects to brand portal on success
- Preserves brand URL in navigation
- Error handling
Branding
- Collage logo display
- "Powered by Collage" footer
- Consistent branding
Components Used ​
v-text-field- Vuetify text input componentv-btn- Vuetify button componentv-progress-circular- Loading spinnerv-skeleton-loader- Skeleton loaderAsyncIcon- Async icon component
Composables Used ​
useAppDataApi()- App data API (app/composables/api/useAppDataApi.ts)useSnackbar()- Snackbar notificationsuseHelpers()- Helper functions
Data Properties ​
Reactive Data ​
typescript
{
brandName: string, // Brand URL input
loading: boolean, // Form submission loading state
contentLoading: boolean, // Initial content loading state
canGo: boolean // Navigation enabled flag
}Computed Properties ​
brandNameError ​
Determines if brand name input has error.
typescript
computed(() => !brandName.value.trim())Returns: boolean - True if brand name is empty
Methods ​
submitHandler() ​
Handles brand URL form submission.
typescript
async function submitHandler() {
if (!brandName.value.trim()) {
return
}
loading.value = true
canGo.value = false
try {
const response = await appDataApi.verifyDomain(brandName.value.trim())
await navigateTo(`/${brandName.value.trim()}`)
} catch (error: any) {
console.error("Domain verification failed:", error)
// Still navigate even on error (domain validation happens on brand page)
await navigateTo(`/${brandName.value.trim()}`)
} finally {
loading.value = false
canGo.value = true
}
}Flow:
- Validates brand name is not empty
- Sets loading state
- Calls domain verification API
- Navigates to brand portal
- Handles errors (still navigates)
- Resets loading state
Note: Even on API error, navigation proceeds (domain validation happens on brand page).
User Interactions ​
Form Input
- Enter brand URL
- Real-time validation
- Example URL display
Form Submission
- Click "Go to {brandName}" or "Enter your brand url" button
- Form validates before submission
- Loading state during API call
Navigation
- Automatic redirect to brand portal
- Brand URL preserved in navigation
Styling ​
- Uses scoped styles from
@/assets/scss/login.scss - Form layout styles
- Input field styles
- Button styles with loading states
- Skeleton loader styles
- Branding footer styles
Lifecycle Hooks ​
onMounted ​
Initializes content loading state.
typescript
onMounted(() => {
nextTick(() => (contentLoading.value = false))
})Purpose: Hides skeleton loader after component mounts.
API Endpoints ​
Verify Domain ​
- Endpoint:
POST /verify-domain(viaappDataApi.verifyDomain()) - Request Body:typescript
{ url: string // Brand URL } - Response: Domain verification result
User Flow ​
- User visits root URL (
/) - Page displays brand URL input form
- User enters brand URL
- User clicks submit button
- System verifies domain (optional, for UX)
- System navigates to brand portal (
/{brandName}) - Brand portal page handles further validation
Notes for Development ​
- Page is public (no authentication required)
- Domain verification is optional (for better UX)
- Navigation proceeds even if verification fails
- Brand URL trimmed before navigation
- Button text changes based on input state
- Example URL shown when input is empty
- Full URL preview shown when input has value
- "Powered by Collage" footer always visible
- Uses login layout for consistent branding
Related Documentation ​
- Login Layout - Login layout documentation
- URL Validation Middleware - URL validation
- App Data API - App data API endpoints