# thallesfeelippe/rh-paisa architecture

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

- Interactive diagram: https://gitdiagram.com/thallesfeelippe/rh-paisa
- Repository: https://github.com/thallesfeelippe/rh-paisa

## Overview

RH Usina is a Next.js portal combining a public communications and careers site with an administrative dashboard for HR, psychology, projects, and sustainability. A principal workflow is an administrator signing in, then managing domain records through dashboard actions backed by Prisma; the sampled login route explicitly uses password verification, session creation, rate limiting, and the database. Public reporting also supports anonymous submissions and tracking. Several capabilities are documented by the repository’s routes and README, but unsampled page-to-handler wiring is not asserted here.

Main entry points: [`src/app/dashboard/psicologia/pacientes/actions.ts`](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/pacientes/actions.ts) (Patient Actions), [`src/lib/db.ts`](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/db.ts) (Prisma Database), [`src/app/dashboard/noticias/actions.ts`](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/noticias/actions.ts) (News Management), [`src/app/dashboard/rh/actions.ts`](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/rh/actions.ts) (HR Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Public Portal"]
  node_public_site["Public Pages<br/>[page.tsx]"]
  node_news_pages["News Mural<br/>[page.tsx]"]
  node_careers["Jobs &amp; Apprentices<br/>[page.tsx]"]
  node_social["Social Projects<br/>[page.tsx]"]
  node_sustainability["Sustainability<br/>[page.tsx]"]
  node_psych_public["Psychology Resources<br/>[page.tsx]"]
  node_report_api["Report Intake &amp; Tracking<br/>[route.ts]"]
end

subgraph group_admin["Administration"]
  node_login["Login Handler<br/>[route.ts]"]
  node_dashboard["Admin Dashboard<br/>[page.tsx]"]
  node_news_admin["News Management<br/>[actions.ts]"]
  node_news_form["News Editor<br/>[NewsForm.tsx]"]
  node_projects_admin["Project Management<br/>[page.tsx]"]
end

subgraph group_people["People Operations"]
  node_rh_actions["HR Actions<br/>[actions.ts]"]
  node_employee_form["Employee Editor<br/>[EmployeeForm.tsx]"]
  node_candidates["Candidate Management<br/>[page.tsx]"]
end

subgraph group_wellbeing["Psychology &amp; Wellbeing"]
  node_patients_actions["Patient Actions<br/>[actions.ts]"]
  node_patient_form["Patient Editor<br/>[PatientForm.tsx]"]
  node_quick_employee["Quick Employee Creation"]
  node_wellness_admin["Wellness Management<br/>[page.tsx]"]
  node_complaints["Complaint Management<br/>[page.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_db[("Prisma Database<br/>[db.ts]")]
  node_auth["Signed Sessions<br/>[auth.ts]"]
  node_rate_limit["Login Rate Limit<br/>[rate-limit.ts]"]
  node_uploads["File Storage<br/>[upload.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"visits"| node_public_site
node_visitor -->|"reads"| node_news_pages
node_visitor -->|"explores"| node_careers
node_visitor -->|"accesses"| node_psych_public
node_visitor -->|"submits or tracks"| node_report_api
node_login -->|"checks attempts"| node_rate_limit
node_login -->|"finds user"| node_db
node_login -->|"verifies and creates session"| node_auth
node_news_form -->|"uses actions"| node_news_admin
node_news_admin -->|"reads and writes"| node_db
node_news_admin -->|"checks session"| node_auth
node_employee_form -->|"uses actions"| node_rh_actions
node_rh_actions -->|"reads and writes"| node_db
node_rh_actions -->|"checks session"| node_auth
node_patient_form -->|"uses actions"| node_patients_actions
node_patient_form -->|"renders"| node_quick_employee
node_quick_employee -->|"uses actions"| node_patients_actions
node_patients_actions -->|"reads and writes"| node_db
node_patients_actions -->|"checks session"| node_auth
node_report_api -->|"stores and queries"| node_db
node_dashboard -.->|"manages"| node_news_admin
node_dashboard -.->|"manages"| node_rh_actions
node_dashboard -.->|"manages"| node_patients_actions

click node_public_site "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/page.tsx"
click node_news_pages "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/noticias/page.tsx"
click node_careers "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/vagas/page.tsx"
click node_social "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/acoes-sociais/page.tsx"
click node_sustainability "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/meio-ambiente/page.tsx"
click node_psych_public "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/psicologia/page.tsx"
click node_report_api "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/api/reports/route.ts"
click node_login "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/api/auth/login/route.ts"
click node_dashboard "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/page.tsx"
click node_news_admin "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/noticias/actions.ts"
click node_news_form "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/NewsForm.tsx"
click node_projects_admin "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/projetos/page.tsx"
click node_rh_actions "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/rh/actions.ts"
click node_employee_form "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/rh/EmployeeForm.tsx"
click node_candidates "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/candidatos/page.tsx"
click node_patients_actions "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/pacientes/actions.ts"
click node_patient_form "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/psicologia/PatientForm.tsx"
click node_quick_employee "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/psicologia/QuickEmployeeModal.tsx"
click node_wellness_admin "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/bem-estar/page.tsx"
click node_complaints "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/denuncias/page.tsx"
click node_db "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/db.ts"
click node_auth "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/auth.ts"
click node_rate_limit "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/rate-limit.ts"
click node_uploads "https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/upload.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_public_site,node_news_pages,node_careers,node_social,node_sustainability,node_psych_public,node_report_api toneBlue
class node_login,node_dashboard,node_news_admin,node_news_form,node_projects_admin toneAmber
class node_rh_actions,node_employee_form,node_candidates toneMint
class node_patients_actions,node_patient_form,node_quick_employee,node_wellness_admin,node_complaints toneRose
class node_db,node_auth,node_rate_limit,node_uploads,node_visitor toneIndigo
```

## Components

### Public Portal

- [Public Pages](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [News Mural](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/noticias/page.tsx): `src/app/noticias/page.tsx`
- [Jobs & Apprentices](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/vagas/page.tsx): `src/app/vagas/page.tsx`
- [Social Projects](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/acoes-sociais/page.tsx): `src/app/acoes-sociais/page.tsx`
- [Sustainability](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/meio-ambiente/page.tsx): `src/app/meio-ambiente/page.tsx`
- [Psychology Resources](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/psicologia/page.tsx): `src/app/psicologia/page.tsx`
- [Report Intake & Tracking](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/api/reports/route.ts): `src/app/api/reports/route.ts`

### Administration

- [Login Handler](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [Admin Dashboard](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [News Management](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/noticias/actions.ts): `src/app/dashboard/noticias/actions.ts`
- [News Editor](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/NewsForm.tsx): `src/components/NewsForm.tsx`
- [Project Management](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/projetos/page.tsx): `src/app/dashboard/projetos/page.tsx`

### People Operations

- [HR Actions](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/rh/actions.ts): `src/app/dashboard/rh/actions.ts`
- [Employee Editor](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/rh/EmployeeForm.tsx): `src/components/rh/EmployeeForm.tsx`
- [Candidate Management](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/candidatos/page.tsx): `src/app/dashboard/candidatos/page.tsx`

### Psychology & Wellbeing

- [Patient Actions](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/pacientes/actions.ts): `src/app/dashboard/psicologia/pacientes/actions.ts`
- [Patient Editor](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/psicologia/PatientForm.tsx): `src/components/psicologia/PatientForm.tsx`
- [Quick Employee Creation](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/components/psicologia/QuickEmployeeModal.tsx): `src/components/psicologia/QuickEmployeeModal.tsx`
- [Wellness Management](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/bem-estar/page.tsx): `src/app/dashboard/psicologia/bem-estar/page.tsx`
- [Complaint Management](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/app/dashboard/psicologia/denuncias/page.tsx): `src/app/dashboard/psicologia/denuncias/page.tsx`

### Shared Services

- [Prisma Database](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [Signed Sessions](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Login Rate Limit](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/rate-limit.ts): `src/lib/rate-limit.ts`
- [File Storage](https://github.com/thallesfeelippe/rh-paisa/blob/main/src/lib/upload.ts): `src/lib/upload.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Public Pages: visits (evidence: `README.md`)
- Visitor → News Mural: reads (evidence: `README.md`)
- Visitor → Jobs & Apprentices: explores (evidence: `README.md`)
- Visitor → Psychology Resources: accesses (evidence: `README.md`)
- Visitor → Report Intake & Tracking: submits or tracks (evidence: `src/app/api/reports/route.ts`)
- Login Handler → Login Rate Limit: checks attempts (evidence: `src/app/api/auth/login/route.ts`)
- Login Handler → Prisma Database: finds user (evidence: `src/app/api/auth/login/route.ts`)
- Login Handler → Signed Sessions: verifies and creates session (evidence: `src/app/api/auth/login/route.ts`)
- News Editor → News Management: uses actions (evidence: `src/components/NewsForm.tsx`)
- News Management → Prisma Database: reads and writes (evidence: `src/app/dashboard/noticias/actions.ts`)
- News Management → Signed Sessions: checks session (evidence: `src/app/dashboard/noticias/actions.ts`)
- Employee Editor → HR Actions: uses actions (evidence: `src/components/rh/EmployeeForm.tsx`)
- HR Actions → Prisma Database: reads and writes (evidence: `src/app/dashboard/rh/actions.ts`)
- HR Actions → Signed Sessions: checks session (evidence: `src/app/dashboard/rh/actions.ts`)
- Patient Editor → Patient Actions: uses actions (evidence: `src/components/psicologia/PatientForm.tsx`)
- Patient Editor → Quick Employee Creation: renders (evidence: `src/components/psicologia/PatientForm.tsx`)
- Quick Employee Creation → Patient Actions: uses actions (evidence: `src/components/psicologia/QuickEmployeeModal.tsx`)
- Patient Actions → Prisma Database: reads and writes (evidence: `src/app/dashboard/psicologia/pacientes/actions.ts`)
- Patient Actions → Signed Sessions: checks session (evidence: `src/app/dashboard/psicologia/pacientes/actions.ts`)
- Report Intake & Tracking → Prisma Database: stores and queries (evidence: `src/app/api/reports/route.ts`)
- Admin Dashboard → News Management: manages
- Admin Dashboard → HR Actions: manages
- Admin Dashboard → Patient Actions: manages
