How dcatanzaro/cafecito works
Project type and purpose
• This is a full-stack donation platform (“Cafecito”) built with Next.js (React SSR/SSG) on the frontend, an Express.js server for API and business logic, and MongoDB as the persistence layer. It also integrates with MercadoPago for payments, uses a Telegram Bot for notifications, and leverages Socket.io for real-time updates.
File structure
• Top-level config and scripts:
• Dockerfile, docker-compose.yml → containerization
• nodemon.json, package.json, next.config.js
• Frontend (Next.js):
• pages/ → routing and SSR components
• components/ → reusable UI pieces (QR, coffee list, modal, header, inputText, etc.)
• public/ → static assets (fonts, images)
• styles/ → global and SCSS variable definitions
• Backend (Express + services):
• server.js, routes.js → express app initialization and HTTP routes
• server/config/share.html → static view
• server/controllers/ → controllers per domain (CoffeeController, MercadoPagoController)
• server/services/ → service layer including CoffeeService, MercadoPagoService, SocketService
• server/models/coffee.js → Mongoose model
• Environment and deployment:
• .env.development / .env → environment variables (MongoDB connection, Telegram IDs, MercadoPago key, admin password)
• docker-compose.yml → defines services (app + MongoDB)
README for additional insights
• Describes prerequisites (NodeJS, MongoDB), environment variables, development vs. production commands, and how to enable admin mode via query parameters.
• Mentions Docker deployment.