How erikpeik/matcha works
Project Type and Purpose
• This is a full-stack, real-time web application (“Matcha” dating site) built with React/Redux on the frontend, Node.js/Express on the backend, PostgreSQL for persistence, and Socket.IO for live chat/notifications. Docker and Docker Compose orchestrate four services: client, server, database, and a seed/script helper.
File Structure Analysis
• Top-level:
• client/ – React single-page app (components, Redux store, services, static assets)
• server/ – Express app (index.js, Dockerfile, routes/, static image serving via Multer)
• db/ – SQL schema and seed scripts for PostgreSQL
• script/ – Standalone Dockerized script (create_users.js) for test-data or seeding
• docker-compose.yml – composes client, server, PostgreSQL, (and optionally script)
• Key patterns:
• Frontend: Redux for state, React Router for navigation, Axios + Socket.IO client for API and WebSocket
• Backend: Express routes per feature (auth, browsing, chat, profile, notifications), Socket.IO server, uses Multer for image uploads, Nodemailer for email
• Database: PostgreSQL functions (e.g., distance calculation), multiple tables initialized via SQL
README Insights
• Confirms real-time updates via Socket.IO, explains features (signup/verification, profile setup, browsing algorithm, chat rooms, notifications), lists tech stack.
• Browser/Client (React + Redux + Material UI)
• API Gateway/Backend Service (Node.js + Express + Socket.IO)
• Database (PostgreSQL)
• Seeding Script Service (script/create_users.js)
• External Services:
• SMTP Server (for email verification)
• Geolocation API (IPApi fallback)
1. Browser ↔ Express REST API (Axios): signup, login, profile, browsing, likes, notifications fetch
2. Browser ↔ Express WebSocket (Socket.IO): real-time chat rooms, notification channels
3. Express ↔ PostgreSQL: queries for users, profiles, tags, messages, notifications
4. Express → SMTP Service: send verification & fake-report emails
5. Express → IPApi: fetch coordinates if browser geolocation denied
6. Script Service → PostgreSQL or Express API: bulk-create or seed test users
7. Express → Static File Store: serve/upload user images via Multer
c. Architectural Patterns & Principles
• Micro-service/container architecture via Docker Compose
• Unidirectional data flow on frontend (React→Redux→React)
• REST for CRUD operations + WebSocket for events
• Separation of concerns: routing, business logic, data access
d. Key Technologies
• Frontend: React, Redux, React Router, Axios, Socket.IO client, Material UI
• Backend: Node.js, Express, Socket.IO server, Multer, Nodemailer
• Database: PostgreSQL
• Orchestration: Docker, Docker Compose