How kevin-garcia27/proyecto-intercambio_servicios_y_habilidades works
Purpose and topology
Semackro is a Spanish-language service-exchange platform with a static/vanilla-JS frontend and a Node.js backend. Core domains include user profiles, skills/services, exchange requests and work orders, messaging/video calls, reputation, verification, reporting, and administration.
Entry points
• Backend HTTP server: SemackroBackend/server.js
• Backend package/runtime definition: SemackroBackend/package.json
• Frontend main shell and browser bootstrap: SemackroFrontend/index.html, SemackroFrontend/app.js
• Frontend deployment configuration: SemackroFrontend/vercel.json
Browser application
The frontend is primarily multipage HTML with shared JavaScript rather than a single SPA. Authentication, API invocation, permissions, session handling, and translations are centralized in SemackroFrontend/js/apiHelper.js, SemackroFrontend/js/auth-guard.js, and SemackroFrontend/js/permisos.js. Major user surfaces include discovery, profile, login, exchange requests, reports, and video calling: SemackroFrontend/Descubrir.html, SemackroFrontend/Perfil_Usuario/perfil.html, SemackroFrontend/solicitud_intercambio.html.
API and domain routing
SemackroBackend/server.js composes route modules under SemackroBackend/routes/, forming the backend boundary between browser clients and persistence/services. Identity and access routes are separated from core account/profile APIs: SemackroBackend/routes/Login.js, SemackroBackend/routes/auth.js, SemackroBackend/routes/Personas.js. Profile capability data is handled through SemackroBackend/routes/PerfilCompleto.js and SemackroBackend/routes/HabilidadesYServicios_Persona.js.
Exchange lifecycle and engagement
The central transactional flow likely starts with a service/interchange request, advances into exchanges or work orders, and produces history, ratings, and metrics. Its principal route boundaries are SemackroBackend/routes/SolicitudesIntercambio.js, SemackroBackend/routes/intercambios.js, and SemackroBackend/routes/ordenesTrabajo.js; subsequent quality/reputation paths reside in SemackroBackend/routes/calificaciones.js and SemackroBackend/routes/MetricasDesempeno.js.
Realtime communication and media
Messaging, notifications, call signaling, and video calls are distinct backend capabilities: SemackroBackend/routes/Mensajeria.js, SemackroBackend/routes/call-signals.js, SemackroBackend/routes/videollamadas.js. Shared socket lifecycle is represented by SemackroBackend/socketInstance.js. Uploads and messaging images cross a storage boundary through SemackroBackend/routes/upload.js, SemackroBackend/routes/ImagenesMensajeria.js, and SemackroBackend/cloudflareR2.js; Cloudflare R2 is the evident external object-storage integration.
Security, governance, and operations
Authentication configuration and email integration live in SemackroBackend/config/passport.js and SemackroBackend/config/email.js, with Google auth exposed by SemackroBackend/routes/authGoogle.js. Authorization and audit controls wrap protected operations via SemackroBackend/middlewares/verificarPermiso.js and SemackroBackend/middlewares/auditLogger.js. Administrative governance includes user reports, verification, roles/permissions, and audit logs: SemackroBackend/routes/ReportesUsuarios.js, SemackroBackend/routes/verificacionUsuarios.js, SemackroBackend/routes/bitacora.js.
Persistence and schema evolution
The backend database connection boundary is SemackroBackend/db.js. SQL setup files establish key schema areas—users/companies, roles and permissions, system configuration, pets, and audit records—under SemackroBackend/BaseDatos/, notably setup_final.sql, setup_roles_permisos_motivos.sql, and setup_bitacora.sql. Numerous root-level backend scripts implement direct schema repair, migration, seeding, and operational inspection, indicating database evolution is script-driven rather than managed by a single migration framework.
Main entry points: server.js HTTP server and route composition · db.js Database connection · ordenesTrabajo.js Exchanges and work orders · Login.js Identity and accounts
Components 19
Browser application
- Multipage browser shell · Shared bootstrap for HTML user surfaces.
SemackroFrontend/index.html - Session and API client · Centralizes API calls, auth, permissions, and translations.
SemackroFrontend/js/apiHelper.js - Discovery, profile and requests
SemackroFrontend/solicitud_intercambio.html
Node.js API
- HTTP server and route composition · Backend boundary composing route modules.
SemackroBackend/server.js - Identity and accounts · Login, authentication, and person account APIs.
SemackroBackend/routes/Login.js - Profiles, skills and services
SemackroBackend/routes/PerfilCompleto.js - Exchange requests · Starts the service exchange lifecycle.
SemackroBackend/routes/SolicitudesIntercambio.js - Exchanges and work orders · Advances accepted requests into tracked work.
SemackroBackend/routes/ordenesTrabajo.js - Ratings and performance · Records quality outcomes and metrics.
SemackroBackend/routes/calificaciones.js
Realtime and media
- Messaging and notifications
SemackroBackend/routes/Mensajeria.js - Call signaling and video
SemackroBackend/routes/call-signals.js - Shared socket lifecycle
SemackroBackend/socketInstance.js - Uploads and message images
SemackroBackend/routes/upload.js - Cloudflare R2 · External storage for uploaded media.
SemackroBackend/cloudflareR2.js
Security and governance
- Authorization and audit middleware · Guards protected operations and records audit activity.
SemackroBackend/middlewares/verificarPermiso.js - Reports, verification and audit
SemackroBackend/routes/ReportesUsuarios.js - Google auth and email
SemackroBackend/config/passport.js
Data and operations
- Database connection
SemackroBackend/db.js - SQL schema and repair scripts · Schema setup, repair, seeding, and operational scripts.
SemackroBackend/BaseDatos/setup_final.sql
Connections 25
- Multipage browser shell → Session and API client: loads shared client
- Discovery, profile and requests → Session and API client: uses
- Session and API client → HTTP server and route composition: HTTP API calls
- HTTP server and route composition → Identity and accounts: routes
- HTTP server and route composition → Profiles, skills and services: routes
- HTTP server and route composition → Exchange requests: routes
- HTTP server and route composition → Exchanges and work orders: routes
- HTTP server and route composition → Ratings and performance: routes
- HTTP server and route composition → Messaging and notifications: routes
- HTTP server and route composition → Call signaling and video: routes
- HTTP server and route composition → Uploads and message images: routes
- HTTP server and route composition → Reports, verification and audit: routes
- Authorization and audit middleware → HTTP server and route composition: protects operations
- Identity and accounts → Google auth and email: auth and email
- Exchange requests → Exchanges and work orders: accepted request
- Exchanges and work orders → Ratings and performance: completed work outcome
- Messaging and notifications → Shared socket lifecycle: realtime delivery
- Call signaling and video → Shared socket lifecycle: signaling
- Uploads and message images → Cloudflare R2: stores media
- Identity and accounts → Database connection: persists
- Profiles, skills and services → Database connection: persists
- Exchanges and work orders → Database connection: persists
- Ratings and performance → Database connection: persists
- Reports, verification and audit → Database connection: persists
- SQL schema and repair scripts → Database connection: creates and repairs schema