# no7to/sacsevi-videos architecture

> Architecture diagram of the GitHub repository no7to/sacsevi-videos, 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/no7to/sacsevi-videos
- Repository: https://github.com/no7to/sacsevi-videos

## Overview

Nexo Vial is a course-learning platform: learners register, choose and purchase or access a course, then progress through ordered video modules and server-graded evaluations. Instructors and administrators manage course content, learners, access and payments. The graph includes the documented video, payment, account, administration and expiry capabilities. Arrows are limited to relationships shown in the supplied excerpts or README; some routes and integrations are documented but unsampled.

Main entry points: [`frontend/src/api/client.js`](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/api/client.js) (API client), [`backend/src/services/payment.service.js`](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/payment.service.js) (Payment and access), [`backend/src/services/access.service.js`](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/access.service.js) (Course access), [`backend/src/routes/course.routes.js`](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/course.routes.js) (Course and progress API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_site["Site and routes<br/>[App.jsx]"]
  node_api["API client<br/>[client.js]"]
end

subgraph group_learning["Learning workflow"]
  node_coursepages["Catalog and course pages<br/>[Curso.jsx]"]
  node_modulepage["Module and evaluation<br/>[Modulo.jsx]"]
  node_courseapi["Course and progress API<br/>[course.routes.js]"]
  node_courseengine["Unlocking and grading<br/>[course.service.js]"]
  node_progressdb[("Progress records<br/>[Progreso.js]")]
  node_catalogdb[("Courses and modules<br/>[Curso.js]")]
  node_checkout["Checkout page<br/>[Pago.jsx]"]
  node_paymentapi["Payment routes<br/>[payments.routes.js]"]
  node_streamapi["Video streaming<br/>[stream.routes.js]"]
end

subgraph group_operations["Course operations"]
  node_panel["Staff panel<br/>[VideoManager.jsx]"]
  node_panelapi["Panel management API<br/>[panel.routes.js]"]
end

subgraph group_platform["Platform services"]
  node_identity["Account and sessions<br/>[auth.routes.js]"]
  node_paymentlogic["Payment and access<br/>[payment.service.js]"]
  node_mercadopago["Mercado Pago"]
  node_webhooks["Payment and video webhooks<br/>[webhooks.routes.js]"]
  node_bunny["Bunny Stream<br/>[bunny.service.js]"]
  node_accesslogic["Course access<br/>[access.service.js]"]
  node_accountapi["Account and privacy<br/>[account.routes.js]"]
  node_scheduler["Expiry jobs<br/>[scheduler.js]"]
  node_usersdb[("Users and access<br/>[User.js]")]
  node_paymentsdb[("Payment records<br/>[Pago.js]")]
end

node_learner(("Learner"))
node_staff(("Instructor / admin"))

node_learner -->|"uses"| node_site
node_site -->|"requests data"| node_api
node_api -.->|"auth requests"| node_identity
node_api -.->|"course requests"| node_courseapi
node_coursepages -.->|"loads courses"| node_api
node_modulepage -.->|"sends progress"| node_api
node_courseapi -->|"calls"| node_courseengine
node_courseapi -->|"reads modules"| node_catalogdb
node_courseengine -->|"records attempts"| node_progressdb
node_courseengine -->|"loads course state"| node_catalogdb
node_learner -->|"starts purchase"| node_checkout
node_checkout -.->|"requests checkout"| node_api
node_paymentapi -.->|"handles payments"| node_paymentlogic
node_paymentlogic -->|"creates payment"| node_mercadopago
node_paymentlogic -->|"updates payment"| node_paymentsdb
node_paymentlogic -->|"grants or revokes"| node_accesslogic
node_mercadopago -.->|"sends notifications"| node_webhooks
node_webhooks -.->|"applies payment"| node_paymentlogic
node_staff -->|"manages courses"| node_panel
node_panel -->|"uses API"| node_api
node_panelapi -->|"manages video"| node_bunny
node_webhooks -->|"handles encoding event"| node_bunny
node_modulepage -.->|"plays module video"| node_streamapi
node_streamapi -.->|"requests signed stream"| node_bunny
node_accountapi -->|"checks access"| node_accesslogic
node_scheduler -.->|"expires course access"| node_accesslogic
node_identity -.->|"creates account"| node_usersdb
node_accesslogic -->|"reads user state"| node_usersdb
node_paymentlogic -->|"persists status"| node_paymentsdb

click node_site "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/api/client.js"
click node_identity "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/auth.routes.js"
click node_coursepages "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Curso.jsx"
click node_modulepage "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Modulo.jsx"
click node_courseapi "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/course.routes.js"
click node_courseengine "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/course.service.js"
click node_progressdb "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Progreso.js"
click node_catalogdb "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Curso.js"
click node_checkout "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Pago.jsx"
click node_paymentapi "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/payments.routes.js"
click node_paymentlogic "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/payment.service.js"
click node_webhooks "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/webhooks.routes.js"
click node_bunny "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/bunny.service.js"
click node_streamapi "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/stream.routes.js"
click node_panel "https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/panel/VideoManager.jsx"
click node_panelapi "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/panel.routes.js"
click node_accesslogic "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/access.service.js"
click node_accountapi "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/account.routes.js"
click node_scheduler "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/jobs/scheduler.js"
click node_usersdb "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/User.js"
click node_paymentsdb "https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Pago.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_site,node_api toneBlue
class node_coursepages,node_modulepage,node_courseapi,node_courseengine,node_progressdb,node_catalogdb,node_checkout,node_paymentapi,node_streamapi toneAmber
class node_panel,node_panelapi toneMint
class node_identity,node_paymentlogic,node_mercadopago,node_webhooks,node_bunny,node_accesslogic,node_accountapi,node_scheduler,node_usersdb,node_paymentsdb toneRose
class node_learner,node_staff toneIndigo
```

## Components

### Web experience

- [Site and routes](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Learning workflow

- [Catalog and course pages](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Curso.jsx): `frontend/src/pages/Curso.jsx`
- [Module and evaluation](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Modulo.jsx): `frontend/src/pages/Modulo.jsx`
- [Course and progress API](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/course.routes.js): `backend/src/routes/course.routes.js`
- [Unlocking and grading](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/course.service.js): `backend/src/services/course.service.js`
- [Progress records](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Progreso.js): `backend/src/models/Progreso.js`
- [Courses and modules](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Curso.js): `backend/src/models/Curso.js`
- [Checkout page](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/Pago.jsx): `frontend/src/pages/Pago.jsx`
- [Payment routes](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/payments.routes.js): `backend/src/routes/payments.routes.js`
- [Video streaming](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/stream.routes.js): `backend/src/routes/stream.routes.js`

### Course operations

- [Staff panel](https://github.com/no7to/sacsevi-videos/blob/main/frontend/src/pages/panel/VideoManager.jsx): `frontend/src/pages/panel/VideoManager.jsx`
- [Panel management API](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/panel.routes.js): `backend/src/routes/panel.routes.js`

### Platform services

- [Account and sessions](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Payment and access](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/payment.service.js): `backend/src/services/payment.service.js`
- **Mercado Pago**
- [Payment and video webhooks](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/webhooks.routes.js): `backend/src/routes/webhooks.routes.js`
- [Bunny Stream](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/bunny.service.js): `backend/src/services/bunny.service.js`
- [Course access](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/services/access.service.js): `backend/src/services/access.service.js`
- [Account and privacy](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/routes/account.routes.js): `backend/src/routes/account.routes.js`
- [Expiry jobs](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/jobs/scheduler.js): `backend/src/jobs/scheduler.js`
- [Users and access](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Payment records](https://github.com/no7to/sacsevi-videos/blob/main/backend/src/models/Pago.js): `backend/src/models/Pago.js`

### Other components

- **Learner**
- **Instructor / admin**

## Connections

- Learner → Site and routes: uses
- Site and routes → API client: requests data (evidence: `frontend/src/App.jsx`)
- API client → Account and sessions: auth requests
- API client → Course and progress API: course requests
- Catalog and course pages → API client: loads courses
- Module and evaluation → API client: sends progress
- Course and progress API → Unlocking and grading: calls (evidence: `backend/src/routes/course.routes.js`)
- Course and progress API → Courses and modules: reads modules (evidence: `backend/src/routes/course.routes.js`)
- Unlocking and grading → Progress records: records attempts (evidence: `backend/src/services/course.service.js`)
- Unlocking and grading → Courses and modules: loads course state (evidence: `backend/src/services/course.service.js`)
- Learner → Checkout page: starts purchase
- Checkout page → API client: requests checkout
- Payment routes → Payment and access: handles payments
- Payment and access → Mercado Pago: creates payment (evidence: `backend/src/services/payment.service.js`)
- Payment and access → Payment records: updates payment (evidence: `backend/src/services/payment.service.js`)
- Payment and access → Course access: grants or revokes (evidence: `backend/src/services/payment.service.js`)
- Mercado Pago → Payment and video webhooks: sends notifications
- Payment and video webhooks → Payment and access: applies payment
- Instructor / admin → Staff panel: manages courses
- Staff panel → API client: uses API (evidence: `frontend/src/pages/panel/VideoManager.jsx`)
- Panel management API → Bunny Stream: manages video (evidence: `backend/src/routes/panel.routes.js`)
- Payment and video webhooks → Bunny Stream: handles encoding event (evidence: `backend/src/routes/webhooks.routes.js`)
- Module and evaluation → Video streaming: plays module video
- Video streaming → Bunny Stream: requests signed stream
- Account and privacy → Course access: checks access (evidence: `backend/src/routes/account.routes.js`)
- Expiry jobs → Course access: expires course access
- Account and sessions → Users and access: creates account
- Course access → Users and access: reads user state (evidence: `backend/src/services/access.service.js`)
- Payment and access → Payment records: persists status (evidence: `backend/src/services/payment.service.js`)
