# suportecrede07/safc architecture

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

- Interactive diagram: https://gitdiagram.com/suportecrede07/safc
- Repository: https://github.com/suportecrede07/safc

## Overview

SAFC manages a school science-fair evaluation from institutional and project registration through jury assignment, scoring, ranking, and reporting. Administrators configure criteria, tie-break rules, and dynamic form fields; jurors evaluate assigned work through the web interface or documented Android app. The graph preserves these distinct stages and the analytics/reporting branches. Source excerpts show the web dashboards’ database, ranking, evaluation, and PDF connections; some other links reflect README-documented capabilities because their implementation was not sampled.

Main entry points: [`html/admin-dashboard.php`](https://github.com/suportecrede07/safc/blob/main/html/admin-dashboard.php) (Admin dashboard), [`html/jurado-dashboard.php`](https://github.com/suportecrede07/safc/blob/main/html/jurado-dashboard.php) (Juror dashboard), [`html/admin-relatorios.php`](https://github.com/suportecrede07/safc/blob/main/html/admin-relatorios.php) (Report selection), [`html/admin-graficos.php`](https://github.com/suportecrede07/safc/blob/main/html/admin-graficos.php) (Charts and dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and roles"]
  node_admin_login["Admin login<br/>[login_adm.php]"]
  node_judge_login["Juror login<br/>[login_jurado.php]"]
  node_login_logic["Juror authentication<br/>[Jurado.php]"]
end

subgraph group_management["Competition management"]
  node_admin_dashboard["Admin dashboard"]
  node_schools["School records<br/>[Cadescola.php]"]
  node_judges["Juror records<br/>[Cadjurado.php]"]
  node_projects["Work records<br/>[Cadtrabalho.php]"]
  node_assignment["Jury assignment"]
  node_configuration["Evaluation configuration<br/>[admin-config.php]"]
  node_dynamic_fields["Dynamic fields"]
  node_email["Juror email"]
end

subgraph group_evaluation["Evaluation and results"]
  node_jury_dashboard["Juror dashboard"]
  node_evaluation_actions["Evaluation actions"]
  node_ranking["Ranking engine<br/>[CalculoRanking.php]"]
  node_mobile_app["Android juror app"]
end

subgraph group_insights["Analytics and reports"]
  node_analytics["Charts and dashboard<br/>[admin-graficos.php]"]
  node_reports_ui["Report selection"]
  node_pdf["PDF generation"]
  node_exports["Report exports"]
end

node_admin(("Administrator"))
node_judge(("Juror"))
node_database[("MySQL database")]

node_admin -->|"signs in"| node_admin_login
node_judge -->|"signs in"| node_judge_login
node_admin_login -.->|"opens panel"| node_admin_dashboard
node_judge_login -->|"authenticates"| node_login_logic
node_login_logic -->|"reads credentials"| node_database
node_admin -->|"manages event"| node_admin_dashboard
node_admin_dashboard -->|"queries data"| node_database
node_admin -->|"registers schools"| node_schools
node_admin -->|"registers jurors"| node_judges
node_admin -->|"registers work"| node_projects
node_admin -->|"assigns jurors"| node_assignment
node_admin -->|"configures rules"| node_configuration
node_configuration -->|"defines fields"| node_dynamic_fields
node_schools -->|"writes records"| node_database
node_judges -->|"writes records"| node_database
node_projects -->|"writes records"| node_database
node_assignment -->|"stores assignments"| node_database
node_judge -->|"opens evaluations"| node_jury_dashboard
node_mobile_app -.->|"supports evaluation"| node_jury_dashboard
node_jury_dashboard -->|"loads assigned work"| node_database
node_jury_dashboard -->|"submits scores"| node_evaluation_actions
node_evaluation_actions -.->|"stores evaluations"| node_database
node_admin_dashboard -->|"loads ranking"| node_ranking
node_analytics -->|"uses calculations"| node_ranking
node_analytics -->|"queries metrics"| node_database
node_admin -->|"reviews results"| node_analytics
node_admin -->|"requests reports"| node_reports_ui
node_reports_ui -->|"loads PDF generator"| node_pdf
node_pdf -->|"reads evaluations"| node_database
node_reports_ui -.->|"requests exports"| node_exports
node_admin -->|"sends access link"| node_email

click node_admin_login "https://github.com/suportecrede07/safc/blob/main/html/login_adm.php"
click node_judge_login "https://github.com/suportecrede07/safc/blob/main/html/login_jurado.php"
click node_admin_dashboard "https://github.com/suportecrede07/safc/blob/main/html/admin-dashboard.php"
click node_schools "https://github.com/suportecrede07/safc/blob/main/php/Cadescola.php"
click node_judges "https://github.com/suportecrede07/safc/blob/main/php/Cadjurado.php"
click node_projects "https://github.com/suportecrede07/safc/blob/main/php/Cadtrabalho.php"
click node_assignment "https://github.com/suportecrede07/safc/blob/main/php/AssociarJuradoTrabalho.php"
click node_configuration "https://github.com/suportecrede07/safc/blob/main/html/admin-config.php"
click node_dynamic_fields "https://github.com/suportecrede07/safc/blob/main/php/SincronizarCamposDinamicos.php"
click node_jury_dashboard "https://github.com/suportecrede07/safc/blob/main/html/jurado-dashboard.php"
click node_login_logic "https://github.com/suportecrede07/safc/blob/main/php/Jurado.php"
click node_evaluation_actions "https://github.com/suportecrede07/safc/blob/main/php/SalvarAvaliacao.php"
click node_ranking "https://github.com/suportecrede07/safc/blob/main/php/CalculoRanking.php"
click node_mobile_app "https://github.com/suportecrede07/safc/tree/main/SAFCApp"
click node_analytics "https://github.com/suportecrede07/safc/blob/main/html/admin-graficos.php"
click node_reports_ui "https://github.com/suportecrede07/safc/blob/main/html/admin-relatorios.php"
click node_pdf "https://github.com/suportecrede07/safc/blob/main/pdf/gerar-pdf-string.php"
click node_exports "https://github.com/suportecrede07/safc/blob/main/pdf/gerar-zip-stream.php"
click node_email "https://github.com/suportecrede07/safc/blob/main/php/EnviarLinkjurados.php"

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_admin_login,node_judge_login,node_login_logic toneBlue
class node_admin_dashboard,node_schools,node_judges,node_projects,node_assignment,node_configuration,node_dynamic_fields,node_email,node_database toneAmber
class node_jury_dashboard,node_evaluation_actions,node_ranking,node_mobile_app toneMint
class node_analytics,node_reports_ui,node_pdf,node_exports toneRose
class node_admin,node_judge toneIndigo
```

## Components

### Access and roles

- [Admin login](https://github.com/suportecrede07/safc/blob/main/html/login_adm.php): `html/login_adm.php`
- [Juror login](https://github.com/suportecrede07/safc/blob/main/html/login_jurado.php): `html/login_jurado.php`
- [Juror authentication](https://github.com/suportecrede07/safc/blob/main/php/Jurado.php): `php/Jurado.php`

### Competition management

- [Admin dashboard](https://github.com/suportecrede07/safc/blob/main/html/admin-dashboard.php): `html/admin-dashboard.php`
- [School records](https://github.com/suportecrede07/safc/blob/main/php/Cadescola.php): `php/Cadescola.php`
- [Juror records](https://github.com/suportecrede07/safc/blob/main/php/Cadjurado.php): `php/Cadjurado.php`
- [Work records](https://github.com/suportecrede07/safc/blob/main/php/Cadtrabalho.php): `php/Cadtrabalho.php`
- [Jury assignment](https://github.com/suportecrede07/safc/blob/main/php/AssociarJuradoTrabalho.php): `php/AssociarJuradoTrabalho.php`
- [Evaluation configuration](https://github.com/suportecrede07/safc/blob/main/html/admin-config.php): `html/admin-config.php`
- [Dynamic fields](https://github.com/suportecrede07/safc/blob/main/php/SincronizarCamposDinamicos.php): `php/SincronizarCamposDinamicos.php`
- [Juror email](https://github.com/suportecrede07/safc/blob/main/php/EnviarLinkjurados.php): `php/EnviarLinkjurados.php`

### Evaluation and results

- [Juror dashboard](https://github.com/suportecrede07/safc/blob/main/html/jurado-dashboard.php): `html/jurado-dashboard.php`
- [Evaluation actions](https://github.com/suportecrede07/safc/blob/main/php/SalvarAvaliacao.php): `php/SalvarAvaliacao.php`
- [Ranking engine](https://github.com/suportecrede07/safc/blob/main/php/CalculoRanking.php): `php/CalculoRanking.php`
- [Android juror app](https://github.com/suportecrede07/safc/tree/main/SAFCApp): `SAFCApp`

### Analytics and reports

- [Charts and dashboard](https://github.com/suportecrede07/safc/blob/main/html/admin-graficos.php): `html/admin-graficos.php`
- [Report selection](https://github.com/suportecrede07/safc/blob/main/html/admin-relatorios.php): `html/admin-relatorios.php`
- [PDF generation](https://github.com/suportecrede07/safc/blob/main/pdf/gerar-pdf-string.php): `pdf/gerar-pdf-string.php`
- [Report exports](https://github.com/suportecrede07/safc/blob/main/pdf/gerar-zip-stream.php): `pdf/gerar-zip-stream.php`

### Other components

- **Administrator**
- **Juror**
- **MySQL database**

## Connections

- Administrator → Admin login: signs in
- Juror → Juror login: signs in
- Admin login → Admin dashboard: opens panel
- Juror login → Juror authentication: authenticates (evidence: `php/Jurado.php`)
- Juror authentication → MySQL database: reads credentials (evidence: `php/Jurado.php`)
- Administrator → Admin dashboard: manages event
- Admin dashboard → MySQL database: queries data (evidence: `html/admin-dashboard.php`)
- Administrator → School records: registers schools
- Administrator → Juror records: registers jurors
- Administrator → Work records: registers work
- Administrator → Jury assignment: assigns jurors
- Administrator → Evaluation configuration: configures rules
- Evaluation configuration → Dynamic fields: defines fields
- School records → MySQL database: writes records (evidence: `php/Cadescola.php`)
- Juror records → MySQL database: writes records (evidence: `php/Cadjurado.php`)
- Work records → MySQL database: writes records (evidence: `php/Cadtrabalho.php`)
- Jury assignment → MySQL database: stores assignments (evidence: `php/AssociarJuradoTrabalho.php`)
- Juror → Juror dashboard: opens evaluations
- Android juror app → Juror dashboard: supports evaluation
- Juror dashboard → MySQL database: loads assigned work (evidence: `html/jurado-dashboard.php`)
- Juror dashboard → Evaluation actions: submits scores (evidence: `html/jurado-dashboard.php`)
- Evaluation actions → MySQL database: stores evaluations
- Admin dashboard → Ranking engine: loads ranking (evidence: `html/admin-dashboard.php`)
- Charts and dashboard → Ranking engine: uses calculations (evidence: `html/admin-graficos.php`)
- Charts and dashboard → MySQL database: queries metrics (evidence: `html/admin-graficos.php`)
- Administrator → Charts and dashboard: reviews results
- Administrator → Report selection: requests reports
- Report selection → PDF generation: loads PDF generator (evidence: `html/admin-relatorios.php`)
- PDF generation → MySQL database: reads evaluations (evidence: `pdf/gerar-pdf-string.php`)
- Report selection → Report exports: requests exports
- Administrator → Juror email: sends access link
