# ozcaredo89/allatyou-renting-hub architecture

> Architecture diagram of the GitHub repository ozcaredo89/allatyou-renting-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ozcaredo89/allatyou-renting-hub
- Repository: https://github.com/ozcaredo89/allatyou-renting-hub

## Overview

AllAtYou Renting Hub is a fleet-rental operations and finance platform: drivers submit payments and supporting documents, while administrators manage expenses, advances, vehicles, and operational records and review financial reports. The README documents the payment, expense-proration, ledger, and profit workflow; the sampled API bootstrap confirms route mounting, and the sampled Oráculo code shows a separate telemetry-to-event workflow. Many route and page implementations were not sampled, so links for those features are limited to documented behavior and explicit bootstrap wiring.

Main entry points: [`src/index.ts`](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/index.ts) (Express API), [`src/lib/supabase.ts`](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/lib/supabase.ts) (Supabase client), [`web/src/App.tsx`](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/App.tsx) (Web router), [`src/oraculo/index.ts`](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/index.ts) (Oráculo daemon)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_app["Web router<br/>[App.tsx]"]
  node_pay_ui["Payment page<br/>[Pay.tsx]"]
  node_expenses_ui["Expenses page<br/>[Expenses.tsx]"]
  node_reports_ui["Reports page<br/>[Reports.tsx]"]
  node_advances_ui["Advances page<br/>[AdminAdvances.tsx]"]
  node_profit_ui["Profit page<br/>[AdminProfit.tsx]"]
end

subgraph group_finance["Finance API"]
  node_api["Express API<br/>[index.ts]"]
  node_payments["Payment handling<br/>[payments.ts]"]
  node_expenses["Expense proration<br/>[expenses.ts]"]
  node_advances["Operational advances<br/>[advances.ts]"]
  node_profit["Profit reporting<br/>[profit.ts]"]
  node_reports["Payment reports<br/>[reports.ts]"]
  node_ledger["Accounting ledger<br/>[ledger.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

subgraph group_operations["Fleet operations"]
  node_vehicles["Vehicle management<br/>[vehicles.ts]"]
  node_inspections["Inspections<br/>[inspections.ts]"]
  node_trips["Trip bookings<br/>[trips.ts]"]
  node_marketplace["Vehicle marketplace<br/>[marketplace.ts]"]
end

subgraph group_intelligence["Fleet intelligence"]
  node_oracle_daemon["Oráculo daemon<br/>[index.ts]"]
  node_oracle_engine["Geospatial engine<br/>[engine.ts]"]
  node_oracle_telemetry["Fleet telemetry<br/>[oracle.ts]"]
  node_oracle_monitor["Market monitor<br/>[monitor.ts]"]
end

node_drivers(("Drivers"))
node_admins(("Administrators"))
node_supabase[("Supabase database")]

node_drivers -->|"use"| node_web_app
node_admins -->|"manage"| node_web_app
node_web_app -->|"routes to"| node_pay_ui
node_web_app -->|"routes to"| node_expenses_ui
node_web_app -->|"routes to"| node_reports_ui
node_web_app -->|"routes to"| node_advances_ui
node_web_app -->|"routes to"| node_profit_ui
node_pay_ui -->|"submits payment"| node_api
node_expenses_ui -->|"submits expense"| node_api
node_reports_ui -->|"requests reports"| node_api
node_advances_ui -->|"manages advances"| node_api
node_profit_ui -->|"requests profit"| node_api
node_api -->|"mounts route"| node_payments
node_api -->|"mounts route"| node_expenses
node_api -->|"mounts route"| node_advances
node_api -->|"mounts route"| node_profit
node_api -->|"mounts route"| node_reports
node_api -->|"mounts route"| node_ledger
node_api -->|"mounts route"| node_vehicles
node_api -->|"mounts route"| node_inspections
node_api -->|"mounts route"| node_trips
node_api -->|"mounts route"| node_marketplace
node_payments -->|"reads and writes"| node_supabase_client
node_expenses -->|"reads and writes"| node_supabase_client
node_advances -->|"reads and writes"| node_supabase_client
node_profit -->|"reads data"| node_supabase_client
node_reports -->|"reads data"| node_supabase_client
node_ledger -->|"reads and writes"| node_supabase_client
node_supabase_client -->|"accesses"| node_supabase
node_api -->|"starts daemon"| node_oracle_daemon
node_oracle_daemon -->|"runs cycles"| node_oracle_engine
node_oracle_daemon -->|"runs monitor"| node_oracle_monitor
node_oracle_engine -->|"gets telemetry"| node_oracle_telemetry
node_oracle_engine -->|"stores events"| node_supabase_client
node_oracle_daemon -->|"runs hotspot RPC"| node_supabase

click node_web_app "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/App.tsx"
click node_pay_ui "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Pay.tsx"
click node_expenses_ui "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Expenses.tsx"
click node_reports_ui "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Reports.tsx"
click node_advances_ui "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/AdminAdvances.tsx"
click node_profit_ui "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/AdminProfit.tsx"
click node_api "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/index.ts"
click node_payments "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/payments.ts"
click node_expenses "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/expenses.ts"
click node_advances "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/advances.ts"
click node_profit "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/profit.ts"
click node_reports "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/reports.ts"
click node_ledger "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/ledger.ts"
click node_vehicles "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/vehicles.ts"
click node_inspections "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/inspections.ts"
click node_trips "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/trips.ts"
click node_marketplace "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/marketplace.ts"
click node_oracle_daemon "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/index.ts"
click node_oracle_engine "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/engine.ts"
click node_oracle_telemetry "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/oracle.ts"
click node_oracle_monitor "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/monitor.ts"
click node_supabase_client "https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/lib/supabase.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_web_app,node_pay_ui,node_expenses_ui,node_reports_ui,node_advances_ui,node_profit_ui toneBlue
class node_api,node_payments,node_expenses,node_advances,node_profit,node_reports,node_ledger,node_supabase_client,node_supabase toneAmber
class node_vehicles,node_inspections,node_trips,node_marketplace toneMint
class node_oracle_daemon,node_oracle_engine,node_oracle_telemetry,node_oracle_monitor toneRose
class node_drivers,node_admins toneIndigo
```

## Components

### Web application

- [Web router](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Payment page](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Pay.tsx): `web/src/pages/Pay.tsx`
- [Expenses page](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Expenses.tsx): `web/src/pages/Expenses.tsx`
- [Reports page](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/Reports.tsx): `web/src/pages/Reports.tsx`
- [Advances page](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/AdminAdvances.tsx): `web/src/pages/AdminAdvances.tsx`
- [Profit page](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/web/src/pages/AdminProfit.tsx): `web/src/pages/AdminProfit.tsx`

### Finance API

- [Express API](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/index.ts): `src/index.ts`
- [Payment handling](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/payments.ts): `src/routes/payments.ts`
- [Expense proration](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/expenses.ts): `src/routes/expenses.ts`
- [Operational advances](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/advances.ts): `src/routes/advances.ts`
- [Profit reporting](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/profit.ts): `src/routes/profit.ts`
- [Payment reports](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/reports.ts): `src/routes/reports.ts`
- [Accounting ledger](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/ledger.ts): `src/routes/ledger.ts`
- [Supabase client](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Fleet operations

- [Vehicle management](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/vehicles.ts): `src/routes/vehicles.ts`
- [Inspections](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/inspections.ts): `src/routes/inspections.ts`
- [Trip bookings](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/trips.ts): `src/routes/trips.ts`
- [Vehicle marketplace](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/routes/marketplace.ts): `src/routes/marketplace.ts`

### Fleet intelligence

- [Oráculo daemon](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/index.ts): `src/oraculo/index.ts`
- [Geospatial engine](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/engine.ts): `src/oraculo/engine.ts`
- [Fleet telemetry](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/oracle.ts): `src/oraculo/oracle.ts`
- [Market monitor](https://github.com/ozcaredo89/allatyou-renting-hub/blob/main/src/oraculo/monitor.ts): `src/oraculo/monitor.ts`

### Other components

- **Drivers**
- **Administrators**
- **Supabase database**

## Connections

- Drivers → Web router: use
- Administrators → Web router: manage
- Web router → Payment page: routes to
- Web router → Expenses page: routes to
- Web router → Reports page: routes to
- Web router → Advances page: routes to
- Web router → Profit page: routes to
- Payment page → Express API: submits payment
- Expenses page → Express API: submits expense
- Reports page → Express API: requests reports
- Advances page → Express API: manages advances
- Profit page → Express API: requests profit
- Express API → Payment handling: mounts route
- Express API → Expense proration: mounts route
- Express API → Operational advances: mounts route
- Express API → Profit reporting: mounts route
- Express API → Payment reports: mounts route
- Express API → Accounting ledger: mounts route
- Express API → Vehicle management: mounts route
- Express API → Inspections: mounts route
- Express API → Trip bookings: mounts route
- Express API → Vehicle marketplace: mounts route
- Payment handling → Supabase client: reads and writes
- Expense proration → Supabase client: reads and writes
- Operational advances → Supabase client: reads and writes
- Profit reporting → Supabase client: reads data
- Payment reports → Supabase client: reads data
- Accounting ledger → Supabase client: reads and writes
- Supabase client → Supabase database: accesses
- Express API → Oráculo daemon: starts daemon
- Oráculo daemon → Geospatial engine: runs cycles
- Oráculo daemon → Market monitor: runs monitor
- Geospatial engine → Fleet telemetry: gets telemetry
- Geospatial engine → Supabase client: stores events
- Oráculo daemon → Supabase database: runs hotspot RPC
