# mrodri2006/tcc_2026-4 architecture

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

- Interactive diagram: https://gitdiagram.com/mrodri2006/tcc_2026-4
- Repository: https://github.com/mrodri2006/tcc_2026-4

## Overview

This is a React Native/Expo marketplace connecting service providers and contractors, backed by Firebase and Cloud Functions. The main user journey is account entry, provider/service discovery, service request and proposal handling, lifecycle tracking, and review. Separate capabilities include provider availability and location visibility, messaging, notifications, administration, and provider subscription billing. The graph uses documented behavior and sampled import/call references; unsampled screen internals are represented at subsystem level rather than inferred in detail.

Main entry points: [`App.tsx`](https://github.com/mrodri2006/tcc_2026-4/blob/main/App.tsx) (App navigation), [`screens/Home.tsx`](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Home.tsx) (Contractor home), [`functions/index.js`](https://github.com/mrodri2006/tcc_2026-4/blob/main/functions/index.js) (Cloud Functions), [`firebase.js`](https://github.com/mrodri2006/tcc_2026-4/blob/main/firebase.js) (Firebase services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mobile app"]
  node_app["App navigation<br/>[App.tsx]"]
  node_auth["Account access<br/>[Login.tsx]"]
end

subgraph group_marketplace["Service marketplace"]
  node_contractor_home["Contractor home<br/>[Home.tsx]"]
  node_provider_home["Provider home"]
  node_provider_discovery["Provider discovery<br/>[Profissionais.tsx]"]
  node_provider_detail["Provider details"]
  node_service_request["Service requests"]
  node_service_management["Service management<br/>[Servicos.tsx]"]
  node_service_status["Service lifecycle<br/>[service.ts]"]
  node_provider_schedule["Provider schedule"]
  node_location_card["Location visibility"]
  node_location_service["Location presence"]
end

subgraph group_engagement["Engagement and trust"]
  node_messaging["Chat<br/>[Chat.tsx]"]
  node_notifications["Notifications<br/>[Notificacoes.tsx]"]
  node_push_hook["Push registration"]
  node_notification_service["Push service"]
  node_reviews["Reviews and reputation<br/>[reviewService.ts]"]
  node_admin["Administration<br/>[Adm.tsx]"]
end

subgraph group_billing["Provider billing"]
  node_billing_ui["Billing screens"]
  node_billing_status["Billing status"]
  node_billing_service["Billing client<br/>[billingService.ts]"]
end

subgraph group_backend["Firebase backend"]
  node_functions["Cloud Functions<br/>[index.js]"]
  node_service_lifecycle["Lifecycle rules"]
  node_firebase[("Firebase services<br/>[firebase.js]")]
end

node_contractor(("Contractor"))
node_provider(("Provider"))
node_mercadopago["Mercado Pago"]

node_contractor -->|"uses"| node_app
node_provider -->|"uses"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_contractor_home
node_app -->|"routes to"| node_provider_home
node_contractor_home -.->|"browses"| node_provider_discovery
node_provider_discovery -.->|"opens profile"| node_provider_detail
node_contractor_home -.->|"requests service"| node_service_request
node_contractor_home -->|"loads ratings"| node_reviews
node_contractor_home -->|"responds to proposal"| node_service_management
node_service_management -->|"uses statuses"| node_service_status
node_provider_home -->|"shows controls"| node_location_card
node_location_card -->|"updates presence"| node_location_service
node_provider -.->|"manages availability"| node_provider_schedule
node_contractor -.->|"chats"| node_messaging
node_app -->|"routes to"| node_notifications
node_app -->|"registers push"| node_push_hook
node_push_hook -->|"delegates"| node_notification_service
node_notification_service -->|"stores tokens"| node_firebase
node_admin -->|"uses"| node_firebase
node_provider -->|"pays subscription"| node_billing_ui
node_billing_ui -.->|"requests billing"| node_billing_service
node_billing_status -->|"reads account"| node_firebase
node_billing_service -->|"calls billing functions"| node_functions
node_functions -->|"imports rules"| node_service_lifecycle
node_functions -->|"updates billing state"| node_firebase
node_functions -->|"checks payment"| node_mercadopago
node_mercadopago -->|"sends webhook"| node_functions

click node_app "https://github.com/mrodri2006/tcc_2026-4/blob/main/App.tsx"
click node_auth "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Login.tsx"
click node_contractor_home "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Home.tsx"
click node_provider_home "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/HomeTrabalhador.tsx"
click node_provider_discovery "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Profissionais.tsx"
click node_provider_detail "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/DetalheProfissional.tsx"
click node_service_request "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/SolicitarServico.tsx"
click node_service_management "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Servicos.tsx"
click node_service_status "https://github.com/mrodri2006/tcc_2026-4/blob/main/domain/service.ts"
click node_provider_schedule "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/AgendaPrestador.tsx"
click node_location_card "https://github.com/mrodri2006/tcc_2026-4/blob/main/components/LocationVisibilityCard.tsx"
click node_location_service "https://github.com/mrodri2006/tcc_2026-4/blob/main/services/locationPresenceService.ts"
click node_messaging "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Chat.tsx"
click node_notifications "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Notificacoes.tsx"
click node_push_hook "https://github.com/mrodri2006/tcc_2026-4/blob/main/hooks/usePushNotifications.ts"
click node_notification_service "https://github.com/mrodri2006/tcc_2026-4/blob/main/services/notificationService.ts"
click node_reviews "https://github.com/mrodri2006/tcc_2026-4/blob/main/services/reviewService.ts"
click node_admin "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Adm.tsx"
click node_billing_ui "https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/PagamentoMensalidade.tsx"
click node_billing_status "https://github.com/mrodri2006/tcc_2026-4/blob/main/hooks/useMensalidadeStatus.ts"
click node_billing_service "https://github.com/mrodri2006/tcc_2026-4/blob/main/services/billingService.ts"
click node_functions "https://github.com/mrodri2006/tcc_2026-4/blob/main/functions/index.js"
click node_service_lifecycle "https://github.com/mrodri2006/tcc_2026-4/blob/main/functions/serviceLifecycle.js"
click node_firebase "https://github.com/mrodri2006/tcc_2026-4/blob/main/firebase.js"

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_auth toneBlue
class node_contractor_home,node_provider_home,node_provider_discovery,node_provider_detail,node_service_request,node_service_management,node_service_status,node_provider_schedule,node_location_card,node_location_service toneAmber
class node_messaging,node_notifications,node_push_hook,node_notification_service,node_reviews,node_admin toneMint
class node_billing_ui,node_billing_status,node_billing_service toneRose
class node_functions,node_service_lifecycle,node_firebase,node_contractor,node_provider,node_mercadopago toneIndigo
```

## Components

### Mobile app

- [App navigation](https://github.com/mrodri2006/tcc_2026-4/blob/main/App.tsx): `App.tsx`
- [Account access](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Login.tsx): `screens/Login.tsx`

### Service marketplace

- [Contractor home](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Home.tsx): `screens/Home.tsx`
- [Provider home](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/HomeTrabalhador.tsx): `screens/HomeTrabalhador.tsx`
- [Provider discovery](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Profissionais.tsx): `screens/Profissionais.tsx`
- [Provider details](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/DetalheProfissional.tsx): `screens/DetalheProfissional.tsx`
- [Service requests](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/SolicitarServico.tsx): `screens/SolicitarServico.tsx`
- [Service management](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Servicos.tsx): `screens/Servicos.tsx`
- [Service lifecycle](https://github.com/mrodri2006/tcc_2026-4/blob/main/domain/service.ts): `domain/service.ts`
- [Provider schedule](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/AgendaPrestador.tsx): `screens/AgendaPrestador.tsx`
- [Location visibility](https://github.com/mrodri2006/tcc_2026-4/blob/main/components/LocationVisibilityCard.tsx): `components/LocationVisibilityCard.tsx`
- [Location presence](https://github.com/mrodri2006/tcc_2026-4/blob/main/services/locationPresenceService.ts): `services/locationPresenceService.ts`

### Engagement and trust

- [Chat](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Chat.tsx): `screens/Chat.tsx`
- [Notifications](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Notificacoes.tsx): `screens/Notificacoes.tsx`
- [Push registration](https://github.com/mrodri2006/tcc_2026-4/blob/main/hooks/usePushNotifications.ts): `hooks/usePushNotifications.ts`
- [Push service](https://github.com/mrodri2006/tcc_2026-4/blob/main/services/notificationService.ts): `services/notificationService.ts`
- [Reviews and reputation](https://github.com/mrodri2006/tcc_2026-4/blob/main/services/reviewService.ts): `services/reviewService.ts`
- [Administration](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/Adm.tsx): `screens/Adm.tsx`

### Provider billing

- [Billing screens](https://github.com/mrodri2006/tcc_2026-4/blob/main/screens/PagamentoMensalidade.tsx): `screens/PagamentoMensalidade.tsx`
- [Billing status](https://github.com/mrodri2006/tcc_2026-4/blob/main/hooks/useMensalidadeStatus.ts): `hooks/useMensalidadeStatus.ts`
- [Billing client](https://github.com/mrodri2006/tcc_2026-4/blob/main/services/billingService.ts): `services/billingService.ts`

### Firebase backend

- [Cloud Functions](https://github.com/mrodri2006/tcc_2026-4/blob/main/functions/index.js): `functions/index.js`
- [Lifecycle rules](https://github.com/mrodri2006/tcc_2026-4/blob/main/functions/serviceLifecycle.js): `functions/serviceLifecycle.js`
- [Firebase services](https://github.com/mrodri2006/tcc_2026-4/blob/main/firebase.js): `firebase.js`

### Other components

- **Contractor**
- **Provider**
- **Mercado Pago**

## Connections

- Contractor → App navigation: uses
- Provider → App navigation: uses
- App navigation → Account access: routes to (evidence: `App.tsx`)
- App navigation → Contractor home: routes to (evidence: `App.tsx`)
- App navigation → Provider home: routes to (evidence: `App.tsx`)
- Contractor home → Provider discovery: browses
- Provider discovery → Provider details: opens profile
- Contractor home → Service requests: requests service
- Contractor home → Reviews and reputation: loads ratings (evidence: `screens/Home.tsx`)
- Contractor home → Service management: responds to proposal (evidence: `screens/Home.tsx`)
- Service management → Service lifecycle: uses statuses (evidence: `domain/service.ts`)
- Provider home → Location visibility: shows controls (evidence: `screens/HomeTrabalhador.tsx`)
- Location visibility → Location presence: updates presence (evidence: `components/LocationVisibilityCard.tsx`)
- Provider → Provider schedule: manages availability
- Contractor → Chat: chats
- App navigation → Notifications: routes to (evidence: `App.tsx`)
- App navigation → Push registration: registers push (evidence: `App.tsx`)
- Push registration → Push service: delegates (evidence: `hooks/usePushNotifications.ts`)
- Push service → Firebase services: stores tokens (evidence: `services/notificationService.ts`)
- Administration → Firebase services: uses (evidence: `screens/Adm.tsx`)
- Provider → Billing screens: pays subscription
- Billing screens → Billing client: requests billing
- Billing status → Firebase services: reads account (evidence: `hooks/useMensalidadeStatus.ts`)
- Billing client → Cloud Functions: calls billing functions (evidence: `services/billingService.ts`)
- Cloud Functions → Lifecycle rules: imports rules (evidence: `functions/index.js`)
- Cloud Functions → Firebase services: updates billing state
- Cloud Functions → Mercado Pago: checks payment
- Mercado Pago → Cloud Functions: sends webhook
