How salvatierraj/gestura-front works
Project type and purpose
• This is a single-page front-end application built with React and Vite.
• It serves as an administrative and student portal (“Administrador” vs “Estudiantes”).
• It consumes external REST APIs for data (auth, casos, docentes, etc.).
File structure
• Top-level:
• index.html / main.jsx – application entry point
• src/layout – shared layout components (header, sidebar, login, mainLayout)
• src/features – feature modules split by user role (Administrador, Estudiantes), each with pages and nested components
• src/components – shared UI elements (menuItems, searchInput)
• src/services – HTTP client wrappers and domain-specific services
• src/store – global state management (authStore, casos.store, docentes.store, plus route guards)
• Vite config, ESLint, package.json, public assets.
README for additional insights
• Uses Vite with React plugin (Babel or SWC) for fast refresh.
• No built-in backend, so service calls go to an external API endpoint (configured in src/services/api.js).
Main components and their relationships
a. Presentation layer
• index.html → loads main.jsx → renders <App />
• <App /> wraps <Router> with route definitions and guards (public vs protected).
• Layout components (header, menuLateral) wrap feature pages.
• Feature pages (e.g., controlDeAcceso.jsx, MisDefensas.jsx) compose UI by invoking shared and feature-specific components.
b. State management
• src/store provides global stores for authentication, casos, docentes.
• Components dispatch actions to stores and subscribe to store state.
c. Service layer
• src/services/api.js configures Axios (base URL, interceptors).
• services/auth.js, casos.services.js, docentes.services.js call API endpoints.
• Stores invoke services to fetch/update data.
d. External dependencies
• REST API server (authentication, data persistence).
• pdf.worker.mjs – PDF generation/preview.
Architectural patterns and design principles
• Feature-based folder structure: each domain (Administrador, Estudiantes) encapsulates its pages and components.
• Unidirectional data flow: Services → Stores → Components.
• Separation of concerns:
• Presentation (components, pages, layout)
• Business logic (stores)
• Data access (services).
• Route guards enforce authentication logic.
• Step-by-step:
• Entry point (index.html → main.jsx → <App />).
• Router + Route Guards (publicRoute, authGuardRoute).
• Layout & UI components (header, menuLateral, pages).
• Feature modules (Administrador, Estudiantes) annotated as grouped sub-systems.
3. Assets:
• Public folder assets (site.webmanifest, pdf.worker.mjs) as static resources served by Vite/dev server.
4. Developer toolchain (optional):
• Build pipeline → dist folder.