How emersoncassis/teste-sonoma-sky works
Project Type & Purpose
• Full-stack web application for gym management.
• Frontend: React + TypeScript + Material-UI;
• Backend: Node.js + Express (REST API);
• Database: PostgreSQL;
• Integrations: WhatsApp API, Gympass API, Google Cloud TTS, Instagram Graph API, n8n workflows, Stripe payments.
High-Level Components
• Client (Browser)
• React app (login, dashboard, members, scheduling, reports)
• API Server
• Express app (routes → controllers → services → models)
• Auth (JWT) layer in middleware
• Database
• PostgreSQL (tables: Member, Agendamento, Checkin, Pagamento, Relatorio, etc.)
• External Services
• WhatsApp Business API (notifications)
• Gympass Partner API (eligibility validation)
• Google Cloud TTS (radio announcements)
• Instagram Graph API (posts + webhooks)
• n8n (workflow automation via webhook)
• Stripe (payment processing)
Interactions & Data Flow
• User → (HTTPS) → React Frontend → (REST) → Express API
• Express API
• Auth middleware (verify JWT)
• Routes dispatch to Controllers
• Controllers call Services
• Services invoke Models (ORM/SQL) → PostgreSQL
• Services call External APIs (via HTTP/SDK)
• Responses flow back: Database → Models → Services → Controllers → Frontend → User
• Background/Automation: n8n webhooks → triggers to Express → services
Architectural Patterns & Principles
• Layered (Controller → Service → Model)
• Modular services grouped by domain (members, agendamentos, checkins, pagamentos, relatorios, integrations)
• Single Node.js monolith, containerizable via Docker (docker-compose)
• Stateless API, JWT-based auth
• Database migrations (schema.sql + seed.sql)
• Automated testing (Jest)
• Routes layer → Controllers → Services → Models → DB
• Middleware chain (Auth)
• Integration calls branching from specific Services
• Clearly outlines all major components and their interactions
• Captures architectural patterns (layering, modularization)
• Identifies all external dependencies and integration points
• Aligns precisely with the project’s file structure and README specifications