# ifpr-projeto-de-extensao/v2-achados-e-perdidos architecture

> Architecture diagram of the GitHub repository ifpr-projeto-de-extensao/v2-achados-e-perdidos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos
- Repository: https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos

## Overview

Localiza+ is an institutional lost-and-found platform. Users register lost or found items, search listings, verify ownership, and record returns; administrators manage accounts, occurrences, reporting, and audit activity. The graph combines README-documented capabilities with route dispatch and selected implementation evidence. Several subsystem links are documented at product level because their source was not sampled.

Main entry points: [`src/App.tsx`](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/App.tsx) (Application shell), [`src/components/AdminView.tsx`](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AdminView.tsx) (Admin dashboard), [`src/context/AppContext.tsx`](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/context/AppContext.tsx) (App context), [`src/components/ObjectsView.tsx`](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/ObjectsView.tsx) (Search occurrences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["Application shell<br/>[App.tsx]"]
  node_router["Route state<br/>[RouterContext.tsx]"]
  node_app_context["App context<br/>[AppContext.tsx]"]
  node_auth_ui["Sign-in and verification<br/>[AuthModal.tsx]"]
end

subgraph group_items["Occurrence lifecycle"]
  node_register["Register occurrence"]
  node_search["Search occurrences<br/>[ObjectsView.tsx]"]
  node_matching["AI matching<br/>[AIMatchModal.tsx]"]
  node_possession["Verify possession"]
  node_return["Record return"]
  node_my_items["My occurrences<br/>[MyItemsView.tsx]"]
end

subgraph group_governance["Administration"]
  node_admin["Admin dashboard<br/>[AdminView.tsx]"]
  node_audit["Audit trail"]
  node_reports["PDF reports"]
  node_test_battery["Test batteries"]
end

subgraph group_services["Backend and services"]
  node_firestore[("Cloud Firestore")]
  node_firebase_auth["Firebase Authentication"]
  node_api["Server API<br/>[server.ts]"]
  node_ai_service["AI suggestions<br/>[server.ts]"]
  node_notifications["Notification functions<br/>[index.ts]"]
  node_support["Support feedback"]
end

node_users(("Students and staff"))
node_discord["Discord"]

node_users -->|"use"| node_app
node_app -->|"reads route"| node_router
node_app -->|"dispatches view"| node_register
node_app -->|"dispatches view"| node_search
node_app -->|"dispatches view"| node_admin
node_app -->|"uses state"| node_app_context
node_app_context -->|"opens sign-in"| node_auth_ui
node_register -->|"stores occurrence"| node_firestore
node_search -->|"queries listings"| node_firestore
node_search -.->|"offers matching"| node_matching
node_matching -.->|"requests suggestions"| node_ai_service
node_possession -->|"verifies before return"| node_return
node_return -->|"updates occurrence"| node_firestore
node_my_items -->|"reads own items"| node_firestore
node_app_context -->|"authenticates"| node_firebase_auth
node_admin -->|"manages records"| node_firestore
node_admin -->|"opens audit"| node_audit
node_admin -->|"generates reports"| node_reports
node_admin -->|"manages tests"| node_test_battery
node_api -->|"serves backend operations"| node_firestore
node_api -->|"handles AI route"| node_ai_service
node_notifications -->|"sends event notices"| node_discord
node_support -->|"submits feedback"| node_api

click node_app "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/App.tsx"
click node_router "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/context/RouterContext.tsx"
click node_app_context "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/context/AppContext.tsx"
click node_auth_ui "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AuthModal.tsx"
click node_register "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/RegisterItemView.tsx"
click node_search "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/ObjectsView.tsx"
click node_matching "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AIMatchModal.tsx"
click node_possession "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/hooks/usePossessionVerification.ts"
click node_return "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/ItemDetailModal.tsx"
click node_my_items "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/MyItemsView.tsx"
click node_admin "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AdminView.tsx"
click node_audit "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AuditTrailManagerView.tsx"
click node_reports "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/lib/foundItemsReportPdfGenerator.ts"
click node_test_battery "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/TestBatteryManagerView.tsx"
click node_api "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/server.ts"
click node_ai_service "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/server.ts"
click node_notifications "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/functions/src/index.ts"
click node_support "https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/lib/supportFeedbackService.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_router,node_app_context,node_auth_ui toneBlue
class node_register,node_search,node_matching,node_possession,node_return,node_my_items toneAmber
class node_admin,node_audit,node_reports,node_test_battery toneMint
class node_firestore,node_firebase_auth,node_api,node_ai_service,node_notifications,node_support toneRose
class node_users,node_discord toneIndigo
```

## Components

### User experience

- [Application shell](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/App.tsx): `src/App.tsx`
- [Route state](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/context/RouterContext.tsx): `src/context/RouterContext.tsx`
- [App context](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Sign-in and verification](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`

### Occurrence lifecycle

- [Register occurrence](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/RegisterItemView.tsx): `src/components/RegisterItemView.tsx`
- [Search occurrences](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/ObjectsView.tsx): `src/components/ObjectsView.tsx`
- [AI matching](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AIMatchModal.tsx): `src/components/AIMatchModal.tsx`
- [Verify possession](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/hooks/usePossessionVerification.ts): `src/hooks/usePossessionVerification.ts`
- [Record return](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/ItemDetailModal.tsx): `src/components/ItemDetailModal.tsx`
- [My occurrences](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/MyItemsView.tsx): `src/components/MyItemsView.tsx`

### Administration

- [Admin dashboard](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AdminView.tsx): `src/components/AdminView.tsx`
- [Audit trail](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/AuditTrailManagerView.tsx): `src/components/AuditTrailManagerView.tsx`
- [PDF reports](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/lib/foundItemsReportPdfGenerator.ts): `src/lib/foundItemsReportPdfGenerator.ts`
- [Test batteries](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/components/TestBatteryManagerView.tsx): `src/components/TestBatteryManagerView.tsx`

### Backend and services

- **Cloud Firestore**
- **Firebase Authentication**
- [Server API](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/server.ts): `server.ts`
- [AI suggestions](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/server.ts): `server.ts`
- [Notification functions](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/functions/src/index.ts): `functions/src/index.ts`
- [Support feedback](https://github.com/ifpr-projeto-de-extensao/v2-achados-e-perdidos/blob/main/src/lib/supportFeedbackService.ts): `src/lib/supportFeedbackService.ts`

### Other components

- **Students and staff**
- **Discord**

## Connections

- Students and staff → Application shell: use
- Application shell → Route state: reads route
- Application shell → Register occurrence: dispatches view
- Application shell → Search occurrences: dispatches view
- Application shell → Admin dashboard: dispatches view
- Application shell → App context: uses state
- App context → Sign-in and verification: opens sign-in
- Register occurrence → Cloud Firestore: stores occurrence
- Search occurrences → Cloud Firestore: queries listings
- Search occurrences → AI matching: offers matching
- AI matching → AI suggestions: requests suggestions
- Verify possession → Record return: verifies before return
- Record return → Cloud Firestore: updates occurrence
- My occurrences → Cloud Firestore: reads own items
- App context → Firebase Authentication: authenticates
- Admin dashboard → Cloud Firestore: manages records
- Admin dashboard → Audit trail: opens audit
- Admin dashboard → PDF reports: generates reports
- Admin dashboard → Test batteries: manages tests
- Server API → Cloud Firestore: serves backend operations
- Server API → AI suggestions: handles AI route
- Notification functions → Discord: sends event notices
- Support feedback → Server API: submits feedback
