How sandooo24/gestor-tareas-react works
Project Type and Purpose
• This is a full-stack task-management web application.
• Frontend: React (Vite) single-page app for creating, editing, listing tasks.
• Backend/API: Node.js + Express exposing REST endpoints secured by an API key middleware.
• Database: MySQL storing tasks schema defined in tareas.sql.
Key Components from File Structure
• Frontend (root + src + public):
• index.html, vite.config.js → Vite dev server config
• src/main.jsx → React app entry
• src/components/… → UI modules: Header, Formulario (create), FormEdit (update), CardTarea (display), Inicio (list), RequestApi (API service)
• src/css/index.css, src/assets → styling & static assets
• Backend/API (api/):
• api/index.js → Express app defining routes (GET, POST, PUT, DELETE /tasks)
• api/middleware/checkApiKey.js → API key validation layer
• api/.env → DB credentials (dotenv)
• Database:
• tareas.sql → schema + seed data for tasks table
Relationships & Data Flow
• Browser → (HTTP) → Vite Dev Server → serves React assets
• React components → (fetch/Axios) → Express API endpoints
• Express routes → (mysql2) → MySQL DB → return query results
• Middleware.checkApiKey sits on each API route to authorize requests
Architectural Patterns & Principles
• Layered Client-Server Architecture
• Presentation Layer (React SPA)
• Application Layer (Express REST API)
• Data Layer (MySQL)
• Separation of Concerns: UI components vs API logic vs DB access
• Middleware pattern in Express for cross-cutting concerns (security)
• Environment-based configuration (dotenv)
Detailed Elements to Capture
• React component modules & their roles (CardTarea, Formulario, etc.)
• Vite build/dev process
• Express route handlers and middleware chain
• MySQL connection pool/config via dotenv
• Data flow from user action → UI event → API call → DB transaction → UI update