How berchnard10/usi_nexus works
1. What this repository is
- This repo is the frontend client for UTHH_PRY, built as a React + Vite application.
- The README describes a broader 3-tier system with PHP backend + MySQL, but those server-side pieces are not present here. In this repo, the app consumes backend/API services through client-side request helpers.
2. Application entry and shell
- The runtime starts in src/main.jsx and mounts src/App.jsx.
- App.jsx is the top-level composition point for routes, global providers, and app-wide UI behavior.
- Global styling is split across src/index.css, src/App.css, Tailwind config, and PostCSS config.
3. Navigation and layout layer
- Shared UI chrome lives in src/assets/components/:
- Layout.jsx, NavigationBar.jsx, SideNavBar.jsx, FooterSection.jsx, Breadcrumb.jsx
- These components form the persistent frame around the page content, especially for the authenticated areas.
- src/assets/components/Clases/Iterador.jsx and Components.jsx suggest small reusable UI helpers.
4. Route-level feature areas
- The app is organized primarily by role and domain:
- src/assets/pages/PaginasAlumnos/ for student flows
- src/assets/pages/PaginasDocentes/ for teacher flows
- standalone auth and utility pages like LoginPage.jsx, RegisterPage.jsx, ResetPassword.jsx, ProfileUser.jsx, HomePage.jsx, Error404.jsx
- This suggests route grouping rather than a single monolithic page tree.
5. Core domain model visible in the UI
- The main business capabilities are classroom-management oriented:
- subjects/materias
- students/alumnos
- activities/tasks
- practices/detailed assignments
- grades and grade summaries
- career/department/group/period administration
- Teacher-side pages are richer and appear to own most CRUD and grading workflows; student-side pages are mostly read/participation views.
6. Data access and backend boundary
- Client-server interaction is centralized under src/assets/server/:
- serverRequests.jsx likely wraps API calls
- authUser.jsx handles identity/session/user lookup
- ProtectedRoute.jsx enforces authenticated or role-based navigation
- src/CrudTable.jsx indicates shared table-based CRUD UI used across admin/teacher screens.
- The backend is an external dependency from the frontend’s perspective; the UI assumes authenticated API responses and role-based access.
7. Authentication and authorization
- Auth is a distinct subsystem, not embedded in individual pages.
- Login/register/reset-password screens are separate from protected app content.
- ProtectedRoute.jsx is the key boundary between public auth pages and the internal application shell.
- authUser.jsx likely hydrates the current user state used for routing and permissions.
8. Notifications subsystem
- Notification support is a dedicated feature area:
- src/NotificationHandler.jsx
- src/assets/pages/notificaciones/firebase.jsx
- src/assets/pages/Notificaciones.jsx
- The presence of public/firebase-messaging-sw.js strongly indicates Firebase Cloud Messaging for push notifications.
- Notifications are handled across both app code and service-worker code, meaning some updates can arrive even when the page is not active.
9. PWA and offline layer
- This repo is explicitly set up as a PWA:
- public/manifest.webmanifest
- public/sw.js
- src/serviceWorker.js
- src/PWA.jsx
- This layer handles installability and offline behavior, and likely caches assets and selected app content.
- The service worker boundary is important because it sits outside React and mediates network/offline behavior.
10. Static assets and downloadable templates
- public/ contains several Excel templates:
- Formato-FDA05.xlsx
- Formato-Lista-Alumnos.xlsx
- Formato-de-Rubricas.xlsx
- These are likely downloadable resources tied to academic workflows and import/export conventions.
- puta.sql is a repository-level SQL artifact, probably for schema/reference or local setup, but not part of the runtime frontend.
11. Testing and quality gates
- Unit/integration testing is present via Jest:
- jest.config.js, jest.setup.js, src/setupTests.js
- tests such as LoginPage.test.js and MateriasAlumno.test.js
- End-to-end testing uses Cypress:
- cypress/e2e/login.spec.js, materias.spec.js
- coverage/ artifacts show the app is instrumented for coverage reporting.
12. Build, deployment, and environment
- The project uses Vite for dev/build and Babel configuration for React transforms.
- Deployment/config files indicate multiple targets or environments:
- netlify.toml, vercel.json, GitHub Actions workflows, env-cmdrc.json
- This suggests CI/CD-driven frontend deployment, with environment-specific configuration outside the app code.
13. Legacy/alternate code paths
- The src/assets/pages/papelera/ tree looks like a “trash” or legacy area containing older/experimental versions of pages.
- For architecture diagrams, treat this as non-primary/legacy UI code unless proven otherwise; the active structure is the non-papelera pages plus shared components/server helpers.
14. How the pieces fit together
- User enters through the React shell, authenticates on public pages, then transitions into protected role-based routes.
- Protected pages render shared layout components, fetch data through the server helper layer, and display domain-specific management screens.
- Notifications and PWA features operate horizontally across the app through service workers and Firebase messaging, not as isolated pages.
Main entry points: App.jsx App · Teachers.jsx Teachers · Layout.jsx Layout · NotificationHandler.jsx Notif handler
Components 34
App shell
React entry, top-level composition, and routing boundary.
- main · Bootstraps the Vite app and mounts the React tree.
src/main.jsx - App · Top-level application composition and route wiring.
src/App.jsx - Global CSS · App-wide styling layer.
src/index.css - App CSS · Component- and shell-level styles.
src/App.css - Home · Public or post-login landing page.
src/assets/pages/HomePage.jsx
Shared UI
Reusable layout and chrome used across protected pages.
- Layout · Persistent authenticated page shell.
src/assets/components/Layout.jsx - Nav bar · Primary top navigation.
src/assets/components/NavigationBar.jsx - Side nav · Secondary navigation for internal areas.
src/assets/components/SideNavBar.jsx - Footer · Shared footer section.
src/assets/components/FooterSection.jsx - Breadcrumb · Contextual page location display.
src/assets/components/Breadcrumb.jsx - Iterador · Reusable rendering/helper component.
src/assets/components/Clases/Iterador.jsx - Components · Shared component bundle for common UI pieces.
src/assets/components/Components.jsx
Auth boundary
Public authentication screens and route protection.
- Protected route · Enforces authenticated or role-based access.
src/assets/server/ProtectedRoute.jsx - Auth user · Loads current user identity and auth state.
src/assets/server/authUser.jsx - Login · Authentication entry screen.
src/assets/pages/LoginPage.jsx - Register · Account creation screen.
src/assets/pages/RegisterPage.jsx - Reset password · Password recovery flow.
src/assets/pages/ResetPassword.jsx - Profile · User profile and account view.
src/assets/pages/ProfileUser.jsx
Student flows
Role-specific student pages.
- Students · Student-facing classroom and course flows.
src/assets/pages/PaginasAlumnos/MateriasAlumno.jsx - Student activities · Student activity listing and participation screens.
src/assets/pages/PaginasAlumnos/ActividadesAlumno.jsx - Student detail · Student activity and practice detail screens.
src/assets/pages/PaginasAlumnos/DetalleActividadAlumno.jsx
Teacher flows
Role-specific teacher pages and management screens.
- Teachers · Teacher-facing classroom management hub.
src/assets/pages/PaginasDocentes/Teachers.jsx - Teacher subjects · Teacher course and subject management.
src/assets/pages/PaginasDocentes/MateriasDocente.jsx - Students admin · Student roster and admin workflows.
src/assets/pages/PaginasDocentes/Alumnos.jsx - Grading · Grades, activities, and practice detail workflows.
src/assets/pages/PaginasDocentes/DetallePracticaDocente.jsx - Admin data · Career, department, group, and period administration.
src/assets/pages/PaginasDocentes/Carreras.jsx
Cross-cutting
Notifications, PWA, and service-worker infrastructure.
- Notif handler · App-level notification coordination.
src/NotificationHandler.jsx - Notifications · Notifications screen and inbox view.
src/assets/pages/Notificaciones.jsx - Firebase messaging · Firebase messaging initialization for notifications.
src/assets/pages/notificaciones/firebase.jsx - PWA · Installability and offline behavior integration.
src/PWA.jsx - Service worker · Registers and coordinates service worker behavior.
src/serviceWorker.js - SW asset · Public service worker script.
public/sw.js
Data access
Client-side API helpers and request/session coordination.
- CRUD table · Reusable table-based CRUD surface.
src/CrudTable.jsx - API requests · Central request helper layer for backend calls.
src/assets/server/serverRequests.jsx
Connections 35
- main → App: mounts · Entry point mounts the app shell.
- App → Protected route: guards routes · App routes are split through protected navigation.
- App → Login: public auth · Exposes login flow.
- App → Register: public auth · Exposes registration flow.
- App → Reset password: public auth · Exposes password reset flow.
- App → Home: landing · Routes into the home page.
- App → Profile: account · Routes into the user profile page.
- App → Layout: shell · Protected areas render inside the shared layout.
- Layout → Nav bar: contains · Layout includes the top navigation.
- Layout → Side nav: contains · Layout includes side navigation.
- Layout → Footer: contains · Layout includes the shared footer.
- Layout → Breadcrumb: contains · Layout includes breadcrumb navigation.
- Layout → Components: uses · Layout and pages share common UI helpers.
- Components → Iterador: includes · Shared helper component.
- Protected route → Auth user: hydrates · Guard relies on current user/session state.
- Protected route → API requests: depends on · Auth checks and data fetches rely on request helpers.
- Students → Student activities: navigates to · Student module leads into activity views.
- Students → Student detail: navigates to · Student module leads into detail screens.
- Students → API requests: fetches · Student pages consume backend data.
- Teachers → Teacher subjects: navigates to · Teacher hub leads to subject management.
- Teachers → Students admin: navigates to · Teacher hub leads to roster management.
- Teachers → Grading: navigates to · Teacher hub leads to grading workflows.
- Teachers → Admin data: navigates to · Teacher hub leads to admin workflows.
- Teachers → CRUD table: uses · Teacher/admin screens reuse the CRUD table.
- Teachers → API requests: fetches · Teacher pages consume backend data.
- Notif handler → Notifications: shows · Notification subsystem exposes a page view.
- Notif handler → Firebase messaging: uses · Notification handling is backed by Firebase messaging.
- Notif handler → SW asset: delivers via · Push notifications can arrive through the worker.
- PWA → Service worker: registers · PWA layer registers the service worker.
- Service worker → SW asset: loads · Service worker runtime is backed by the public worker script.
- PWA → SW asset: uses · Offline behavior depends on the worker asset.
- App → Notif handler: integrates · Notification handling is wired into the app shell.
- App → PWA: integrates · App shell includes PWA behavior.
- App → Global CSS: styles · App shell is styled by global CSS.
- App → App CSS: styles · App shell is styled by app-specific CSS.