# fagundesrafael/sigeo architecture

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

- Interactive diagram: https://gitdiagram.com/fagundesrafael/sigeo
- Repository: https://github.com/fagundesrafael/sigeo

## Overview

SIGEO is a web system for registering, searching, editing and monitoring procedure-related objects across several categories. Users authenticate, browse category records or the unified inventory, and use forms and filters to manage entries; a dashboard presents statistics, while settings maintain category reference data. The graph groups category APIs and data models to keep the many similar record types legible. The README documents editing, authentication and navigation capabilities beyond the sampled implementation; some UI-to-API links are therefore documented or left out where source evidence is unavailable.

Main entry points: [`lib/dbConnect.js`](https://github.com/fagundesrafael/sigeo/blob/main/lib/dbConnect.js) (MongoDB Connection), [`app`](https://github.com/fagundesrafael/sigeo/tree/main/app) (Category Workspaces), [`lib/authOptions.js`](https://github.com/fagundesrafael/sigeo/blob/main/lib/authOptions.js) (Auth Configuration), [`app/api`](https://github.com/fagundesrafael/sigeo/tree/main/app/api) (Category Record APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Shell"]
  node_auth["Authentication<br/>[route.js]"]
  node_shell["Protected App Shell<br/>[ClientWrapper.js]"]
  node_auth_options["Auth Configuration<br/>[authOptions.js]"]
end

subgraph group_inventory["Object Inventory"]
  node_category_ui["Category Workspaces"]
  node_unified_ui["All Objects View<br/>[page.js]"]
  node_record_api["Category Record APIs"]
  node_all_api["Unified Search API<br/>[route.js]"]
  node_forms["Object Entry Forms"]
  node_search["Search and Pagination"]
  node_upload["Image Upload<br/>[route.js]"]
end

subgraph group_insights["Monitoring"]
  node_dashboard["Statistics Dashboard<br/>[page.js]"]
  node_stats["Category Statistics"]
  node_pdf["PDF Rendering<br/>[pdfCanvas.js]"]
end

subgraph group_settings["Reference Settings"]
  node_settings_ui["Category Settings<br/>[page.js]"]
  node_settings_sections["Setting Sections"]
  node_config_api["Settings API<br/>[route.js]"]
end

subgraph group_storage["Persistence"]
  node_db["MongoDB Connection<br/>[dbConnect.js]"]
  node_models[("Object Data Models")]
  node_config_model[("Configuration Model<br/>[Config.js]")]
  node_user_model[("User Model<br/>[User.js]")]
end

node_user(("User"))

node_user -.->|"authenticates"| node_auth
node_user -.->|"manages records"| node_category_ui
node_user -.->|"views metrics"| node_dashboard
node_user -.->|"maintains references"| node_settings_ui
node_auth -.->|"uses options"| node_auth_options
node_auth_options -->|"connects through"| node_db
node_auth_options -->|"checks users"| node_user_model
node_shell -->|"checks session"| node_auth
node_category_ui -.->|"manages records"| node_record_api
node_category_ui -.->|"uses forms"| node_forms
node_category_ui -.->|"filters lists"| node_search
node_unified_ui -.->|"queries inventory"| node_all_api
node_record_api -->|"connects"| node_db
node_record_api -->|"reads and writes"| node_models
node_all_api -->|"connects"| node_db
node_all_api -->|"queries categories"| node_models
node_settings_ui -->|"renders sections"| node_settings_sections
node_settings_ui -->|"loads and saves"| node_config_api
node_config_api -->|"connects"| node_db
node_config_api -->|"reads and saves"| node_config_model
node_dashboard -->|"renders statistics"| node_stats
node_stats -->|"renders reports"| node_pdf
node_upload -.->|"stores image reference"| node_db

click node_auth "https://github.com/fagundesrafael/sigeo/blob/main/app/api/auth/%5B...nextauth%5D/route.js"
click node_shell "https://github.com/fagundesrafael/sigeo/blob/main/components/ClientWrapper.js"
click node_category_ui "https://github.com/fagundesrafael/sigeo/tree/main/app"
click node_unified_ui "https://github.com/fagundesrafael/sigeo/blob/main/app/todosobjetos/page.js"
click node_record_api "https://github.com/fagundesrafael/sigeo/tree/main/app/api"
click node_all_api "https://github.com/fagundesrafael/sigeo/blob/main/app/api/todosobjetos/route.js"
click node_forms "https://github.com/fagundesrafael/sigeo/tree/main/components"
click node_search "https://github.com/fagundesrafael/sigeo/tree/main/components"
click node_upload "https://github.com/fagundesrafael/sigeo/blob/main/app/api/upload-image/route.js"
click node_dashboard "https://github.com/fagundesrafael/sigeo/blob/main/app/estatistica/page.js"
click node_stats "https://github.com/fagundesrafael/sigeo/blob/main/components/EstatisticaAutomotores.js"
click node_pdf "https://github.com/fagundesrafael/sigeo/blob/main/lib/pdfCanvas.js"
click node_settings_ui "https://github.com/fagundesrafael/sigeo/blob/main/app/configs/page.js"
click node_settings_sections "https://github.com/fagundesrafael/sigeo/tree/main/components"
click node_config_api "https://github.com/fagundesrafael/sigeo/blob/main/app/api/configs/route.js"
click node_auth_options "https://github.com/fagundesrafael/sigeo/blob/main/lib/authOptions.js"
click node_db "https://github.com/fagundesrafael/sigeo/blob/main/lib/dbConnect.js"
click node_models "https://github.com/fagundesrafael/sigeo/tree/main/models"
click node_config_model "https://github.com/fagundesrafael/sigeo/blob/main/models/Config.js"
click node_user_model "https://github.com/fagundesrafael/sigeo/blob/main/models/User.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_auth,node_shell,node_auth_options,node_user toneBlue
class node_category_ui,node_unified_ui,node_record_api,node_all_api,node_forms,node_search,node_upload toneAmber
class node_dashboard,node_stats,node_pdf toneMint
class node_settings_ui,node_settings_sections,node_config_api toneRose
class node_db,node_models,node_config_model,node_user_model toneIndigo
```

## Components

### Access and Shell

- [Authentication](https://github.com/fagundesrafael/sigeo/blob/main/app/api/auth/%5B...nextauth%5D/route.js): `app/api/auth/[...nextauth]/route.js`
- [Protected App Shell](https://github.com/fagundesrafael/sigeo/blob/main/components/ClientWrapper.js): `components/ClientWrapper.js`
- [Auth Configuration](https://github.com/fagundesrafael/sigeo/blob/main/lib/authOptions.js): `lib/authOptions.js`

### Object Inventory

- [Category Workspaces](https://github.com/fagundesrafael/sigeo/tree/main/app): `app`
- [All Objects View](https://github.com/fagundesrafael/sigeo/blob/main/app/todosobjetos/page.js): `app/todosobjetos/page.js`
- [Category Record APIs](https://github.com/fagundesrafael/sigeo/tree/main/app/api): `app/api`
- [Unified Search API](https://github.com/fagundesrafael/sigeo/blob/main/app/api/todosobjetos/route.js): `app/api/todosobjetos/route.js`
- [Object Entry Forms](https://github.com/fagundesrafael/sigeo/tree/main/components): `components`
- [Search and Pagination](https://github.com/fagundesrafael/sigeo/tree/main/components): `components`
- [Image Upload](https://github.com/fagundesrafael/sigeo/blob/main/app/api/upload-image/route.js): `app/api/upload-image/route.js`

### Monitoring

- [Statistics Dashboard](https://github.com/fagundesrafael/sigeo/blob/main/app/estatistica/page.js): `app/estatistica/page.js`
- [Category Statistics](https://github.com/fagundesrafael/sigeo/blob/main/components/EstatisticaAutomotores.js): `components/EstatisticaAutomotores.js`
- [PDF Rendering](https://github.com/fagundesrafael/sigeo/blob/main/lib/pdfCanvas.js): `lib/pdfCanvas.js`

### Reference Settings

- [Category Settings](https://github.com/fagundesrafael/sigeo/blob/main/app/configs/page.js): `app/configs/page.js`
- [Setting Sections](https://github.com/fagundesrafael/sigeo/tree/main/components): `components`
- [Settings API](https://github.com/fagundesrafael/sigeo/blob/main/app/api/configs/route.js): `app/api/configs/route.js`

### Persistence

- [MongoDB Connection](https://github.com/fagundesrafael/sigeo/blob/main/lib/dbConnect.js): `lib/dbConnect.js`
- [Object Data Models](https://github.com/fagundesrafael/sigeo/tree/main/models): `models`
- [Configuration Model](https://github.com/fagundesrafael/sigeo/blob/main/models/Config.js): `models/Config.js`
- [User Model](https://github.com/fagundesrafael/sigeo/blob/main/models/User.js): `models/User.js`

### Other components

- **User**

## Connections

- User → Authentication: authenticates
- User → Category Workspaces: manages records
- User → Statistics Dashboard: views metrics
- User → Category Settings: maintains references
- Authentication → Auth Configuration: uses options
- Auth Configuration → MongoDB Connection: connects through (evidence: `lib/authOptions.js`)
- Auth Configuration → User Model: checks users (evidence: `lib/authOptions.js`)
- Protected App Shell → Authentication: checks session (evidence: `components/ClientWrapper.js`)
- Category Workspaces → Category Record APIs: manages records
- Category Workspaces → Object Entry Forms: uses forms (evidence: `app/page.js`)
- Category Workspaces → Search and Pagination: filters lists (evidence: `app/page.js`)
- All Objects View → Unified Search API: queries inventory
- Category Record APIs → MongoDB Connection: connects (evidence: `app/api/automotores/route.js`)
- Category Record APIs → Object Data Models: reads and writes (evidence: `app/api/automotores/route.js`)
- Unified Search API → MongoDB Connection: connects (evidence: `app/api/todosobjetos/route.js`)
- Unified Search API → Object Data Models: queries categories (evidence: `app/api/todosobjetos/route.js`)
- Category Settings → Setting Sections: renders sections (evidence: `app/configs/page.js`)
- Category Settings → Settings API: loads and saves (evidence: `app/configs/page.js`)
- Settings API → MongoDB Connection: connects (evidence: `app/api/configs/route.js`)
- Settings API → Configuration Model: reads and saves (evidence: `app/api/configs/route.js`)
- Statistics Dashboard → Category Statistics: renders statistics (evidence: `app/estatistica/page.js`)
- Category Statistics → PDF Rendering: renders reports (evidence: `components/EstatisticaAutomotores.js`)
- Image Upload → MongoDB Connection: stores image reference
