# mauriston/doencasepareceresjrs architecture

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

- Interactive diagram: https://gitdiagram.com/mauriston/doencasepareceresjrs
- Repository: https://github.com/mauriston/doencasepareceresjrs

## Overview

Guia Médico Naval is a PWA for JRS/HNRe medical examiners, combining normative references with operational casework. A principal workflow is opening and scheduling a health inspection, managing its records and related examinations/interviews, then preparing documents and communicating results. Other documented branches include competitions, specialist opinions, minor medical examinations, and service schedules. The map emphasizes those domain stages and the shared app/backend layers; many feature implementations were not sampled, so undocumented internal connections are omitted.

Main entry points: [`App.tsx`](https://github.com/mauriston/doencasepareceresjrs/blob/main/App.tsx) (App shell), [`services/firestoreInspecoes.ts`](https://github.com/mauriston/doencasepareceresjrs/blob/main/services/firestoreInspecoes.ts) (Inspection records), [`components/ficha/inspecoes/useAcoesISFicha.tsx`](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/ficha/inspecoes/useAcoesISFicha.tsx) (Inspection actions), [`components/Inspecoes.tsx`](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Inspecoes.tsx) (Inspection workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["App shell<br/>[App.tsx]"]
  node_routing["Route map<br/>[routes.ts]"]
  node_login["Sign in<br/>[Login.tsx]"]
  node_home["Home dashboard<br/>[Home.tsx]"]
end

subgraph group_inspections["Health inspections"]
  node_inspection_ui["Inspection workspace<br/>[Inspecoes.tsx]"]
  node_inspection_record[("Inspection records")]
  node_inspection_rules["Inspection status rules<br/>[inspecoes.ts]"]
  node_inspection_actions["Inspection actions"]
  node_interviews["Interview records<br/>[entrevistasIS.ts]"]
  node_documents["Pericial documents<br/>[servico.ts]"]
end

subgraph group_operations["Operational workflows"]
  node_competitions["Competitions<br/>[ConcursosJRS.tsx]"]
  node_opinions["Specialist opinions<br/>[Pareceres.tsx]"]
  node_minor_exam["Minor examinations<br/>[PericiaMenor.tsx]"]
  node_service_schedule["SPA service schedule<br/>[EscalaSpa.tsx]"]
  node_reference["Normative guides<br/>[DiseaseGuide.tsx]"]
end

subgraph group_platform["Shared platform"]
  node_auth["Firebase authentication<br/>[firebaseAuth.ts]"]
  node_api["API client<br/>[apiClient.ts]"]
  node_server["Application server<br/>[server.ts]"]
end

node_examiner(("Medical examiner"))
node_firebase[("Firebase services")]
node_google_calendar["Google Calendar"]
node_ai["Generative AI"]

node_examiner -->|"uses"| node_app
node_app -->|"resolves routes"| node_routing
node_app -->|"shows"| node_login
node_app -->|"shows"| node_home
node_login -.->|"authenticates"| node_auth
node_examiner -->|"manages inspections"| node_inspection_ui
node_inspection_ui -.->|"reads and writes"| node_inspection_record
node_inspection_record -->|"uses status rules"| node_inspection_rules
node_inspection_actions -->|"updates records"| node_inspection_record
node_inspection_actions -->|"observes interviews"| node_interviews
node_inspection_actions -.->|"generates documents"| node_documents
node_inspection_ui -->|"synchronizes appointments"| node_google_calendar
node_examiner -->|"manages competitions"| node_competitions
node_examiner -->|"requests opinions"| node_opinions
node_examiner -->|"handles cases"| node_minor_exam
node_examiner -->|"checks schedule"| node_service_schedule
node_examiner -->|"consults guidance"| node_reference
node_api -->|"gets ID token"| node_auth
node_api -->|"sends API requests"| node_server
node_auth -->|"initializes Firebase"| node_firebase
node_inspection_record -->|"uses Firestore"| node_firebase
node_server -->|"uses Gemini"| node_ai

click node_app "https://github.com/mauriston/doencasepareceresjrs/blob/main/App.tsx"
click node_routing "https://github.com/mauriston/doencasepareceresjrs/blob/main/config/routes.ts"
click node_login "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Login.tsx"
click node_home "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Home.tsx"
click node_inspection_ui "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Inspecoes.tsx"
click node_inspection_record "https://github.com/mauriston/doencasepareceresjrs/blob/main/services/firestoreInspecoes.ts"
click node_inspection_rules "https://github.com/mauriston/doencasepareceresjrs/blob/main/utils/inspecoes.ts"
click node_inspection_actions "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/ficha/inspecoes/useAcoesISFicha.tsx"
click node_interviews "https://github.com/mauriston/doencasepareceresjrs/blob/main/services/entrevistasIS.ts"
click node_documents "https://github.com/mauriston/doencasepareceresjrs/blob/main/servidor/documentos/is/servico.ts"
click node_competitions "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/ConcursosJRS.tsx"
click node_opinions "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Pareceres.tsx"
click node_minor_exam "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/PericiaMenor.tsx"
click node_service_schedule "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/EscalaSpa.tsx"
click node_reference "https://github.com/mauriston/doencasepareceresjrs/blob/main/components/DiseaseGuide.tsx"
click node_auth "https://github.com/mauriston/doencasepareceresjrs/blob/main/services/firebaseAuth.ts"
click node_api "https://github.com/mauriston/doencasepareceresjrs/blob/main/services/apiClient.ts"
click node_server "https://github.com/mauriston/doencasepareceresjrs/blob/main/server.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_app,node_routing,node_login,node_home toneBlue
class node_inspection_ui,node_inspection_record,node_inspection_rules,node_inspection_actions,node_interviews,node_documents,node_firebase toneAmber
class node_competitions,node_opinions,node_minor_exam,node_service_schedule,node_reference toneMint
class node_auth,node_api,node_server toneRose
class node_examiner,node_google_calendar,node_ai toneIndigo
```

## Components

### Application shell

- [App shell](https://github.com/mauriston/doencasepareceresjrs/blob/main/App.tsx): `App.tsx`
- [Route map](https://github.com/mauriston/doencasepareceresjrs/blob/main/config/routes.ts): `config/routes.ts`
- [Sign in](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Login.tsx): `components/Login.tsx`
- [Home dashboard](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Home.tsx): `components/Home.tsx`

### Health inspections

- [Inspection workspace](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Inspecoes.tsx): `components/Inspecoes.tsx`
- [Inspection records](https://github.com/mauriston/doencasepareceresjrs/blob/main/services/firestoreInspecoes.ts): `services/firestoreInspecoes.ts`
- [Inspection status rules](https://github.com/mauriston/doencasepareceresjrs/blob/main/utils/inspecoes.ts): `utils/inspecoes.ts`
- [Inspection actions](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/ficha/inspecoes/useAcoesISFicha.tsx): `components/ficha/inspecoes/useAcoesISFicha.tsx`
- [Interview records](https://github.com/mauriston/doencasepareceresjrs/blob/main/services/entrevistasIS.ts): `services/entrevistasIS.ts`
- [Pericial documents](https://github.com/mauriston/doencasepareceresjrs/blob/main/servidor/documentos/is/servico.ts): `servidor/documentos/is/servico.ts`

### Operational workflows

- [Competitions](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/ConcursosJRS.tsx): `components/ConcursosJRS.tsx`
- [Specialist opinions](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/Pareceres.tsx): `components/Pareceres.tsx`
- [Minor examinations](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/PericiaMenor.tsx): `components/PericiaMenor.tsx`
- [SPA service schedule](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/EscalaSpa.tsx): `components/EscalaSpa.tsx`
- [Normative guides](https://github.com/mauriston/doencasepareceresjrs/blob/main/components/DiseaseGuide.tsx): `components/DiseaseGuide.tsx`

### Shared platform

- [Firebase authentication](https://github.com/mauriston/doencasepareceresjrs/blob/main/services/firebaseAuth.ts): `services/firebaseAuth.ts`
- [API client](https://github.com/mauriston/doencasepareceresjrs/blob/main/services/apiClient.ts): `services/apiClient.ts`
- [Application server](https://github.com/mauriston/doencasepareceresjrs/blob/main/server.ts): `server.ts`

### Other components

- **Medical examiner**
- **Firebase services**
- **Google Calendar**
- **Generative AI**

## Connections

- Medical examiner → App shell: uses (evidence: `README.md`)
- App shell → Route map: resolves routes (evidence: `App.tsx`)
- App shell → Sign in: shows (evidence: `App.tsx`)
- App shell → Home dashboard: shows (evidence: `App.tsx`)
- Sign in → Firebase authentication: authenticates
- Medical examiner → Inspection workspace: manages inspections (evidence: `README.md`)
- Inspection workspace → Inspection records: reads and writes
- Inspection records → Inspection status rules: uses status rules (evidence: `services/firestoreInspecoes.ts`)
- Inspection actions → Inspection records: updates records (evidence: `components/ficha/inspecoes/useAcoesISFicha.tsx`)
- Inspection actions → Interview records: observes interviews (evidence: `components/ficha/inspecoes/useAcoesISFicha.tsx`)
- Inspection actions → Pericial documents: generates documents
- Inspection workspace → Google Calendar: synchronizes appointments (evidence: `README.md`)
- Medical examiner → Competitions: manages competitions (evidence: `README.md`)
- Medical examiner → Specialist opinions: requests opinions (evidence: `README.md`)
- Medical examiner → Minor examinations: handles cases (evidence: `README.md`)
- Medical examiner → SPA service schedule: checks schedule (evidence: `README.md`)
- Medical examiner → Normative guides: consults guidance (evidence: `README.md`)
- API client → Firebase authentication: gets ID token (evidence: `services/apiClient.ts`)
- API client → Application server: sends API requests (evidence: `services/apiClient.ts`)
- Firebase authentication → Firebase services: initializes Firebase (evidence: `services/firebaseAuth.ts`)
- Inspection records → Firebase services: uses Firestore (evidence: `services/firestoreInspecoes.ts`)
- Application server → Generative AI: uses Gemini (evidence: `server.ts`)
