How hose-ro/sicat works
1. Repository shape
- This is a two-tier monorepo for SICAT: a React/Vite frontend and a NestJS backend.
- The backend owns business rules and persistence; the frontend is a role-based client that consumes the API.
2. Backend application boundary
- The backend is organized as NestJS feature modules under src/, each exposing its own controller/service pair.
- AppModule is the composition root, and PrismaService is the shared persistence boundary to PostgreSQL via Prisma.
3. Core domain modules
- The main business areas are split into modules for usuarios, carreras, materias, grupos, academias, aulas, horarios, retícula, clases, asistencias, tareas, inscripciones, solicitudes, notificaciones, and reportes.
- This suggests a school-management workflow centered on academic structure, scheduling, attendance tracking, assignments, and notifications.
4. Identity and access control
- Authentication is handled in auth/ with JWT strategy/guard support and a roles guard/decorator for authorization.
- This likely gates admin/docente/alumno capabilities across the API and maps to the role-specific frontend pages.
5. Scheduling and academic structure
- reticula, grupos, materias, academias, horarios, and aulas form the planning layer.
- horarios includes conflict-validation utilities and assignment DTOs for docente/aula, indicating the backend enforces schedule consistency rather than leaving it to the client.
6. Teaching workflow
- clases appears to model live class sessions, with utilities and an iniciar-clase DTO.
- asistencias depends on class/schedule context to register, update, and “pass list,” tying attendance to a specific session rather than a generic record.
7. Assignments and submissions
- tareas is a substantial module with create, deliver, review, grade, and bulk-review DTOs.
- The presence of tareas.storage.ts and tareas.archive.ts indicates some separation between assignment metadata and file/archive handling, so the backend likely manages both database records and stored submission artifacts.
8. Student enrollment and requests
- inscripciones and solicitudes cover student-facing enrollment/request flows.
- These modules likely mediate approval-based actions rather than direct writes, which fits the role-based architecture and workflow approvals.
9. Persistence model
- Prisma migrations show the schema evolved over time to add Google identity linkage, aula, academia, attendance/task/notification expansion, and schedule-attendance relationships.
- Seed scripts for materias and retículas indicate the system starts with predefined academic catalog data, not just user-generated records.
10. Frontend application boundary
- The frontend is a Vite React app with Tailwind-based UI components and a shared layout system.
- It uses an API client (src/api/axios.js) plus feature stores under src/store/, suggesting client state is organized by domain rather than one global monolith.
11. Role-specific UI flows
- The UI is split into admin, docente, and alumno page groups, which mirrors the backend authorization model.
- Admin views manage academias, grupos, horarios; docentes handle passing attendance, requests, and tasks; alumnos view inscriptions, task details, and attendance.
12. Notifications and user experience
- Notifications exist as both a backend module and frontend components/store, with a dedicated history page and bell UI.
- The frontend also includes PWA support: service worker, manifest, install prompt, and icon-generation scripts, so the client is intended to behave like an installable app.
13. Shared frontend building blocks
- Common UI primitives live under components/ui, while app-wide elements such as BaseLayout, PageHeader, and NotificacionesBell provide consistent navigation and chrome.
- This makes the frontend architecture a page + component + store composition rather than a heavily framework-driven state machine.
14. Operational and deployment signals
- The repo includes render.yaml for backend deployment and wrangler.jsonc for the frontend, implying separate deployment targets for each tier.
- Database setup is external PostgreSQL, and Prisma migrations/seeders are the main infrastructure-management mechanism inside the codebase.
Main entry points: app.module.ts AppModule · App.jsx React App · store Stores · prisma.service.ts PrismaService
Components 22
Backend
NestJS API, domain modules, and persistence.
- AppModule · Bootstraps the API and wires feature modules together.
backend/src/app.module.ts - Auth · Login, registration, JWT strategy/guard, and role-based authorization.
backend/src/auth - PrismaService · Shared Prisma boundary to PostgreSQL and database access across modules.
backend/src/prisma.service.ts - Usuarios · User management and account data.
backend/src/usuarios - Academic core · Carreras, materias, academias, retícula, grupos, unidades, and aulas as the academic structure layer.
backend/src - Scheduling · Horarios with conflict validation plus docente/aula assignment.
backend/src/horarios - Clases · Live class sessions and start-class workflow.
backend/src/clases - Asistencias · Attendance registration, updates, and passing the list for a class session.
backend/src/asistencias - Tareas · Assignment creation, delivery, review, grading, and artifact storage/archive handling.
backend/src/tareas - Inscripciones · Student enrollment requests and approval-oriented submission flow.
backend/src/inscripciones - Solicitudes · Generic request handling used by role-based approval flows.
backend/src/solicitudes - Notificaciones · Notification creation, delivery, and history support.
backend/src/notificaciones - Reportes · Reporting endpoints and summary views over academic data.
backend/src/reportes
Frontend
React/Vite client, role-based pages, and shared UI.
- React App · Main frontend composition with routing, layout, and UI shell.
frontend/src/App.jsx - API client · Shared HTTP client used by feature stores and pages.
frontend/src/api/axios.js - App shell · BaseLayout, PageHeader, navigation, branding, and shared UI primitives.
frontend/src/components/layout/BaseLayout.jsx - Stores · Domain-oriented stores for auth, grupos, horarios, tareas, inscripciones, asistencia, clase, and notificaciones.
frontend/src/store - Admin pages · Academias, grupos, and horarios management screens.
frontend/src/pages/admin - Docente pages · Passing attendance, handling solicitudes, and managing tareas.
frontend/src/pages/docente - Alumno pages · Enrollment, task detail, and attendance views for students.
frontend/src/pages/alumno - Notifications UI · Frontend notification bell, history page, and notification helpers.
frontend/src/components/shared/NotificacionesBell.jsx - PWA support · Service worker, manifest, install prompt, and icon generation scripts.
frontend/public/manifest.webmanifest
Connections 34
- AppModule → Auth: imports · Composition root includes authentication.
- AppModule → Usuarios: imports · User module participates in the API.
- AppModule → Academic core: imports · Core academic modules are wired into the app.
- AppModule → Scheduling: imports · Scheduling is part of the main API surface.
- AppModule → Clases: imports · Class-session module is registered.
- AppModule → Asistencias: imports · Attendance module is registered.
- AppModule → Tareas: imports · Assignments module is registered.
- AppModule → Inscripciones: imports · Enrollment flows are registered.
- AppModule → Solicitudes: imports · Request workflows are registered.
- AppModule → Notificaciones: imports · Notification module is registered.
- AppModule → Reportes: imports · Reporting module is registered.
- Auth → Usuarios: authenticates · Login and registration act on user accounts.
- Usuarios → PrismaService: persists via · Users are stored through Prisma.
- Academic core → PrismaService: persists via · Academic structure modules share the database gateway.
- Scheduling → PrismaService: persists via · Schedules and assignments are persisted through Prisma.
- Scheduling → Academic core: depends on · Schedules are built from groups, materias, and aulas.
- Clases → Scheduling: depends on · Class sessions are tied to scheduled context.
- Asistencias → Clases: depends on · Attendance is recorded per class session.
- Tareas → PrismaService: persists via · Assignments and submissions are stored through Prisma.
- Inscripciones → Academic core: depends on · Enrollment requests reference academic structure.
- Notificaciones → PrismaService: persists via · Notifications are stored and queried from the database.
- React App → App shell: uses · App is wrapped by shared layout and UI chrome.
- React App → API client: calls · Pages and stores use the shared HTTP client.
- React App → Stores: coordinates · Feature screens are backed by domain stores.
- React App → Admin pages: routes to · Admin role pages are part of the app.
- React App → Docente pages: routes to · Docente role pages are part of the app.
- React App → Alumno pages: routes to · Alumno role pages are part of the app.
- React App → Notifications UI: uses · Notifications are surfaced in the shell and pages.
- React App → PWA support: supports · Client includes installable app behavior.
- Stores → API client: fetches via · Stores orchestrate API requests.
- Admin pages → Stores: reads/writes · Admin screens work through shared domain stores.
- Docente pages → Stores: reads/writes · Teacher screens work through shared domain stores.
- Alumno pages → Stores: reads/writes · Student screens work through shared domain stores.
- Notifications UI → Stores: reads · Notification UI reflects notification store state.