How nicoriver9/mercadopago-suscriptions-managment works
Project type and purpose
• This is a full-stack web application for managing subscriptions and donations via the MercadoPago platform.
• Frontend: React single-page application (SPA) built with Vite, Tailwind CSS, and React Router.
• Backend: Node.js + Express REST API using Sequelize for ORM and JWT-based authentication.
File structure
• Top-level folders:
• frontend/ – React code, public assets, config files, routes, components, auth and donate feature modules.
• backend/ – Express server, config, controllers, routes, models, helpers, middlewares, plus a public folder hosting the compiled React build.
• Patterns:
• Frontend is organized by feature (auth, donate, ui, router) using custom hooks, helpers, pages, and components.
• Backend follows MVC (models, controllers, routes), layered with config, helpers, middlewares, and a public static asset folder.
• Infrastructure files:
• frontend/vite.config.js, tailwind.config.js
• backend/package.json, vercel.json, example.env for environment variables
README for additional insights
• Core features: user login, admin management, subscription/donation processing.
• Tech stack: Node 14+, npm, React, Express, MercadoPago SDK, Sequelize, Jest suggested for testing.
• Deployment hints: dev servers on localhost:3000 (frontend) and default Express port for backend; .env setup.
a. Main components
• Client (Browser SPA)
• API Gateway / Express Server
• Authentication service (JWT issuance & verification)
• Subscription & Donation service (controllers, business logic)
• Database (PostgreSQL or MySQL via Sequelize)
• External service: MercadoPago REST API
• Static content host (serving React assets)
b. Relationships & interactions
• Browser ↔ Express REST endpoints (HTTP/HTTPS)
• Express ↔ Database (ORM queries)
• Express ↔ MercadoPago API (SDK calls for payments, subscriptions)
• Static asset requests served from backend public folder (or CDN)
c. Architectural patterns & design principles
• Layered MVC on backend:
• Models: Sequelize definitions
• Controllers: business logic & response formatting
• Routes: HTTP endpoint definitions
• Middlewares: JWT authentication, error handling
• Feature-based modularity on frontend (auth, donate, ui)
• Token-based stateless authentication (JWT)
d. Key technologies/frameworks
• Frontend: React, Vite, Tailwind CSS, React Router, custom hooks
• Backend: Node.js, Express, Sequelize, MercadoPago SDK, jsonwebtoken
• Deployment: Vercel config for serverless or container hosting, environment variables