How kevinjaimesguaman/prueba1 works
Project type and purpose
• Full-stack web application for managing university olympiads (“Olimpiadas ¡oh sansi!”).
• Frontend: React.js SPA (Vite-powered), handles user roles (admin, gestor, tutor, competidor) and UI flows.
• Backend: Laravel 8 REST API, implements business logic, data persistence, authentication/authorization, notifications.
File structure
• Top level: two siblings, backend/ and frontend/.
• backend/: standard Laravel MVC (app/Models, app/Http/Controllers, resources/views, routes/, config/, database/migrations & seeders). Uses Sanctum for auth, queues/events for notifications.
• frontend/: React project (src/components, src/page, src/routes, assets, context/hooks). Uses React Router for client-side routing, CSS modules, JSON configs (notificacion.json, tutores.json).
Main components
a. Frontend SPA
• React Router layer (AppRouter, AppRouteLogin, AppRouteTutor, etc.)
• Page containers (HomeAdmin, HomeRespGest, TutorHome, Login)
• Reusable UI components (tables, modals, cards, search bar)
• State/context/hooks layer (authentication context, data hooks)
b. API Server (Laravel)
• HTTP entrypoint (public/index.php, server.php)
• Routing layer (routes/api.php)
• Controllers (app/Http/Controllers/Api/*Controller.php)
• Resources/Transformers (app/Http/Resources/*Resource.php)
• Models/Eloquent (app/Models/*.php)
• Middleware (auth, CORS, CSRF, etc.)
• Service providers (bootstrapping, events)
• Jobs/Events/Notifications (if applicable)
c. Data Layer
• MySQL database (tables for Area, Boleta, Competidor, Tutor, Competencia, Notificacion, etc.)
• Migrations & seeders (database/migrations, database/seeders)
d. External Services
• Mailer (SMTP or mail‐service)
• (Optional) Caching or queue backends (Redis, if configured)
• Storage (local filesystem under storage/, could be S3 in prod)
Relationships and data flow
• User’s browser ←→ React SPA (HTTP/HTTPS)
• React SPA → Laravel API endpoints (RESTful JSON calls via fetch or Axios)
• Laravel Controllers → Models (Eloquent ORM) → MySQL
• Laravel → Notification/Mailer (email or in-app notifications)
• Authentication: React obtains JWT/token from Laravel Sanctum, stores in context, attaches to API calls.
Architectural patterns and design principles
• Backend: MVC with clear separation of routing, controllers (business logic), models (data), and resources (presentation).
• Frontend: Component-based UI with container/page components for each role, global context for auth/state, React Router for navigation.
• RESTful API contract decouples frontend and backend.
• Use of migrations/seeders enforces schema versioning and reproducible test data.
• Dependency injection and service providers in Laravel for extensibility.