Overview
The Biométrico application uses Vue Router for client-side navigation. The router is configured with web history mode and defines routes for authentication, photo management, and individual registration. Source:src/router/index.js
Router Configuration
The router is created usingcreateWebHistory mode:
src/router/index.js:62-65
Configuration Details
Uses HTML5 history mode with the base URL from
process.env.BASE_URL. This provides clean URLs without hash fragments.Array of route definitions (see below)
Route Definitions
Login Route
The application entry point for authentication.src/router/index.js:12-16
/ - Root path of the applicationlogin - Route name for programmatic navigationLogin - Component from src/views/Login/Signin.vueHome Route
Main dashboard after authentication.src/router/index.js:17-21
/home - Home dashboard pathhome - Route nameHomeView - Component from src/views/HomeView.vuePre-Students Photos Route
Photo management for pre-students (applicants/pre-enrolled).src/router/index.js:22-26
/estudiantes_pre_pictures - Pre-students photo managementEstudiantes Pre - Route nameEstudiantes_Pre_FotoViews - Component from src/views/FotosViews/Estudiantes_Pre_FotoViews.vuePre-Students Registration Route
Individual registration for pre-students.src/router/index.js:27-31
/estudiantes_pre_registro - Pre-student individual registrationEstudiantes Pre R - Route nameRegistro_IndvPreEst - Component from src/views/FotosViews/Registro_IndvPreEst.vueStudents Photos Route
Photo management for regular enrolled students.src/router/index.js:32-36
/estudiantes_pictures - Students photo managementEstudiantes - Route nameEstudiantes_FotoViews - Component from src/views/FotosViews/Estudiantes_FotoViews.vueTeachers Photos Route
Photo management for teachers/docentes.src/router/index.js:37-41
/docentes_pictures - Teachers photo managementDocentes - Route nameDocentes_FotoViews - Component from src/views/FotosViews/Docentes_FotoViews.vueTeachers Registration Route
Individual registration for teachers.src/router/index.js:42-46
/docentes_registro - Teacher individual registrationDocenteR - Route nameRegistro_IndvDoc - Component from src/views/FotosViews/Registro_IndvDoc.vueStudents Registration Route
Individual registration for students.src/router/index.js:47-51
/estudiantes_registro - Student individual registrationEstudianteR - Route nameRegistro_IndvEst - Component from src/views/FotosViews/Registro_IndvEst.vueAbout Route (Lazy Loaded)
About page with code splitting.src/router/index.js:52-59
/about - About pageabout - Route nameLazy-loaded component using dynamic import. This creates a separate chunk (about.[hash].js) that is only loaded when the route is visited.
Navigation Methods
Programmatic Navigation
Using Path
Using Named Routes
Using Router Link in Templates
Navigation Guards
While not implemented in the current router configuration, you can add navigation guards:Route Organization
The routes are organized into three main categories:Authentication
/- Login page
Photo Management
/docentes_pictures- Teachers photos/estudiantes_pictures- Students photos/estudiantes_pre_pictures- Pre-students photos
Individual Registration
/docentes_registro- Teacher registration/estudiantes_registro- Student registration/estudiantes_pre_registro- Pre-student registration
Other
/home- Dashboard/about- About page (lazy loaded)
Best Practices
Use Named Routes
Prefer named routes for better maintainability:Handle Navigation Errors
Check Current Route
Access Route Parameters
History Mode
The router uses HTML5 History mode (createWebHistory), which:
- Provides clean URLs without hash (
#) fragments - Requires server configuration to handle client-side routes
- Falls back to hash mode if the browser doesn’t support it
Server Configuration
For production, configure your server to serveindex.html for all routes:
Nginx example:
.htaccess):