How erwinfloresmarca/client-hoteles works
Purpose and runtime
This is a Vue 3 + TypeScript single-page administrative application, built and served with Vite and using Element Plus UI components. It adapts the upstream admin template into domain modules for categories, people, rooms, salons, status, and a “cuaderno de novedades” (incident/news log). Browser entry is index.html, which loads src/main.ts; the root component is src/App.vue.
Application bootstrap
src/main.ts initializes the Vue application and attaches global application concerns. src/App.vue hosts the routed application. Environment-specific build/serve behavior is supplied through Vite and environment files:
• src/main.ts
• src/App.vue
• vite.config.ts
• .env.build, .env.serve-dev, .env.serve-prod
Routing, authentication, and authorization
The router defines navigation and feature routes, with route groups for administration and users. A permission layer coordinates access control and likely dynamic route/menu availability from application state. Login, redirect, and unauthorized/not-found views form the authentication and failure boundaries.
• src/router/index.ts
• src/router/modules/administracion.ts
• src/router/modules/user.ts
• src/permission.ts
• src/directive/permission.ts
• src/views/login/Login.vue
State and session boundary
Centralized store modules maintain app UI state, authenticated-user state, route permissions, and visited tags. Authentication utilities and request infrastructure sit at the boundary between browser session state and backend API calls.
• src/store/index.ts
• src/store/modules/user.ts
• src/store/modules/permission.ts
• src/store/modules/app.ts
• src/utils/auth.ts
• src/utils/axiosReq.ts
Admin shell and navigation
Authenticated routes render within a reusable application shell: sidebar, navbar, breadcrumbs, main content outlet, and tags/visited-view navigation. This separates global navigation/chrome from feature-page rendering and handles responsive layout behavior.
• src/layout/Layout.vue
• src/layout/components/AppMain.vue
• src/layout/components/Navbar.vue
• src/layout/components/Sidebar/Sidebar.vue
• src/layout/components/TagsView/index.vue
• src/layout/hook/ResizeHandler.ts
API and domain features
src/api is the client-facing domain API layer, organized by backend resource rather than page. Views consume those APIs to implement CRUD-style administration for core entities; dialogs and selection components encapsulate feature-local editing and lookup UI. Shared API resource typing defines the transport contract.
• src/api/resource.ts
• src/api/persona.ts
• src/api/habitacion.ts
• src/api/salon.ts
• src/api/cuadernoDeNovedad.ts
• src/types/apiResources.ts
Primary user workflows
Feature pages are organized as domain roots with nested components for forms, lists, and selectors. The notable workflow is creating and reviewing novedades; other modules manage categorized people and physical-space records. Pagination/filtering are shared UI-level mechanisms, not backend ownership.
• src/views/cuadernoDeNovedades/index.vue
• src/views/cuadernoDeNovedades/components/CuadernoDeNovedades.vue
• src/views/persona/index.vue
• src/views/habitacion/index.vue
• src/views/salon/index.vue
• src/components/FilterResource/index.vue
Cross-cutting UI and error handling
Global styles, icons, filters, mixins, directives, and hooks provide reusable presentation and behavioral conventions. Error logging is exposed as an application feature; WebSocket support is suggested by a shared mixin, but its external endpoint and integration are not identifiable from the supplied tree.
• src/hooks/errorLogHook.ts
• src/views/error-log/ErrorLog.vue
• src/mixins/websocketMixin.js
• src/icons/SvgIcon.vue
• src/styles/index.scss
Main entry points: axiosReq.ts Session & HTTP client · index.ts Router · AppMain.vue Feature outlet · Layout.vue Authenticated layout
Components 20
Bootstrap
- Vite build/serve · Environment-specific SPA build and development server.
vite.config.ts - Vue entry
src/main.ts - Root application
src/App.vue
Access & State
- Router · Defines application and feature navigation routes.
src/router/index.ts - Route modules · Administration and user route groups.
src/router/modules/administracion.ts - Permission layer · Coordinates authorization and route/menu availability.
src/permission.ts - Application stores · User, permission, UI, and visited-tag state.
src/store/index.ts - Session & HTTP client · Authentication utilities and Axios request infrastructure.
src/utils/axiosReq.ts - Login
src/views/login/Login.vue
Admin Shell
- Authenticated layout · Responsive chrome for authenticated feature routes.
src/layout/Layout.vue - Navigation chrome · Sidebar, navbar, breadcrumbs, and visited tags.
src/layout/components/Sidebar/Sidebar.vue - Feature outlet
src/layout/components/AppMain.vue
Domain Features
- Resource API layer · Resource-oriented client contract for domain CRUD calls.
src/api/resource.ts - Novedades API
src/api/cuadernoDeNovedad.ts - Cuaderno de novedades · Create and review incident/news log records.
src/views/cuadernoDeNovedades/index.vue - People management
src/views/persona/index.vue - Rooms & salons · Physical-space administration.
src/views/habitacion/index.vue - Resource filtering · Shared pagination and filtering UI.
src/components/FilterResource/index.vue
Other components
- Backend API
- Error log
src/views/error-log/ErrorLog.vue
Connections 22
- Vite build/serve → Vue entry: builds and serves
- Vue entry → Root application: mounts
- Root application → Router: hosts
- Router → Route modules: loads
- Router → Permission layer: guarded by
- Permission layer → Application stores: uses access state
- Login → Session & HTTP client: authenticates through
- Session & HTTP client → Application stores: updates session state
- Session & HTTP client → Backend API: sends requests
- Router → Authenticated layout: renders authenticated routes in
- Authenticated layout → Navigation chrome: composes
- Authenticated layout → Feature outlet: contains
- Feature outlet → Cuaderno de novedades: renders
- Feature outlet → People management: renders
- Feature outlet → Rooms & salons: renders
- Cuaderno de novedades → Novedades API: uses
- People management → Resource API layer: uses
- Rooms & salons → Resource API layer: uses
- Resource API layer → Session & HTTP client: uses HTTP client
- Novedades API → Session & HTTP client: uses HTTP client
- Cuaderno de novedades → Resource filtering: uses
- Error log → Application stores: reads application errors