# sergilozada/controlbienesraices-villahermosa architecture

> Architecture diagram of the GitHub repository sergilozada/controlbienesraices-villahermosa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sergilozada/controlbienesraices-villahermosa
- Repository: https://github.com/sergilozada/controlbienesraices-villahermosa

## Overview

Control Bienes Raíces is a real-estate administration app for client, lot, and installment tracking. Users enter through Firebase authentication by default (or choose local mode at /welcome), then use a dashboard to register and manage clients, track payments, and view delinquency reports, payment statistics, and income projections. The Firebase context owns cloud client operations; the local context maintains browser-local data. README capability statements support the feature branches, but unsampled implementation details and some dashboard wiring are not asserted.

Main entry points: [`src/context/FirebaseAuthContext.tsx`](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/context/FirebaseAuthContext.tsx) (Firebase auth and clients), [`src/pages/FirebaseDashboard.tsx`](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/FirebaseDashboard.tsx) (Cloud dashboard), [`src/pages/Dashboard.tsx`](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/Dashboard.tsx) (Local dashboard), [`src/components/ClientList.tsx`](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/ClientList.tsx) (Client and payment records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["App routing<br/>[App.tsx]"]
  node_firebase_login["Firebase login<br/>[FirebaseLogin.tsx]"]
  node_local_login["Local login<br/>[Login.tsx]"]
  node_firebase_dashboard["Cloud dashboard"]
  node_local_dashboard["Local dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_identity["Authentication and data"]
  node_firebase_auth["Firebase auth and clients"]
  node_local_auth["Local auth and clients<br/>[AuthContext.tsx]"]
  node_firebase_service["Firebase setup<br/>[firebase.ts]"]
end

subgraph group_clients["Client and payment management"]
  node_client_form["Client registration"]
  node_client_list["Client and payment records<br/>[ClientList.tsx]"]
  node_schedule["Payment schedule<br/>[paymentSchedule.ts]"]
  node_migration["Schedule migration rules"]
end

subgraph group_insights["Financial insights"]
  node_delinquency["Debtor report"]
  node_projection["Income projection<br/>[ProjectionView.tsx]"]
  node_stats["Payment statistics<br/>[StatsView.tsx]"]
end

subgraph group_shared["Shared interface"]
  node_ui["UI primitives"]
end

node_user(("Administrator"))
node_firebase_store[("Firebase services")]

node_user -->|"opens"| node_app
node_app -->|"routes unauthenticated"| node_firebase_login
node_app -->|"routes authenticated"| node_firebase_dashboard
node_app -->|"selects local mode"| node_local_login
node_app -->|"selects local mode"| node_local_dashboard
node_firebase_login -->|"authenticates with"| node_firebase_auth
node_local_login -->|"authenticates with"| node_local_auth
node_firebase_dashboard -->|"reads cloud state"| node_firebase_auth
node_local_dashboard -->|"reads local state"| node_local_auth
node_firebase_auth -->|"uses configuration"| node_firebase_service
node_firebase_auth -->|"reads and writes"| node_firebase_store
node_firebase_dashboard -->|"renders"| node_client_form
node_firebase_dashboard -->|"renders"| node_client_list
node_firebase_dashboard -->|"renders"| node_delinquency
node_firebase_dashboard -->|"renders"| node_projection
node_firebase_dashboard -->|"renders"| node_stats
node_local_dashboard -.->|"renders"| node_client_form
node_local_dashboard -->|"renders"| node_client_list
node_local_dashboard -->|"renders"| node_delinquency
node_local_dashboard -->|"renders"| node_projection
node_local_dashboard -->|"renders"| node_stats
node_client_form -->|"submits client data"| node_firebase_auth
node_client_list -->|"uses client state"| node_firebase_auth
node_client_list -->|"uses schedule rules"| node_schedule
node_client_list -->|"uses migration rules"| node_migration
node_delinquency -->|"reads client data"| node_firebase_auth
node_projection -->|"reads client data"| node_firebase_auth
node_stats -->|"reads client data"| node_firebase_auth
node_firebase_login -->|"uses controls"| node_ui
node_client_list -->|"uses controls"| node_ui

click node_app "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/App.tsx"
click node_firebase_login "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/FirebaseLogin.tsx"
click node_local_login "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/Login.tsx"
click node_firebase_dashboard "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/FirebaseDashboard.tsx"
click node_local_dashboard "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/Dashboard.tsx"
click node_firebase_auth "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/context/FirebaseAuthContext.tsx"
click node_local_auth "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/context/AuthContext.tsx"
click node_firebase_service "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/services/firebase.ts"
click node_client_form "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/FirebaseClientForm.tsx"
click node_client_list "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/ClientList.tsx"
click node_schedule "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/config/paymentSchedule.ts"
click node_migration "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/types/paymentMigration.ts"
click node_delinquency "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/DelinquentClientsReport.tsx"
click node_projection "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/ProjectionView.tsx"
click node_stats "https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/StatsView.tsx"
click node_ui "https://github.com/sergilozada/controlbienesraices-villahermosa/tree/main/src/components/ui"

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_app,node_firebase_login,node_local_login,node_firebase_dashboard,node_local_dashboard toneBlue
class node_firebase_auth,node_local_auth,node_firebase_service,node_firebase_store toneAmber
class node_client_form,node_client_list,node_schedule,node_migration toneMint
class node_delinquency,node_projection,node_stats toneRose
class node_ui,node_user toneIndigo
```

## Components

### Application entry

- [App routing](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/App.tsx): `src/App.tsx`
- [Firebase login](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/FirebaseLogin.tsx): `src/pages/FirebaseLogin.tsx`
- [Local login](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Cloud dashboard](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/FirebaseDashboard.tsx): `src/pages/FirebaseDashboard.tsx`
- [Local dashboard](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`

### Authentication and data

- [Firebase auth and clients](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/context/FirebaseAuthContext.tsx): `src/context/FirebaseAuthContext.tsx`
- [Local auth and clients](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Firebase setup](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/services/firebase.ts): `src/services/firebase.ts`

### Client and payment management

- [Client registration](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/FirebaseClientForm.tsx): `src/components/FirebaseClientForm.tsx`
- [Client and payment records](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/ClientList.tsx): `src/components/ClientList.tsx`
- [Payment schedule](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/config/paymentSchedule.ts): `src/config/paymentSchedule.ts`
- [Schedule migration rules](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/types/paymentMigration.ts): `src/types/paymentMigration.ts`

### Financial insights

- [Debtor report](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/DelinquentClientsReport.tsx): `src/components/DelinquentClientsReport.tsx`
- [Income projection](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/ProjectionView.tsx): `src/components/ProjectionView.tsx`
- [Payment statistics](https://github.com/sergilozada/controlbienesraices-villahermosa/blob/main/src/components/StatsView.tsx): `src/components/StatsView.tsx`

### Shared interface

- [UI primitives](https://github.com/sergilozada/controlbienesraices-villahermosa/tree/main/src/components/ui): `src/components/ui`

### Other components

- **Administrator**
- **Firebase services**

## Connections

- Administrator → App routing: opens (evidence: `src/App.tsx`)
- App routing → Firebase login: routes unauthenticated (evidence: `src/App.tsx`)
- App routing → Cloud dashboard: routes authenticated (evidence: `src/App.tsx`)
- App routing → Local login: selects local mode (evidence: `src/App.tsx`)
- App routing → Local dashboard: selects local mode (evidence: `src/App.tsx`)
- Firebase login → Firebase auth and clients: authenticates with (evidence: `src/pages/FirebaseLogin.tsx`)
- Local login → Local auth and clients: authenticates with (evidence: `src/pages/Login.tsx`)
- Cloud dashboard → Firebase auth and clients: reads cloud state (evidence: `src/pages/FirebaseDashboard.tsx`)
- Local dashboard → Local auth and clients: reads local state (evidence: `src/pages/Dashboard.tsx`)
- Firebase auth and clients → Firebase setup: uses configuration (evidence: `src/context/FirebaseAuthContext.tsx`)
- Firebase auth and clients → Firebase services: reads and writes (evidence: `src/context/FirebaseAuthContext.tsx`)
- Cloud dashboard → Client registration: renders (evidence: `src/pages/FirebaseDashboard.tsx`)
- Cloud dashboard → Client and payment records: renders (evidence: `src/pages/FirebaseDashboard.tsx`)
- Cloud dashboard → Debtor report: renders (evidence: `src/pages/FirebaseDashboard.tsx`)
- Cloud dashboard → Income projection: renders (evidence: `src/pages/FirebaseDashboard.tsx`)
- Cloud dashboard → Payment statistics: renders (evidence: `src/pages/FirebaseDashboard.tsx`)
- Local dashboard → Client registration: renders
- Local dashboard → Client and payment records: renders (evidence: `src/pages/Dashboard.tsx`)
- Local dashboard → Debtor report: renders (evidence: `src/pages/Dashboard.tsx`)
- Local dashboard → Income projection: renders (evidence: `src/pages/Dashboard.tsx`)
- Local dashboard → Payment statistics: renders (evidence: `src/pages/Dashboard.tsx`)
- Client registration → Firebase auth and clients: submits client data (evidence: `src/components/FirebaseClientForm.tsx`)
- Client and payment records → Firebase auth and clients: uses client state (evidence: `src/components/ClientList.tsx`)
- Client and payment records → Payment schedule: uses schedule rules (evidence: `src/components/ClientList.tsx`)
- Client and payment records → Schedule migration rules: uses migration rules (evidence: `src/components/ClientList.tsx`)
- Debtor report → Firebase auth and clients: reads client data (evidence: `src/components/DelinquentClientsReport.tsx`)
- Income projection → Firebase auth and clients: reads client data (evidence: `src/components/ProjectionView.tsx`)
- Payment statistics → Firebase auth and clients: reads client data (evidence: `src/components/StatsView.tsx`)
- Firebase login → UI primitives: uses controls (evidence: `src/pages/FirebaseLogin.tsx`)
- Client and payment records → UI primitives: uses controls (evidence: `src/components/ClientList.tsx`)
