# org-nexus-projects/ufabc-next-server architecture

> Architecture diagram of the GitHub repository org-nexus-projects/ufabc-next-server, 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/org-nexus-projects/ufabc-next-server
- Repository: https://github.com/org-nexus-projects/ufabc-next-server

## Overview

ufabc-next-server is the Node.js backend for UFABC Next. Its API covers academic records and enrollment synchronization, comments and reviews, user and teacher services, and statistics; background processors handle enrollment updates and confirmation emails. The visible runtime entry point bootstraps ordered setup steps before serving requests. Sampled route files show registrations to handlers, but most handler internals and data-layer calls were not inspected, so those connections are omitted. The README identifies the product but documents few domain details.

Main entry points: [`app/server.js`](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/server.js) (Server entry), [`app/app.js`](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/app.js) (Bootstrap loader), [`app/api/status/route.js`](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/status/route.js) (Status route), [`app/api/disciplinas/teachers/route.js`](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/disciplinas/teachers/route.js) (Course teachers route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime setup"]
  node_server["Server entry<br/>[server.js]"]
  node_bootstrap["Bootstrap loader<br/>[app.js]"]
  node_api["API routes<br/>[api.js]"]
  node_status_route["Status route<br/>[route.js]"]
  node_status_handler["Status handler<br/>[func.js]"]
end

subgraph group_academic["Academic services"]
  node_disc_teachers_route["Course teachers route<br/>[route.js]"]
  node_disc_teachers_handler["Course teachers handler<br/>[func.js]"]
  node_histories_route["History sync route<br/>[route.js]"]
  node_histories_handler["History sync handler<br/>[func.js]"]
  node_enrollments_api["Enrollment services"]
  node_matriculas_api["Matricula sync<br/>[func.js]"]
  node_stats_handler["Course statistics<br/>[func.js]"]
end

subgraph group_community["Community services"]
  node_reviews_subjects_route["Subject reviews route<br/>[route.js]"]
  node_reviews_subjects_handler["Subject reviews handler<br/>[func.js]"]
  node_reviews_teachers_route["Teacher reviews route<br/>[route.js]"]
  node_reviews_teachers_handler["Teacher reviews handler<br/>[func.js]"]
  node_comments_api["Comment services"]
  node_facebook_handler["Facebook sync<br/>[func.js]"]
end

subgraph group_background["Background processing"]
  node_enrollment_jobs["Enrollment processors"]
  node_user_enrollment_job["User enrollment updates"]
  node_email_job["Confirmation email job"]
end

node_operator(("Service operator"))

node_operator -.->|"starts"| node_server
node_server -->|"bootstraps"| node_bootstrap
node_bootstrap -->|"loads setup"| node_api
node_status_route -->|"registers"| node_status_handler
node_disc_teachers_route -->|"registers"| node_disc_teachers_handler
node_histories_route -->|"registers"| node_histories_handler
node_reviews_subjects_route -->|"registers"| node_reviews_subjects_handler
node_reviews_teachers_route -->|"registers"| node_reviews_teachers_handler

click node_server "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/server.js"
click node_bootstrap "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/app.js"
click node_api "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/setup/api.js"
click node_status_route "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/status/route.js"
click node_status_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/status/func.js"
click node_disc_teachers_route "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/disciplinas/teachers/route.js"
click node_disc_teachers_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/disciplinas/teachers/func.js"
click node_histories_route "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/histories/route.js"
click node_histories_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/histories/func.js"
click node_enrollments_api "https://github.com/org-nexus-projects/ufabc-next-server/tree/master/app/api/enrollments"
click node_matriculas_api "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/matriculas/sync/func.js"
click node_stats_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/stats/disciplinas/func.js"
click node_reviews_subjects_route "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/subjects/route.js"
click node_reviews_subjects_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/subjects/func.js"
click node_reviews_teachers_route "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/teachers/route.js"
click node_reviews_teachers_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/teachers/func.js"
click node_comments_api "https://github.com/org-nexus-projects/ufabc-next-server/tree/master/app/api/comment"
click node_facebook_handler "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/facebook/func.js"
click node_enrollment_jobs "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/enrollments/updateEnrollments.js"
click node_user_enrollment_job "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/enrollments/updateUserEnrollments.js"
click node_email_job "https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/emails/sendConfirmation.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_server,node_bootstrap,node_api,node_status_route,node_status_handler toneBlue
class node_disc_teachers_route,node_disc_teachers_handler,node_histories_route,node_histories_handler,node_enrollments_api,node_matriculas_api,node_stats_handler toneAmber
class node_reviews_subjects_route,node_reviews_subjects_handler,node_reviews_teachers_route,node_reviews_teachers_handler,node_comments_api,node_facebook_handler toneMint
class node_enrollment_jobs,node_user_enrollment_job,node_email_job toneRose
class node_operator toneIndigo
```

## Components

### Runtime setup

- [Server entry](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/server.js): `app/server.js`
- [Bootstrap loader](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/app.js): `app/app.js`
- [API routes](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/setup/api.js): `app/setup/api.js`
- [Status route](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/status/route.js): `app/api/status/route.js`
- [Status handler](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/status/func.js): `app/api/status/func.js`

### Academic services

- [Course teachers route](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/disciplinas/teachers/route.js): `app/api/disciplinas/teachers/route.js`
- [Course teachers handler](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/disciplinas/teachers/func.js): `app/api/disciplinas/teachers/func.js`
- [History sync route](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/histories/route.js): `app/api/histories/route.js`
- [History sync handler](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/histories/func.js): `app/api/histories/func.js`
- [Enrollment services](https://github.com/org-nexus-projects/ufabc-next-server/tree/master/app/api/enrollments): `app/api/enrollments`
- [Matricula sync](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/matriculas/sync/func.js): `app/api/matriculas/sync/func.js`
- [Course statistics](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/stats/disciplinas/func.js): `app/api/stats/disciplinas/func.js`

### Community services

- [Subject reviews route](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/subjects/route.js): `app/api/reviews/subjects/route.js`
- [Subject reviews handler](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/subjects/func.js): `app/api/reviews/subjects/func.js`
- [Teacher reviews route](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/teachers/route.js): `app/api/reviews/teachers/route.js`
- [Teacher reviews handler](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/reviews/teachers/func.js): `app/api/reviews/teachers/func.js`
- [Comment services](https://github.com/org-nexus-projects/ufabc-next-server/tree/master/app/api/comment): `app/api/comment`
- [Facebook sync](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/api/facebook/func.js): `app/api/facebook/func.js`

### Background processing

- [Enrollment processors](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/enrollments/updateEnrollments.js): `app/agenda/processors/enrollments/updateEnrollments.js`
- [User enrollment updates](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/enrollments/updateUserEnrollments.js): `app/agenda/processors/enrollments/updateUserEnrollments.js`
- [Confirmation email job](https://github.com/org-nexus-projects/ufabc-next-server/blob/master/app/agenda/processors/emails/sendConfirmation.js): `app/agenda/processors/emails/sendConfirmation.js`

### Other components

- **Service operator**

## Connections

- Service operator → Server entry: starts
- Server entry → Bootstrap loader: bootstraps (evidence: `app/server.js`)
- Bootstrap loader → API routes: loads setup (evidence: `app/app.js`)
- Status route → Status handler: registers (evidence: `app/api/status/route.js`)
- Course teachers route → Course teachers handler: registers (evidence: `app/api/disciplinas/teachers/route.js`)
- History sync route → History sync handler: registers (evidence: `app/api/histories/route.js`)
- Subject reviews route → Subject reviews handler: registers (evidence: `app/api/reviews/subjects/route.js`)
- Teacher reviews route → Teacher reviews handler: registers (evidence: `app/api/reviews/teachers/route.js`)
