# avadatrum/hotel-pipa architecture

> Architecture diagram of the GitHub repository avadatrum/hotel-pipa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/avadatrum/hotel-pipa
- Repository: https://github.com/avadatrum/hotel-pipa

## Overview

1. **What this repo is**
   - A **React + TypeScript** single-page application built with **Vite**.
   - It appears to be an internal operational dashboard for **apartments, commissions/sales, documents, receipts, audit logs, and tide table data (“Tábua de Maré”)**.
   - The app uses **Firebase** as its main backend.

2. **Frontend application boundary**
   - The main client lives under `src/`.
   - `src/main.tsx` bootstraps the app, while `src/routes/index.tsx` defines navigation structure.
   - `src/pages/` contains route-level screens, and `src/components/` contains reusable UI and feature widgets.
   - Styling is handled by **Tailwind CSS** plus `src/styles/index.css`.

3. **Core backend/data platform**
   - Firebase is the architectural center:
     - `src/services/firebase.ts` configures client access.
     - `firestore.rules` and `firestore.indexes.json` define security and query support.
     - `firebase.json` and `.firebaserc` wire the project to Firebase hosting/resources.
   - There is also a **Cloud Functions** backend in `functions/`, suggesting server-side logic for privileged operations or integrations.

4. **Server-side functions boundary**
   - `functions/src/index.ts` is the entry point for Firebase Cloud Functions.
   - This layer likely handles trusted workflows that should not run in the browser, such as administrative actions, audit-sensitive updates, or Firestore triggers.
   - The presence of `functions/package.json` and its own TypeScript config indicates it is deployed independently from the frontend.

5. **Feature domains in the UI**
   - The app is organized by business domain rather than by technical layer:
     - `ApartmentsPage.tsx` and apartment-related components/services.
     - `commissions/` pages, components, hooks, and utilities for commission management.
     - `TabuaDeMarePage.tsx` and `TabuaMareWidget.tsx` for tide data.
     - `DocumentsPage.tsx`, `ReceiptsPage.tsx`, `AdminUsersPage.tsx`, `LogPage.tsx`, and `DashboardPage.tsx` for operational/admin workflows.
   - This suggests a dashboard with several tightly related internal modules.

6. **State and cross-cutting contexts**
   - Global app state is managed with React contexts in `src/contexts/`:
     - `AuthContext.tsx` for authentication/session state.
     - `CommissionContext.tsx` for commission-related shared state.
     - `ThemeContext.tsx` for UI theme handling.
   - These contexts form the state layer that many pages and hooks consume.

7. **Custom hooks as the main integration layer**
   - `src/hooks/` contains the app’s primary data-access and behavior abstractions.
   - Important examples:
     - `useAuth`, `usePermission`, `ProtectedRoute`, `AdminRoute` for access control.
     - `useFirestore`, `useApartments`, `useApartmentActions`, `useTours`, `useTabuaMare` for Firestore-backed domain data.
     - `useNavigation` and `useToast` for UX flow.
   - This indicates the app separates UI rendering from data-fetching/business interactions via hooks.

8. **Service layer and business logic**
   - `src/services/` contains the repository’s backend-facing business logic:
     - `authService.ts`, `commissionService.ts`, `apartmentService.ts`, `auditService.ts`, `tabuaMareService.ts`, `seedService.ts`.
   - These services are the main boundary between UI code and Firebase/Firestore.
   - `src/utils/commissionCalculations.ts` holds domain calculations, likely used by commission dashboards and sales registration flows.

9. **Commission module structure**
   - The `src/components/commissions/` folder is a substantial subsystem with its own UI composition:
     - dashboards, filters, tables, charts, forms, modals, rankings, and pagination.
   - Corresponding pages in `src/pages/commissions/` indicate this is a major product area:
     - `CommissionDashboard.tsx`
     - `CommissionSettings.tsx`
     - `CommissionsPage.tsx`
     - `RegisterSalePage.tsx`
   - `src/types/commission.types.ts` supports this module’s data model.

10. **Authentication and authorization flow**
   - User access is guarded at the routing/component level by `ProtectedRoute.tsx` and `AdminRoute.tsx`.
   - `AuthContext` plus `usePermission` suggest role-based access control, likely tied to Firebase auth and Firestore user records.
   - `src/pages/LoginPage.tsx` is the entry point for unauthenticated users.

11. **Data seeding and operational scripts**
   - `scripts/seedTours.ts` and `src/services/seedService.ts` indicate seeded data workflows for commissions/tours.
   - These scripts are separate from the runtime UI and are likely used during setup or test data population.

12. **Public assets and app shell**
   - `public/` and `src/assets/` hold static resources.
   - Shared shell components such as `Layout.tsx`, `Footer.tsx`, `UserMenu.tsx`, `Toast.tsx`, and `Button.tsx` compose the common UI frame around the routed pages.

13. **Deployment and tooling**
   - The repo is set up for modern frontend build/deploy tooling:
     - `vite.config.ts` for bundling.
     - `tailwind.config.js`, `postcss.config.js`, and `eslint.config.js` for styling and code quality.
     - `vercel.json` suggests frontend deployment on Vercel.
     - Firebase deployment config suggests backend and/or hosting deployment through Firebase as well.

14. **Architecture summary for diagramming**
   - The clean way to draw this repo is:
     - **Browser SPA** at the center.
     - **Route pages** on top.
     - **Shared contexts/hooks/services** as the middle layer.
     - **Firebase Auth + Firestore** as the primary data store and identity provider.
     - **Cloud Functions** as the trusted server-side extension.
     - **Auxiliary scripts** for seeding/admin tasks.
   - The dominant boundary is between the React client and Firebase services, with commissions as the largest business subsystem.

Main entry points: [`src/routes/index.tsx`](https://github.com/avadatrum/hotel-pipa/blob/main/src/routes/index.tsx) (Routes), [`src/services/firebase.ts`](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/firebase.ts) (Firebase client), [`src/pages/commissions/CommissionsPage.tsx`](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionsPage.tsx) (Commissions), [`src/pages/commissions/CommissionDashboard.tsx`](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionDashboard.tsx) (Commission dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend_shell["Frontend shell"]
  node_src_main["App bootstrap<br/>vite entry<br/>[main.tsx]"]
  node_src_routes["Routes<br/>navigation map<br/>[index.tsx]"]
  node_src_layout["Layout<br/>shell component<br/>[Layout.tsx]"]
  node_src_protected_route["Protected route<br/>auth guard<br/>[ProtectedRoute.tsx]"]
  node_src_admin_route["Admin route<br/>role guard<br/>[AdminRoute.tsx]"]
end

subgraph group_feature_pages["Feature pages"]
  node_src_login_page["Login<br/>auth page<br/>[LoginPage.tsx]"]
  node_src_dashboard_page["Dashboard<br/>overview page<br/>[DashboardPage.tsx]"]
  node_src_apartments_page["Apartments<br/>domain page<br/>[ApartmentsPage.tsx]"]
  node_src_documents_page["Documents<br/>domain page<br/>[DocumentsPage.tsx]"]
  node_src_receipts_page["Receipts<br/>domain page<br/>[ReceiptsPage.tsx]"]
  node_src_admin_users_page["Users<br/>admin page<br/>[AdminUsersPage.tsx]"]
  node_src_log_page["Audit log<br/>ops page<br/>[LogPage.tsx]"]
  node_src_tide_page["Tide data<br/>domain page"]
end

subgraph group_commission_domain["Commission domain"]
  node_src_commissions_page["Commissions<br/>domain page"]
  node_src_commission_dashboard["Commission dashboard<br/>analytics page"]
  node_src_commission_settings["Commission settings<br/>settings page"]
  node_src_register_sale_page["Register sale<br/>workflow page"]
  node_src_commission_widgets["Commission UI<br/>feature widgets"]
end

subgraph group_shared_state["Shared state"]
  node_src_auth_context(("Auth state<br/>react context<br/>[AuthContext.tsx]"))
  node_src_commission_context(("Commission state<br/>react context"))
  node_src_use_firestore(("Firestore hook<br/>data hook<br/>[useFirestore.ts]"))
  node_src_use_permission(("Permission hook<br/>auth hook<br/>[usePermission.ts]"))
end

subgraph group_backend_firebase["Firebase backend"]
  node_src_commission_service["Commission service<br/>business service"]
  node_src_apartment_service["Apartment service<br/>business service"]
  node_src_audit_service["Audit service<br/>business service<br/>[auditService.ts]"]
  node_src_tide_service["Tide service<br/>business service"]
  node_src_firebase_client["Firebase client<br/>firebase config<br/>[firebase.ts]"]
  node_firestore_rules["Firestore rules<br/>security policy<br/>[firestore.rules]"]
  node_functions_index["Cloud functions<br/>serverless backend<br/>[index.ts]"]
end

subgraph group_ops_tooling["Ops tooling"]
  node_scripts_seed_tours["Seed tours<br/>ops script<br/>[seedTours.ts]"]
end

node_src_main -->|"boots"| node_src_routes
node_src_main -->|"mounts"| node_src_layout
node_src_main -->|"provides"| node_src_auth_context
node_src_routes -->|"routes to"| node_src_login_page
node_src_routes -->|"routes to"| node_src_dashboard_page
node_src_routes -->|"routes to"| node_src_apartments_page
node_src_routes -->|"routes to"| node_src_documents_page
node_src_routes -->|"routes to"| node_src_receipts_page
node_src_routes -->|"routes to"| node_src_admin_users_page
node_src_routes -->|"routes to"| node_src_log_page
node_src_routes -->|"routes to"| node_src_tide_page
node_src_routes -->|"routes to"| node_src_commissions_page
node_src_routes -->|"guards"| node_src_protected_route
node_src_routes -->|"guards"| node_src_admin_route
node_src_protected_route -->|"reads"| node_src_auth_context
node_src_admin_route -->|"reads"| node_src_auth_context
node_src_admin_route -->|"checks"| node_src_use_permission
node_src_layout -->|"frames"| node_src_dashboard_page
node_src_layout -->|"frames"| node_src_apartments_page
node_src_commissions_page -->|"shows"| node_src_commission_dashboard
node_src_commissions_page -->|"links"| node_src_commission_settings
node_src_commissions_page -->|"links"| node_src_register_sale_page
node_src_commission_dashboard -->|"composes"| node_src_commission_widgets
node_src_commission_dashboard -->|"consumes"| node_src_commission_context
node_src_commission_widgets -->|"consumes"| node_src_commission_context
node_src_dashboard_page -->|"links to"| node_src_commission_dashboard
node_src_auth_context -->|"auths with"| node_src_firebase_client
node_src_use_firestore -->|"reads from"| node_src_firebase_client
node_src_commission_service -->|"uses"| node_src_firebase_client
node_src_apartment_service -->|"uses"| node_src_firebase_client
node_src_audit_service -->|"uses"| node_src_firebase_client
node_src_tide_service -->|"uses"| node_src_firebase_client
node_src_commissions_page -->|"fetches"| node_src_commission_service
node_src_commission_dashboard -->|"fetches"| node_src_commission_service
node_src_register_sale_page -->|"writes"| node_src_commission_service
node_src_apartments_page -->|"fetches"| node_src_apartment_service
node_src_log_page -->|"fetches"| node_src_audit_service
node_src_tide_page -->|"fetches"| node_src_tide_service
node_src_login_page -->|"updates"| node_src_auth_context
node_firestore_rules -->|"constrains"| node_src_firebase_client
node_functions_index -->|"trusts"| node_firestore_rules
node_scripts_seed_tours -->|"seeds"| node_src_commission_service

click node_src_main "https://github.com/avadatrum/hotel-pipa/blob/main/src/main.tsx"
click node_src_routes "https://github.com/avadatrum/hotel-pipa/blob/main/src/routes/index.tsx"
click node_src_layout "https://github.com/avadatrum/hotel-pipa/blob/main/src/components/Layout.tsx"
click node_src_protected_route "https://github.com/avadatrum/hotel-pipa/blob/main/src/components/ProtectedRoute.tsx"
click node_src_admin_route "https://github.com/avadatrum/hotel-pipa/blob/main/src/components/AdminRoute.tsx"
click node_src_login_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/LoginPage.tsx"
click node_src_dashboard_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/DashboardPage.tsx"
click node_src_apartments_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/ApartmentsPage.tsx"
click node_src_documents_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/DocumentsPage.tsx"
click node_src_receipts_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/ReceiptsPage.tsx"
click node_src_admin_users_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/AdminUsersPage.tsx"
click node_src_log_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/LogPage.tsx"
click node_src_tide_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/TabuaDeMarePage.tsx"
click node_src_commissions_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionsPage.tsx"
click node_src_commission_dashboard "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionDashboard.tsx"
click node_src_commission_settings "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionSettings.tsx"
click node_src_register_sale_page "https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/RegisterSalePage.tsx"
click node_src_commission_widgets "https://github.com/avadatrum/hotel-pipa/blob/main/src/components/commissions/CommissionCharts.tsx"
click node_src_auth_context "https://github.com/avadatrum/hotel-pipa/blob/main/src/contexts/AuthContext.tsx"
click node_src_commission_context "https://github.com/avadatrum/hotel-pipa/blob/main/src/contexts/CommissionContext.tsx"
click node_src_use_firestore "https://github.com/avadatrum/hotel-pipa/blob/main/src/hooks/useFirestore.ts"
click node_src_use_permission "https://github.com/avadatrum/hotel-pipa/blob/main/src/hooks/usePermission.ts"
click node_src_commission_service "https://github.com/avadatrum/hotel-pipa/blob/main/src/services/commissionService.ts"
click node_src_apartment_service "https://github.com/avadatrum/hotel-pipa/blob/main/src/services/apartmentService.ts"
click node_src_audit_service "https://github.com/avadatrum/hotel-pipa/blob/main/src/services/auditService.ts"
click node_src_tide_service "https://github.com/avadatrum/hotel-pipa/blob/main/src/services/tabuaMareService.ts"
click node_src_firebase_client "https://github.com/avadatrum/hotel-pipa/blob/main/src/services/firebase.ts"
click node_firestore_rules "https://github.com/avadatrum/hotel-pipa/blob/main/firestore.rules"
click node_functions_index "https://github.com/avadatrum/hotel-pipa/blob/main/functions/src/index.ts"
click node_scripts_seed_tours "https://github.com/avadatrum/hotel-pipa/blob/main/scripts/seedTours.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_src_main,node_src_routes,node_src_layout,node_src_protected_route,node_src_admin_route toneBlue
class node_src_login_page,node_src_dashboard_page,node_src_apartments_page,node_src_documents_page,node_src_receipts_page,node_src_admin_users_page,node_src_log_page,node_src_tide_page toneAmber
class node_src_commissions_page,node_src_commission_dashboard,node_src_commission_settings,node_src_register_sale_page,node_src_commission_widgets toneMint
class node_src_auth_context,node_src_commission_context,node_src_use_firestore,node_src_use_permission toneRose
class node_src_commission_service,node_src_apartment_service,node_src_audit_service,node_src_tide_service,node_src_firebase_client,node_firestore_rules,node_functions_index toneIndigo
class node_scripts_seed_tours toneTeal
```

## Components

### Frontend shell

React entry, routing, layout, and access control around the SPA.

- [App bootstrap](https://github.com/avadatrum/hotel-pipa/blob/main/src/main.tsx): vite entry · Bootstraps the client application. · `src/main.tsx`
- [Routes](https://github.com/avadatrum/hotel-pipa/blob/main/src/routes/index.tsx): navigation map · Defines the SPA route structure and page boundaries. · `src/routes/index.tsx`
- [Layout](https://github.com/avadatrum/hotel-pipa/blob/main/src/components/Layout.tsx): shell component · Shared page frame and navigation chrome. · `src/components/Layout.tsx`
- [Protected route](https://github.com/avadatrum/hotel-pipa/blob/main/src/components/ProtectedRoute.tsx): auth guard · Blocks unauthenticated access to private areas. · `src/components/ProtectedRoute.tsx`
- [Admin route](https://github.com/avadatrum/hotel-pipa/blob/main/src/components/AdminRoute.tsx): role guard · Restricts admin-only screens and actions. · `src/components/AdminRoute.tsx`

### Feature pages

Route-level screens for the main operational areas.

- [Login](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/LoginPage.tsx): auth page · Entry point for unauthenticated users. · `src/pages/LoginPage.tsx`
- [Dashboard](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/DashboardPage.tsx): overview page · Operational landing screen. · `src/pages/DashboardPage.tsx`
- [Apartments](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/ApartmentsPage.tsx): domain page · Apartment management screen. · `src/pages/ApartmentsPage.tsx`
- [Documents](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/DocumentsPage.tsx): domain page · Document workflow screen. · `src/pages/DocumentsPage.tsx`
- [Receipts](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/ReceiptsPage.tsx): domain page · Receipt and payment screen. · `src/pages/ReceiptsPage.tsx`
- [Users](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/AdminUsersPage.tsx): admin page · Administrative user management screen. · `src/pages/AdminUsersPage.tsx`
- [Audit log](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/LogPage.tsx): ops page · Audit and activity history screen. · `src/pages/LogPage.tsx`
- [Tide data](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/TabuaDeMarePage.tsx): domain page · Tábua de Maré screen. · `src/pages/TabuaDeMarePage.tsx`

### Commission domain

Commission-specific UI, state, and business flow.

- [Commissions](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionsPage.tsx): domain page · Commission management entry page. · `src/pages/commissions/CommissionsPage.tsx`
- [Commission dashboard](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionDashboard.tsx): analytics page · Primary commission analytics and controls. · `src/pages/commissions/CommissionDashboard.tsx`
- [Commission settings](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/CommissionSettings.tsx): settings page · Configuration area for commission rules and preferences. · `src/pages/commissions/CommissionSettings.tsx`
- [Register sale](https://github.com/avadatrum/hotel-pipa/blob/main/src/pages/commissions/RegisterSalePage.tsx): workflow page · Sales registration flow for commissions. · `src/pages/commissions/RegisterSalePage.tsx`
- [Commission UI](https://github.com/avadatrum/hotel-pipa/blob/main/src/components/commissions/CommissionCharts.tsx): feature widgets · Dashboards, tables, filters, charts, and forms for commission workflows. · `src/components/commissions/CommissionCharts.tsx`

### Shared state

Contexts and hooks used across multiple screens.

- [Auth state](https://github.com/avadatrum/hotel-pipa/blob/main/src/contexts/AuthContext.tsx): react context · Session and identity state for the app. · `src/contexts/AuthContext.tsx`
- [Commission state](https://github.com/avadatrum/hotel-pipa/blob/main/src/contexts/CommissionContext.tsx): react context · Shared commission workflow state. · `src/contexts/CommissionContext.tsx`
- [Firestore hook](https://github.com/avadatrum/hotel-pipa/blob/main/src/hooks/useFirestore.ts): data hook · General Firestore access abstraction used by feature hooks. · `src/hooks/useFirestore.ts`
- [Permission hook](https://github.com/avadatrum/hotel-pipa/blob/main/src/hooks/usePermission.ts): auth hook · Role and access checks used by guarded screens. · `src/hooks/usePermission.ts`

### Firebase backend

Firebase client, security rules, and server-side extensions.

- [Commission service](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/commissionService.ts): business service · Backend-facing commission logic and data access. · `src/services/commissionService.ts`
- [Apartment service](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/apartmentService.ts): business service · Apartment data access and updates. · `src/services/apartmentService.ts`
- [Audit service](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/auditService.ts): business service · Audit log persistence and retrieval. · `src/services/auditService.ts`
- [Tide service](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/tabuaMareService.ts): business service · Tábua de Maré data integration. · `src/services/tabuaMareService.ts`
- [Firebase client](https://github.com/avadatrum/hotel-pipa/blob/main/src/services/firebase.ts): firebase config · Initializes the Firebase client used by services and hooks. · `src/services/firebase.ts`
- [Firestore rules](https://github.com/avadatrum/hotel-pipa/blob/main/firestore.rules): security policy · Server-enforced database access rules. · `firestore.rules`
- [Cloud functions](https://github.com/avadatrum/hotel-pipa/blob/main/functions/src/index.ts): serverless backend · Firebase Functions entry point for trusted workflows. · `functions/src/index.ts`

### Ops tooling

Scripts and deployment/build configuration supporting the app.

- [Seed tours](https://github.com/avadatrum/hotel-pipa/blob/main/scripts/seedTours.ts): ops script · Data seeding utility for tours/commission workflows. · `scripts/seedTours.ts`

## Connections

- App bootstrap → Routes: boots · App startup hands off to routing.
- App bootstrap → Layout: mounts · App shell is mounted around routed content.
- App bootstrap → Auth state: provides · Global auth state is initialized at the top level.
- Routes → Login: routes to · Public entry screen.
- Routes → Dashboard: routes to · Default operational overview.
- Routes → Apartments: routes to · Apartment workflow screen.
- Routes → Documents: routes to · Document workflow screen.
- Routes → Receipts: routes to · Receipts workflow screen.
- Routes → Users: routes to · Admin-only user management.
- Routes → Audit log: routes to · Audit log screen.
- Routes → Tide data: routes to · Tide data screen.
- Routes → Commissions: routes to · Commission domain entry.
- Routes → Protected route: guards · Private screens are protected.
- Routes → Admin route: guards · Admin screens are role-checked.
- Protected route → Auth state: reads · Authentication state is required for private access.
- Admin route → Auth state: reads · Role checks depend on auth state.
- Admin route → Permission hook: checks · Permission logic backs admin gating.
- Layout → Dashboard: frames · Shared chrome wraps the dashboard and related screens.
- Layout → Apartments: frames · Shared chrome wraps domain pages.
- Commissions → Commission dashboard: shows · Main commission page surfaces the analytics dashboard.
- Commissions → Commission settings: links · Commission entry page exposes settings.
- Commissions → Register sale: links · Commission entry page exposes sale registration.
- Commission dashboard → Commission UI: composes · Dashboard is built from specialized commission widgets.
- Commission dashboard → Commission state: consumes · Shared commission state feeds the dashboard.
- Commission UI → Commission state: consumes · Widgets share commission state.
- Dashboard → Commission dashboard: links to · Dashboard exposes commission operations as a major area.
- Auth state → Firebase client: auths with · Authentication is backed by Firebase.
- Firestore hook → Firebase client: reads from · General Firestore access goes through the Firebase client.
- Commission service → Firebase client: uses · Commission data access is built on Firebase.
- Apartment service → Firebase client: uses · Apartment data access is built on Firebase.
- Audit service → Firebase client: uses · Audit persistence is built on Firebase.
- Tide service → Firebase client: uses · Tide data integration is built on Firebase.
- Commissions → Commission service: fetches · Commission UI depends on commission data operations.
- Commission dashboard → Commission service: fetches · Dashboard queries commission data.
- Register sale → Commission service: writes · Sale registration persists through commission services.
- Apartments → Apartment service: fetches · Apartment screen uses apartment data operations.
- Audit log → Audit service: fetches · Audit log screen uses audit data operations.
- Tide data → Tide service: fetches · Tide screen uses the tide service.
- Login → Auth state: updates · Login updates authentication state.
- Firestore rules → Firebase client: constrains · Client operations are governed by Firestore security rules.
- Cloud functions → Firestore rules: trusts · Cloud Functions operate alongside database security policy.
- Seed tours → Commission service: seeds · Seed script populates commission/tour-related data.
