# williambrito98/plataforma-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/williambrito98/plataforma-frontend
- Repository: https://github.com/williambrito98/plataforma-frontend

## Overview

This is a React/TypeScript frontend for a company-scoped administration platform. Users enter through login or the admin area, select a company, and then work with automations and other management areas. The tree also shows audit logs, files, categories, profile, users, and RBAC as distinct capabilities. The sampled code confirms app setup, route composition, company-selection gating, and auth bootstrap; feature internals were not sampled, so links to those areas are left unverified rather than inferred as calls.

Main entry points: [`src/routeTree.gen.ts`](https://github.com/williambrito98/plataforma-frontend/blob/main/src/routeTree.gen.ts) (Route tree), [`src/app/providers/AppProvider.tsx`](https://github.com/williambrito98/plataforma-frontend/blob/main/src/app/providers/AppProvider.tsx) (App providers), [`src/features/auth/components/auth-bootstrap.tsx`](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/components/auth-bootstrap.tsx) (Auth bootstrap), [`src/routes/_admin.tsx`](https://github.com/williambrito98/plataforma-frontend/blob/main/src/routes/_admin.tsx) (Admin route gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app_entry["App entry<br/>[main.tsx]"]
  node_providers["App providers<br/>[AppProvider.tsx]"]
  node_routes["Route tree<br/>[routeTree.gen.ts]"]
  node_admin_gate["Admin route gate<br/>[_admin.tsx]"]
  node_admin_layout["Admin layout<br/>[admin-layout.tsx]"]
  node_query_cache[("Query cache<br/>[query-client.ts]")]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Login and recovery<br/>[login-page.tsx]"]
  node_auth_boot["Auth bootstrap<br/>[auth-bootstrap.tsx]"]
  node_auth_state["Auth state<br/>[auth-store.ts]"]
  node_permissions["Permission rules<br/>[permissions.ts]"]
end

subgraph group_automation["Automation management"]
  node_automation_pages["Automation authoring"]
  node_automation_edit["Automation editing"]
  node_automation_runtime["Execution monitoring"]
end

subgraph group_organization["Company administration"]
  node_company_selection["Company selection"]
  node_company_admin["Company management"]
  node_company_state["Selected company state<br/>[company-store.ts]"]
end

subgraph group_operations["Operational administration"]
  node_audit["Audit logs"]
  node_files["File management<br/>[files-page.tsx]"]
  node_categories["Category management"]
  node_users["User management<br/>[users-page.tsx]"]
  node_rbac["Roles and permissions<br/>[rbac-page.tsx]"]
  node_profile["User profile<br/>[profile-page.tsx]"]
end

node_user(("Administrator"))
node_api{{"Backend API"}}

node_user -->|"opens"| node_app_entry
node_app_entry -->|"renders"| node_providers
node_providers -->|"provides router"| node_routes
node_providers -->|"wraps routes"| node_auth_boot
node_providers -->|"provides cache"| node_query_cache
node_routes -->|"registers"| node_admin_gate
node_admin_gate -->|"requires selection"| node_company_selection
node_admin_gate -->|"renders"| node_admin_layout
node_routes -->|"registers route"| node_automation_pages
node_routes -->|"registers route"| node_automation_edit
node_routes -->|"registers route"| node_company_admin
node_auth_boot -->|"uses state"| node_auth_state
node_auth_boot -->|"uses state"| node_company_state
node_auth_boot -->|"syncs company"| node_company_selection
node_user -.->|"signs in"| node_auth_ui
node_auth_ui -.->|"authenticates"| node_api
node_automation_pages -.->|"manages automations"| node_api
node_automation_edit -->|"requires permission"| node_permissions
node_automation_runtime -.->|"controls executions"| node_api
node_company_admin -.->|"updates companies"| node_api
node_audit -.->|"loads audit records"| node_api
node_files -.->|"loads files"| node_api
node_categories -.->|"manages categories"| node_api
node_users -.->|"manages users"| node_api
node_rbac -.->|"manages access rules"| node_api
node_profile -.->|"updates profile"| node_api

click node_app_entry "https://github.com/williambrito98/plataforma-frontend/blob/main/src/main.tsx"
click node_providers "https://github.com/williambrito98/plataforma-frontend/blob/main/src/app/providers/AppProvider.tsx"
click node_routes "https://github.com/williambrito98/plataforma-frontend/blob/main/src/routeTree.gen.ts"
click node_admin_gate "https://github.com/williambrito98/plataforma-frontend/blob/main/src/routes/_admin.tsx"
click node_admin_layout "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/admin/components/admin-layout.tsx"
click node_auth_ui "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/components/login-page.tsx"
click node_auth_boot "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/components/auth-bootstrap.tsx"
click node_auth_state "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/stores/auth-store.ts"
click node_permissions "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/constants/permissions.ts"
click node_company_selection "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/components/require-company-selection.tsx"
click node_company_admin "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/components/edit-company-page.tsx"
click node_company_state "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/stores/company-store.ts"
click node_automation_pages "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/create-automation-page.tsx"
click node_automation_edit "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/edit-automation-page.tsx"
click node_automation_runtime "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/automation-execution-monitor.tsx"
click node_audit "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/audit-logs/components/audit-logs-page.tsx"
click node_files "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/files/components/files-page.tsx"
click node_categories "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/categories/components/categories-page.tsx"
click node_users "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/users/components/users-page.tsx"
click node_rbac "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/rbac/components/rbac-page.tsx"
click node_profile "https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/profile/components/profile-page.tsx"
click node_query_cache "https://github.com/williambrito98/plataforma-frontend/blob/main/src/lib/query-client.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_entry,node_providers,node_routes,node_admin_gate,node_admin_layout,node_query_cache toneBlue
class node_auth_ui,node_auth_boot,node_auth_state,node_permissions toneAmber
class node_automation_pages,node_automation_edit,node_automation_runtime,node_api toneMint
class node_company_selection,node_company_admin,node_company_state toneRose
class node_audit,node_files,node_categories,node_users,node_rbac,node_profile,node_user toneIndigo
```

## Components

### Application shell

- [App entry](https://github.com/williambrito98/plataforma-frontend/blob/main/src/main.tsx): `src/main.tsx`
- [App providers](https://github.com/williambrito98/plataforma-frontend/blob/main/src/app/providers/AppProvider.tsx): `src/app/providers/AppProvider.tsx`
- [Route tree](https://github.com/williambrito98/plataforma-frontend/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Admin route gate](https://github.com/williambrito98/plataforma-frontend/blob/main/src/routes/_admin.tsx): `src/routes/_admin.tsx`
- [Admin layout](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/admin/components/admin-layout.tsx): `src/features/admin/components/admin-layout.tsx`
- [Query cache](https://github.com/williambrito98/plataforma-frontend/blob/main/src/lib/query-client.ts): `src/lib/query-client.ts`

### Identity and access

- [Login and recovery](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/components/login-page.tsx): `src/features/auth/components/login-page.tsx`
- [Auth bootstrap](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/components/auth-bootstrap.tsx): `src/features/auth/components/auth-bootstrap.tsx`
- [Auth state](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/stores/auth-store.ts): `src/features/auth/stores/auth-store.ts`
- [Permission rules](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/auth/constants/permissions.ts): `src/features/auth/constants/permissions.ts`

### Automation management

- [Automation authoring](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/create-automation-page.tsx): `src/features/automations/components/create-automation-page.tsx`
- [Automation editing](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/edit-automation-page.tsx): `src/features/automations/components/edit-automation-page.tsx`
- [Execution monitoring](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/automations/components/automation-execution-monitor.tsx): `src/features/automations/components/automation-execution-monitor.tsx`

### Company administration

- [Company selection](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/components/require-company-selection.tsx): `src/features/companies/components/require-company-selection.tsx`
- [Company management](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/components/edit-company-page.tsx): `src/features/companies/components/edit-company-page.tsx`
- [Selected company state](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/companies/stores/company-store.ts): `src/features/companies/stores/company-store.ts`

### Operational administration

- [Audit logs](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/audit-logs/components/audit-logs-page.tsx): `src/features/audit-logs/components/audit-logs-page.tsx`
- [File management](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/files/components/files-page.tsx): `src/features/files/components/files-page.tsx`
- [Category management](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/categories/components/categories-page.tsx): `src/features/categories/components/categories-page.tsx`
- [User management](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/users/components/users-page.tsx): `src/features/users/components/users-page.tsx`
- [Roles and permissions](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/rbac/components/rbac-page.tsx): `src/features/rbac/components/rbac-page.tsx`
- [User profile](https://github.com/williambrito98/plataforma-frontend/blob/main/src/features/profile/components/profile-page.tsx): `src/features/profile/components/profile-page.tsx`

### Other components

- **Administrator**
- **Backend API**

## Connections

- Administrator → App entry: opens (evidence: `src/main.tsx`)
- App entry → App providers: renders (evidence: `src/main.tsx`)
- App providers → Route tree: provides router (evidence: `src/app/providers/AppProvider.tsx`)
- App providers → Auth bootstrap: wraps routes (evidence: `src/app/providers/AppProvider.tsx`)
- App providers → Query cache: provides cache (evidence: `src/app/providers/AppProvider.tsx`)
- Route tree → Admin route gate: registers (evidence: `src/routeTree.gen.ts`)
- Admin route gate → Company selection: requires selection (evidence: `src/routes/_admin.tsx`)
- Admin route gate → Admin layout: renders (evidence: `src/routes/_admin.tsx`)
- Route tree → Automation authoring: registers route (evidence: `src/routeTree.gen.ts`)
- Route tree → Automation editing: registers route (evidence: `src/routeTree.gen.ts`)
- Route tree → Company management: registers route (evidence: `src/routeTree.gen.ts`)
- Auth bootstrap → Auth state: uses state (evidence: `src/features/auth/components/auth-bootstrap.tsx`)
- Auth bootstrap → Selected company state: uses state (evidence: `src/features/auth/components/auth-bootstrap.tsx`)
- Auth bootstrap → Company selection: syncs company (evidence: `src/features/auth/components/auth-bootstrap.tsx`)
- Administrator → Login and recovery: signs in
- Login and recovery → Backend API: authenticates
- Automation authoring → Backend API: manages automations
- Automation editing → Permission rules: requires permission (evidence: `src/routes/_admin/automacoes.$id.editar.tsx`)
- Execution monitoring → Backend API: controls executions
- Company management → Backend API: updates companies
- Audit logs → Backend API: loads audit records
- File management → Backend API: loads files
- Category management → Backend API: manages categories
- User management → Backend API: manages users
- Roles and permissions → Backend API: manages access rules
- User profile → Backend API: updates profile
