# joaoptoaldo/sistema-facul architecture

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

- Interactive diagram: https://gitdiagram.com/joaoptoaldo/sistema-facul
- Repository: https://github.com/joaoptoaldo/sistema-facul

## Overview

Sistema Universitário is a React web app backed by an Express API and SQLite. Users navigate university pages to register students or professors, browse courses, and submit contact messages; those pages call the corresponding API resources. The backend routes requests through controllers and business services to repositories and the database. The README documents the UI capabilities and API endpoints; sampled source confirms several layer calls, while some page-to-API links are documented rather than visible in the excerpts.

Main entry points: [`frontend/src/App.jsx`](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/App.jsx) (Page router), [`backend/src/app.js`](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/app.js) (Express application), [`backend/src/database/connection.js`](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/database/connection.js) (SQLite database), [`backend/src/routes/alunos.routes.js`](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/alunos.routes.js) (Students API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Page router<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_studentform["Student registration<br/>[CadastroAluno.jsx]"]
  node_teacherform["Professor registration"]
  node_coursespage["Course listing<br/>[Cursos.jsx]"]
  node_contactform["Contact form<br/>[Contato.jsx]"]
end

subgraph group_api["API routing"]
  node_studentapi["Students API<br/>[alunos.routes.js]"]
  node_teacherapi["Professors API"]
  node_coursesapi["Courses API<br/>[cursos.routes.js]"]
  node_contactapi["Contacts API<br/>[contatos.routes.js]"]
  node_healthapi["Health API<br/>[health.routes.js]"]
  node_studentcontroller["Student handlers"]
  node_teachercontroller["Professor handlers"]
  node_contactcontroller["Contact handlers"]
end

subgraph group_domain["Domain services"]
  node_coursesservice["Course service<br/>[cursos.service.js]"]
  node_healthservice["Health service<br/>[health.service.js]"]
  node_studentservice["Student service<br/>[alunos.service.js]"]
  node_teacherservice["Professor service"]
  node_contactservice["Contact service"]
  node_errorhandling["Error handling"]
end

subgraph group_persistence["Persistence"]
  node_studentrepo["Student repository"]
  node_teacherrepo["Professor repository"]
  node_courserepo["Course repository"]
  node_contactrepo["Contact repository"]
  node_sqlite[("SQLite database<br/>[connection.js]")]
end

subgraph group_operations["Server operations"]
  node_server["HTTP server<br/>[server.js]"]
  node_expressapp["Express application<br/>[app.js]"]
  node_migration["Schema and seed<br/>[migrate.js]"]
end

node_user(("University user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"renders"| node_navbar
node_app -->|"routes to"| node_studentform
node_app -->|"routes to"| node_teacherform
node_app -->|"routes to"| node_coursespage
node_app -->|"routes to"| node_contactform
node_studentform -->|"calls"| node_studentapi
node_teacherform -->|"calls"| node_teacherapi
node_coursespage -->|"fetches"| node_coursesapi
node_contactform -->|"calls"| node_contactapi
node_expressapp -->|"mounts"| node_studentapi
node_expressapp -->|"mounts"| node_teacherapi
node_expressapp -->|"mounts"| node_coursesapi
node_expressapp -->|"mounts"| node_contactapi
node_expressapp -->|"mounts"| node_healthapi
node_studentapi -->|"dispatches"| node_studentcontroller
node_teacherapi -->|"dispatches"| node_teachercontroller
node_contactapi -->|"dispatches"| node_contactcontroller
node_studentcontroller -->|"calls"| node_studentservice
node_teachercontroller -->|"calls"| node_teacherservice
node_contactcontroller -->|"calls"| node_contactservice
node_studentservice -->|"queries"| node_studentrepo
node_teacherservice -->|"queries"| node_teacherrepo
node_studentrepo -->|"reads and writes"| node_sqlite
node_teacherrepo -->|"reads and writes"| node_sqlite
node_coursesservice -->|"queries"| node_courserepo
node_contactservice -->|"queries"| node_contactrepo
node_courserepo -->|"reads"| node_sqlite
node_contactrepo -->|"reads and writes"| node_sqlite
node_server -->|"starts"| node_expressapp
node_server -->|"runs"| node_migration
node_migration -->|"initializes"| node_sqlite
node_expressapp -->|"registers"| node_errorhandling

click node_app "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Home.jsx"
click node_navbar "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Navbar.jsx"
click node_studentform "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/CadastroAluno.jsx"
click node_teacherform "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/CadastroProfessor.jsx"
click node_coursespage "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Cursos.jsx"
click node_contactform "https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Contato.jsx"
click node_studentapi "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/alunos.routes.js"
click node_teacherapi "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/professores.routes.js"
click node_coursesapi "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/cursos.routes.js"
click node_contactapi "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/contatos.routes.js"
click node_healthapi "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/health.routes.js"
click node_studentcontroller "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/alunos.controller.js"
click node_teachercontroller "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/professores.controller.js"
click node_contactcontroller "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/contatos.controller.js"
click node_coursesservice "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/cursos.service.js"
click node_healthservice "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/health.service.js"
click node_studentservice "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/alunos.service.js"
click node_teacherservice "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/professores.service.js"
click node_contactservice "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/contatos.service.js"
click node_errorhandling "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/middlewares/error.middleware.js"
click node_studentrepo "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/alunos.repository.js"
click node_teacherrepo "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/professores.repository.js"
click node_courserepo "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/cursos.repository.js"
click node_contactrepo "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/contatos.repository.js"
click node_sqlite "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/database/connection.js"
click node_server "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/server.js"
click node_expressapp "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/app.js"
click node_migration "https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/database/migrate.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_app,node_home,node_navbar,node_studentform,node_teacherform,node_coursespage,node_contactform,node_user toneBlue
class node_studentapi,node_teacherapi,node_coursesapi,node_contactapi,node_healthapi,node_studentcontroller,node_teachercontroller,node_contactcontroller toneAmber
class node_coursesservice,node_healthservice,node_studentservice,node_teacherservice,node_contactservice,node_errorhandling toneMint
class node_studentrepo,node_teacherrepo,node_courserepo,node_contactrepo,node_sqlite toneRose
class node_server,node_expressapp,node_migration toneIndigo
```

## Components

### Web application

- [Page router](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home page](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Home.jsx): `frontend/src/Home.jsx`
- [Navigation](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Navbar.jsx): `frontend/src/Navbar.jsx`
- [Student registration](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/CadastroAluno.jsx): `frontend/src/CadastroAluno.jsx`
- [Professor registration](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/CadastroProfessor.jsx): `frontend/src/CadastroProfessor.jsx`
- [Course listing](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Cursos.jsx): `frontend/src/Cursos.jsx`
- [Contact form](https://github.com/joaoptoaldo/sistema-facul/blob/main/frontend/src/Contato.jsx): `frontend/src/Contato.jsx`

### API routing

- [Students API](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/alunos.routes.js): `backend/src/routes/alunos.routes.js`
- [Professors API](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/professores.routes.js): `backend/src/routes/professores.routes.js`
- [Courses API](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/cursos.routes.js): `backend/src/routes/cursos.routes.js`
- [Contacts API](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/contatos.routes.js): `backend/src/routes/contatos.routes.js`
- [Health API](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/routes/health.routes.js): `backend/src/routes/health.routes.js`
- [Student handlers](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/alunos.controller.js): `backend/src/controllers/alunos.controller.js`
- [Professor handlers](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/professores.controller.js): `backend/src/controllers/professores.controller.js`
- [Contact handlers](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/controllers/contatos.controller.js): `backend/src/controllers/contatos.controller.js`

### Domain services

- [Course service](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/cursos.service.js): `backend/src/services/cursos.service.js`
- [Health service](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/health.service.js): `backend/src/services/health.service.js`
- [Student service](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/alunos.service.js): `backend/src/services/alunos.service.js`
- [Professor service](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/professores.service.js): `backend/src/services/professores.service.js`
- [Contact service](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/services/contatos.service.js): `backend/src/services/contatos.service.js`
- [Error handling](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/middlewares/error.middleware.js): `backend/src/middlewares/error.middleware.js`

### Persistence

- [Student repository](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/alunos.repository.js): `backend/src/data/alunos.repository.js`
- [Professor repository](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/professores.repository.js): `backend/src/data/professores.repository.js`
- [Course repository](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/cursos.repository.js): `backend/src/data/cursos.repository.js`
- [Contact repository](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/data/contatos.repository.js): `backend/src/data/contatos.repository.js`
- [SQLite database](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/database/connection.js): `backend/src/database/connection.js`

### Server operations

- [HTTP server](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/server.js): `backend/src/server.js`
- [Express application](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/app.js): `backend/src/app.js`
- [Schema and seed](https://github.com/joaoptoaldo/sistema-facul/blob/main/backend/src/database/migrate.js): `backend/src/database/migrate.js`

### Other components

- **University user**

## Connections

- University user → Page router: uses (evidence: `README.md`)
- Page router → Home page: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Page router → Student registration: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Professor registration: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Course listing: routes to (evidence: `frontend/src/App.jsx`)
- Page router → Contact form: routes to (evidence: `frontend/src/App.jsx`)
- Student registration → Students API: calls (evidence: `README.md`)
- Professor registration → Professors API: calls (evidence: `README.md`)
- Course listing → Courses API: fetches (evidence: `README.md`)
- Contact form → Contacts API: calls (evidence: `README.md`)
- Express application → Students API: mounts (evidence: `backend/src/app.js`)
- Express application → Professors API: mounts (evidence: `backend/src/app.js`)
- Express application → Courses API: mounts (evidence: `backend/src/app.js`)
- Express application → Contacts API: mounts (evidence: `backend/src/app.js`)
- Express application → Health API: mounts (evidence: `backend/src/app.js`)
- Students API → Student handlers: dispatches (evidence: `backend/src/routes/alunos.routes.js`)
- Professors API → Professor handlers: dispatches (evidence: `backend/src/routes/professores.routes.js`)
- Contacts API → Contact handlers: dispatches (evidence: `backend/src/routes/contatos.routes.js`)
- Student handlers → Student service: calls (evidence: `backend/src/controllers/alunos.controller.js`)
- Professor handlers → Professor service: calls (evidence: `backend/src/controllers/professores.controller.js`)
- Contact handlers → Contact service: calls (evidence: `backend/src/controllers/contatos.controller.js`)
- Student service → Student repository: queries (evidence: `backend/src/services/alunos.service.js`)
- Professor service → Professor repository: queries (evidence: `backend/src/services/professores.service.js`)
- Student repository → SQLite database: reads and writes (evidence: `backend/src/data/alunos.repository.js`)
- Professor repository → SQLite database: reads and writes (evidence: `backend/src/data/professores.repository.js`)
- Course service → Course repository: queries (evidence: `backend/src/services/cursos.service.js`)
- Contact service → Contact repository: queries (evidence: `backend/src/services/contatos.service.js`)
- Course repository → SQLite database: reads (evidence: `backend/src/data/cursos.repository.js`)
- Contact repository → SQLite database: reads and writes (evidence: `backend/src/data/contatos.repository.js`)
- HTTP server → Express application: starts (evidence: `backend/src/server.js`)
- HTTP server → Schema and seed: runs (evidence: `backend/src/server.js`)
- Schema and seed → SQLite database: initializes (evidence: `backend/src/database/migrate.js`)
- Express application → Error handling: registers (evidence: `backend/src/app.js`)
