# everhernandez-360/pi_desarrolloweb_grupo5 architecture

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

- Interactive diagram: https://gitdiagram.com/everhernandez-360/pi_desarrolloweb_grupo5
- Repository: https://github.com/everhernandez-360/pi_desarrolloweb_grupo5

## Overview

Rating de Catedráticos is a web app for registering and authenticating users, browsing and filtering professor/course rating publications, creating posts, viewing publication comments, and managing user profiles. The main flow runs from React screens through service/API requests to Express routes, controllers, models, and MySQL. The graph reflects indexed imports and shown calls; the README is empty, and some backend route/controller and frontend screen details are supported only by the source index, so uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/App.jsx) (App routing), [`backend/src/middlewares/auth.js`](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/middlewares/auth.js) (JWT middleware), [`backend/src/config/database.js`](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/config/database.js) (MySQL pool), [`backend/src/app.js`](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/app.js) (Express app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth_forms["Auth forms<br/>[LoginForm.jsx]"]
  node_register_form["Registration<br/>[RegisterForm.jsx]"]
  node_forgot_form["Password reset"]
  node_publication_list["Publication feed"]
  node_create_publication["Create publication"]
  node_publication_detail["Publication detail"]
  node_comments["Comment section<br/>[CommentSection.jsx]"]
  node_profile_search["Profile and search<br/>[UserProfile.jsx]"]
end

subgraph group_client_api["Client services"]
  node_auth_service["Auth service<br/>[authService.js]"]
  node_publication_service["Publication service"]
  node_comment_service["Comment service<br/>[commentService.js]"]
  node_user_service["User service<br/>[userService.js]"]
  node_http_client["HTTP client<br/>[api.js]"]
end

subgraph group_server["Backend API"]
  node_express_app["Express app<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_publication_routes["Publication routes<br/>[publications.js]"]
  node_comment_routes["Comment routes<br/>[comments.js]"]
  node_user_routes["User routes<br/>[users.js]"]
  node_auth_controller["Auth controller<br/>[AuthController.js]"]
  node_publication_controller["Publication controller"]
  node_comment_controller["Comment controller"]
  node_user_controller["User controller<br/>[UserController.js]"]
  node_auth_middleware["JWT middleware<br/>[auth.js]"]
  node_jwt["JWT utilities<br/>[jwt.js]"]
end

subgraph group_persistence["Persistence"]
  node_user_model["User model<br/>[User.js]"]
  node_publication_model["Publication model<br/>[Publication.js]"]
  node_comment_model["Comment model<br/>[Comment.js]"]
  node_pool["MySQL pool<br/>[database.js]"]
  node_migrations["Schema migration<br/>[migrate.js]"]
end

node_visitor(("Visitor"))
node_mysql[("MySQL database")]

node_visitor -->|"uses"| node_app
node_app -->|"routes"| node_auth_forms
node_app -->|"routes"| node_register_form
node_app -->|"routes"| node_publication_list
node_app -->|"routes"| node_create_publication
node_app -->|"routes"| node_publication_detail
node_app -->|"renders"| node_profile_search
node_app -->|"imports"| node_forgot_form
node_auth_forms -->|"calls"| node_auth_service
node_register_form -->|"calls"| node_auth_service
node_forgot_form -->|"calls"| node_auth_service
node_publication_list -->|"calls"| node_publication_service
node_create_publication -->|"calls"| node_publication_service
node_publication_detail -->|"calls"| node_publication_service
node_publication_detail -->|"renders"| node_comments
node_comments -->|"calls"| node_comment_service
node_profile_search -->|"calls"| node_user_service
node_auth_service -->|"requests"| node_http_client
node_publication_service -->|"requests"| node_http_client
node_comment_service -->|"requests"| node_http_client
node_user_service -->|"requests"| node_http_client
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_publication_routes
node_express_app -->|"mounts"| node_comment_routes
node_express_app -->|"mounts"| node_user_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_publication_routes -->|"dispatches"| node_publication_controller
node_comment_routes -->|"dispatches"| node_comment_controller
node_user_routes -->|"dispatches"| node_user_controller
node_auth_routes -->|"protects"| node_auth_middleware
node_publication_routes -->|"protects"| node_auth_middleware
node_comment_routes -->|"protects"| node_auth_middleware
node_user_routes -->|"protects"| node_auth_middleware
node_auth_middleware -->|"verifies"| node_jwt
node_auth_controller -->|"generates"| node_jwt
node_auth_controller -->|"uses"| node_user_model
node_publication_controller -->|"uses"| node_publication_model
node_publication_controller -->|"reads comments"| node_comment_model
node_comment_controller -->|"uses"| node_comment_model
node_user_controller -->|"uses"| node_user_model
node_user_model -->|"queries"| node_pool
node_publication_model -->|"queries"| node_pool
node_comment_model -->|"queries"| node_pool
node_pool -.->|"connects"| node_mysql
node_migrations -->|"uses"| node_pool

click node_app "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/App.jsx"
click node_auth_forms "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/LoginForm.jsx"
click node_register_form "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/RegisterForm.jsx"
click node_forgot_form "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/ForgotPaswordForm.jsx"
click node_publication_list "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/PublicationList.jsx"
click node_create_publication "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/CreatePublication.jsx"
click node_publication_detail "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/PublicationDetail.jsx"
click node_comments "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/CommentSection.jsx"
click node_profile_search "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/UserProfile.jsx"
click node_auth_service "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/authService.js"
click node_publication_service "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/publicationService.js"
click node_comment_service "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/commentService.js"
click node_user_service "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/userService.js"
click node_http_client "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/api.js"
click node_express_app "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/app.js"
click node_auth_routes "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/auth.js"
click node_publication_routes "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/publications.js"
click node_comment_routes "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/comments.js"
click node_user_routes "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/users.js"
click node_auth_controller "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/AuthController.js"
click node_publication_controller "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/PublicationController.js"
click node_comment_controller "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/CommentController.js"
click node_user_controller "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/UserController.js"
click node_auth_middleware "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/middlewares/auth.js"
click node_jwt "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/utils/jwt.js"
click node_user_model "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/User.js"
click node_publication_model "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/Publication.js"
click node_comment_model "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/Comment.js"
click node_pool "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/config/database.js"
click node_migrations "https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/config/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_auth_forms,node_register_form,node_forgot_form,node_publication_list,node_create_publication,node_publication_detail,node_comments,node_profile_search toneBlue
class node_auth_service,node_publication_service,node_comment_service,node_user_service,node_http_client,node_mysql toneAmber
class node_express_app,node_auth_routes,node_publication_routes,node_comment_routes,node_user_routes,node_auth_controller,node_publication_controller,node_comment_controller,node_user_controller,node_auth_middleware,node_jwt toneMint
class node_user_model,node_publication_model,node_comment_model,node_pool,node_migrations toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [App routing](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth forms](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/LoginForm.jsx): `frontend/src/components/LoginForm.jsx`
- [Registration](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/RegisterForm.jsx): `frontend/src/components/RegisterForm.jsx`
- [Password reset](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/ForgotPaswordForm.jsx): `frontend/src/components/ForgotPaswordForm.jsx`
- [Publication feed](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/PublicationList.jsx): `frontend/src/components/PublicationList.jsx`
- [Create publication](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/CreatePublication.jsx): `frontend/src/components/CreatePublication.jsx`
- [Publication detail](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/PublicationDetail.jsx): `frontend/src/components/PublicationDetail.jsx`
- [Comment section](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/CommentSection.jsx): `frontend/src/components/CommentSection.jsx`
- [Profile and search](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/components/UserProfile.jsx): `frontend/src/components/UserProfile.jsx`

### Client services

- [Auth service](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Publication service](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/publicationService.js): `frontend/src/services/publicationService.js`
- [Comment service](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/commentService.js): `frontend/src/services/commentService.js`
- [User service](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/userService.js): `frontend/src/services/userService.js`
- [HTTP client](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Backend API

- [Express app](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Publication routes](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/publications.js): `backend/src/routes/publications.js`
- [Comment routes](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/comments.js): `backend/src/routes/comments.js`
- [User routes](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/routes/users.js): `backend/src/routes/users.js`
- [Auth controller](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/AuthController.js): `backend/src/controllers/AuthController.js`
- [Publication controller](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/PublicationController.js): `backend/src/controllers/PublicationController.js`
- [Comment controller](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/CommentController.js): `backend/src/controllers/CommentController.js`
- [User controller](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/controllers/UserController.js): `backend/src/controllers/UserController.js`
- [JWT middleware](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/middlewares/auth.js): `backend/src/middlewares/auth.js`
- [JWT utilities](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/utils/jwt.js): `backend/src/utils/jwt.js`

### Persistence

- [User model](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Publication model](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/Publication.js): `backend/src/models/Publication.js`
- [Comment model](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/models/Comment.js): `backend/src/models/Comment.js`
- [MySQL pool](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/config/database.js): `backend/src/config/database.js`
- [Schema migration](https://github.com/everhernandez-360/pi_desarrolloweb_grupo5/blob/main/backend/src/config/migrate.js): `backend/src/config/migrate.js`

### Other components

- **Visitor**
- **MySQL database**

## Connections

- Visitor → App routing: uses (evidence: `frontend/src/App.jsx`)
- App routing → Auth forms: routes (evidence: `frontend/src/App.jsx`)
- App routing → Registration: routes (evidence: `frontend/src/App.jsx`)
- App routing → Publication feed: routes (evidence: `frontend/src/App.jsx`)
- App routing → Create publication: routes (evidence: `frontend/src/App.jsx`)
- App routing → Publication detail: routes (evidence: `frontend/src/App.jsx`)
- App routing → Profile and search: renders (evidence: `frontend/src/App.jsx`)
- App routing → Password reset: imports (evidence: `frontend/src/App.jsx`)
- Auth forms → Auth service: calls (evidence: `frontend/src/components/LoginForm.jsx`)
- Registration → Auth service: calls (evidence: `frontend/src/components/RegisterForm.jsx`)
- Password reset → Auth service: calls (evidence: `frontend/src/components/ForgotPaswordForm.jsx`)
- Publication feed → Publication service: calls (evidence: `frontend/src/components/PublicationList.jsx`)
- Create publication → Publication service: calls (evidence: `frontend/src/components/CreatePublication.jsx`)
- Publication detail → Publication service: calls (evidence: `frontend/src/components/PublicationDetail.jsx`)
- Publication detail → Comment section: renders (evidence: `frontend/src/components/PublicationDetail.jsx`)
- Comment section → Comment service: calls (evidence: `frontend/src/components/CommentSection.jsx`)
- Profile and search → User service: calls (evidence: `frontend/src/components/UserProfile.jsx`)
- Auth service → HTTP client: requests (evidence: `frontend/src/services/authService.js`)
- Publication service → HTTP client: requests (evidence: `frontend/src/services/publicationService.js`)
- Comment service → HTTP client: requests (evidence: `frontend/src/services/commentService.js`)
- User service → HTTP client: requests (evidence: `frontend/src/services/userService.js`)
- Express app → Auth routes: mounts (evidence: `backend/src/app.js`)
- Express app → Publication routes: mounts (evidence: `backend/src/app.js`)
- Express app → Comment routes: mounts (evidence: `backend/src/app.js`)
- Express app → User routes: mounts (evidence: `backend/src/app.js`)
- Auth routes → Auth controller: dispatches (evidence: `backend/src/routes/auth.js`)
- Publication routes → Publication controller: dispatches (evidence: `backend/src/routes/publications.js`)
- Comment routes → Comment controller: dispatches (evidence: `backend/src/routes/comments.js`)
- User routes → User controller: dispatches (evidence: `backend/src/routes/users.js`)
- Auth routes → JWT middleware: protects (evidence: `backend/src/routes/auth.js`)
- Publication routes → JWT middleware: protects (evidence: `backend/src/routes/publications.js`)
- Comment routes → JWT middleware: protects (evidence: `backend/src/routes/comments.js`)
- User routes → JWT middleware: protects (evidence: `backend/src/routes/users.js`)
- JWT middleware → JWT utilities: verifies (evidence: `backend/src/middlewares/auth.js`)
- Auth controller → JWT utilities: generates (evidence: `backend/src/controllers/AuthController.js`)
- Auth controller → User model: uses (evidence: `backend/src/controllers/AuthController.js`)
- Publication controller → Publication model: uses (evidence: `backend/src/controllers/PublicationController.js`)
- Publication controller → Comment model: reads comments (evidence: `backend/src/controllers/PublicationController.js`)
- Comment controller → Comment model: uses (evidence: `backend/src/controllers/CommentController.js`)
- User controller → User model: uses (evidence: `backend/src/controllers/UserController.js`)
- User model → MySQL pool: queries (evidence: `backend/src/models/User.js`)
- Publication model → MySQL pool: queries (evidence: `backend/src/models/Publication.js`)
- Comment model → MySQL pool: queries (evidence: `backend/src/models/Comment.js`)
- MySQL pool → MySQL database: connects (evidence: `backend/src/config/database.js`)
- Schema migration → MySQL pool: uses (evidence: `backend/src/config/migrate.js`)
