How proyecto-de-calendario/principal works
Project type and purpose
• This is a monorepo for a “FreeHealth” task‐management and time‐tracking system. It combines:
• A static/SPA frontend (“Client” folder) built with HTML/CSS/JavaScript (Tailwind, PostCSS).
• A RESTful backend API (“server” folder) using Node.js, Express.js, MySQL, JWT, bcrypt, and express-validator.
• A browser extension/time-tracker (“tracker” folder) that gathers interaction timing (Chrome manifest, content script, popup) and posts data back to a server endpoint.
• The README confirms a task CRUD system, user authentication, and a MySQL database.
File structure
• Top level:
.gitignore, freehealth_database.sql (schema dump), eventotiempo.js (utilities).
Three subprojects: Client, server, tracker.
• Client:
– package.json, PostCSS & Tailwind configuration.
– /assets: standalone JS modules for calendar, charting, login/register flows.
– /pages: individual HTML pages (agenda, estadística, landing, límite tiempo).
– /src: modularized SPA logic (routing, CRUD tasks, auth, time save).
• server:
– app.js (Express app entry), applyValidations.js, authValidations.js.
– /controllers: business logic for auth, profiles, tasks.
– /routes: route definitions for auth, profiles, tasks.
– /helpers: JWT generation/validation.
– dataBase.js: MySQL connection via mysql2/promise.
– .env.development: environment variables (DB credentials, JWT secret).
• tracker:
– manifest.json, content.js (in-page script), popup.html/UI, timeTracker.js, and its own server.js (if it has a local backend or debugging server).
README for additional insights
• Describes system features (CRUD tasks, authentication, sessions, JWT).
• Details endpoints under “Rutas y Endpoints” (GET/POST/PUT/DELETE /tasks, etc.).
• Mentions express-validator for request validation and JWT for session management.
Essential details to capture
• Component names and responsibilities (e.g., tasks.Controller handles task CRUD).
• Data flows: user actions → client JS → HTTP → server controller → DB → JSON response → client render.
• Security layer: JWT generation (generarJWT) and validation (validarJWT, validateToken).
• Configuration: .env settings used by config/config.js → database credentials.