How hotelsfidato-ai/crs works
Purpose and Runtime
Fidato is a Phase 1 internal hospitality CRS/ERP frontend for CRM, reservations, hotel inventory/rates, finance, reports, automation, and administration. It is a Vite-served React 19 TypeScript SPA with no backend or authentication; all interactions use deterministic simulated data that resets on refresh. Primary bootstrap and route entry points are src/main.tsx and src/routes.tsx.
Application Shell and Navigation
The routed application is framed by a shared operational shell: sidebar navigation, top bar, role switcher, command palette, and AI panel. This is the principal cross-feature control boundary, including simulated “Viewing as…” role context rather than login.
• src/components/app/AppShell.tsx
• src/components/app/navigation.ts
• src/components/app/RoleSwitcher.tsx
Routing, Access, and Failure States
src/routes.tsx maps the feature pages into the SPA. Authorization is client-side and driven by role/permission rules; forbidden, missing-route, and route-loading/error fallback states are isolated in the shared feature area. This is presentation-level enforcement only until real authentication arrives.
• src/routes.tsx
• src/lib/permissions.ts
• src/features/shared/Forbidden.tsx
Data Boundary: Repositories and Deterministic Mock State
Feature screens should consume the repository layer rather than directly owning persistence behavior. The current repository implementation is an in-memory mock store populated from fixed seed data, creating repeatable review flows and reset-on-refresh semantics. This is the intended Phase 2 swap boundary for Firestore-backed implementations.
• src/data/repositories/index.ts
• src/data/repositories/mock/store.ts
• src/data/seed/index.ts
Core Domain Feature Areas
The UI is organized by business capability, with route-level pages covering the major operating workflows: CRM entities and imports/merges; reservations, calendar, approvals, and booking details; partner hotel profiles, inventory, and rates; and finance invoices, payments, and commissions.
• src/features/crm/CustomersPage.tsx
• src/features/reservations/ReservationsPage.tsx
• src/features/hotels/InventoryPage.tsx
• src/features/finance/InvoicesPage.tsx
Analytics, Automation, AI, and Administration
Dashboard and reporting pages expose operational reporting, including occupancy, revenue, sales, forecast, and hotel views. Separate areas represent automation workflows/runs, simulated AI interactions, notifications/templates, and administrative users, roles, settings, integrations, and audit logs. These are frontend workflows today, not connected service integrations.
• src/features/reports/ReportShell.tsx
• src/features/automation/WorkflowsPage.tsx
• src/features/ai/AiPage.tsx
• src/features/admin/IntegrationsPage.tsx
Shared UI System and Future Infrastructure
A reusable UI layer supplies form controls, tables, filtering, overlays, status indicators, and feedback states; global styling and design tokens live separately. The material runtime stack includes React Router, TanStack Query, Zustand, Radix UI, react-hook-form/Zod, Recharts, Tailwind v4, and Vite. Planned infrastructure—not present in this build—is Firebase (Firestore, Auth, Functions, Storage), followed by n8n automation wiring.
• src/components/ui/index.ts
• src/styles/theme.css
• docs/data-model.md
Main entry points: routes.tsx Route map · index.ts Repository contracts · AppShell.tsx Operational shell · permissions.ts Client permissions
Components 21
SPA Runtime
- Vite bootstrap · Starts the React SPA.
src/main.tsx
Application Control
- Route map · Maps feature pages and route fallbacks.
src/routes.tsx - Operational shell · Frames routes with navigation, top bar, command palette, and AI panel.
src/components/app/AppShell.tsx - Navigation model
src/components/app/navigation.ts - Role switcher · Provides the “Viewing as…” context.
src/components/app/RoleSwitcher.tsx - Client permissions · Presentation-level route authorization.
src/lib/permissions.ts - Route failure states · Includes forbidden and missing/error route states.
src/features/shared/Forbidden.tsx
Data Boundary
- Repository contracts · Phase 2 swap point for Firestore implementations.
src/data/repositories/index.ts - In-memory mock store · State resets on refresh.
src/data/repositories/mock/store.ts - Fixed seed data · Makes review flows repeatable.
src/data/seed/index.ts
Business Features
- CRM · Customers, imports, and merges.
src/features/crm/CustomersPage.tsx - Reservations · Bookings, calendar, approvals, and details.
src/features/reservations/ReservationsPage.tsx - Hotel inventory · Partner profiles, inventory, and rates.
src/features/hotels/InventoryPage.tsx - Finance · Invoices, payments, and commissions.
src/features/finance/InvoicesPage.tsx - Reports · Operational occupancy, revenue, sales, forecast, and hotel reporting.
src/features/reports/ReportShell.tsx - Automation · Simulated workflows and runs.
src/features/automation/WorkflowsPage.tsx - AI and administration · Simulated AI plus integrations, users, roles, settings, and audit administration.
src/features/ai/AiPage.tsx - Integration admin · Frontend-only integration management.
src/features/admin/IntegrationsPage.tsx
Shared Platform
- Shared UI system · Controls, tables, filters, overlays, indicators, and feedback.
src/components/ui/index.ts - Theme and tokens
src/styles/theme.css - Future data model · Documents the future Firebase-backed architecture.
docs/data-model.md
Connections 23
- Vite bootstrap → Route map: mounts
- Route map → Operational shell: frames routes
- Operational shell → Navigation model: uses
- Operational shell → Role switcher: hosts
- Route map → Client permissions: checks access
- Client permissions → Route failure states: denies to
- Route map → CRM: routes to
- Route map → Reservations: routes to
- Route map → Hotel inventory: routes to
- Route map → Finance: routes to
- Route map → Reports: routes to
- Route map → Automation: routes to
- Route map → AI and administration: routes to
- AI and administration → Integration admin: includes
- CRM → Repository contracts: reads and writes
- Reservations → Repository contracts: reads and writes
- Hotel inventory → Repository contracts: reads and writes
- Finance → Repository contracts: reads and writes
- Reports → Repository contracts: reads
- Repository contracts → In-memory mock store: implemented by
- In-memory mock store → Fixed seed data: initialized from
- Shared UI system → Theme and tokens: styled by
- Repository contracts → Future data model: planned evolution