How javiercodely/react-sistema-educativo works
Project type and purpose
• This is a single-page React application scaffolded with Vite.
• Purpose: a student dashboard for managing exam registrations, schedules, notifications, and academic roadmap; it consumes a set of RESTful APIs (alumno, preceptor, profesor, notificaciones) and uses Firebase for push notifications.
File structure
• Top-level:
• public, src, index.html, vite.config.js, package.json, README.md
• vercel.json (deployment on Vercel)
• src/ splits into:
• components (UI pieces organized by feature: alumno, notificaciones)
• pages (route targets: auth/Login, alumno/StudentDashboard, notificaciones)
• services/api (clients for each API domain: alumno, notificaciones, preceptor, profesor)
• services/auth (authentication flows)
• contexts (React Contexts for auth & notifications state)
• mocks (development stubs)
• utils, constants, types, styles
Key architectural insights from README & structure
• Frontend-only repo, no backend code here.
• Uses React + Vite for fast HMR & build.
• ESLint + optional TS support (currently using .tsx files).
• Deployed to Vercel.
Main components
a. Client Layer (browser)
• React SPA (App.jsx → routes → pages → components)
• React Contexts (AuthContext, NotificacionesContext)
b. API Layer within Client
• apiClient (axios/fetch wrapper)
• Domain services: alumnoService, notificacionesService, preceptorService, profesorService
• authServices (login, token refresh)
c. Backend Layer (external)
• Auth Service (JWT, OAuth)
• Alumno API
• Preceptor API
• Profesor API
• Notificaciones API
d. External Services
• Firebase (Realtime messaging, push)
e. Deployment & Build
• Vite Dev Server / Build Tool
• Vercel hosting
Relationships & interactions
• User actions in UI → React components → call domain services (HTTP) → backend APIs → return JSON → updates context & state → UI re-render.
• On login → authServices → Auth API → store JWT in context/localStorage → attach Authorization header on subsequent API calls.
• Notifications: services/notificaciones fetch initial list; Firebase SDK (services/firebase.js) listens for push events → NotificacionesContext → UI dropdown.
• Build: Vite compiles React code → Vercel hosts static assets.
Architectural patterns & principles
• Layered architecture: UI layer, service layer, API layer.
• Separation of concerns: components vs pages vs services vs contexts.
• Context API for cross-cutting concerns (authentication, notifications).
• Mock services for development.