How ssafy-homeggu/homeggu works
Project Type and Purpose
• This is a full-stack, microservices-based web application (“HOMEGGU”) for second-hand furniture trading.
• Frontend: Next.js (React) + Tailwind CSS, CSR/SSR for SEO.
• Backend: MSA using Spring Boot microservices (user, goods, pay, chat, gateway, discovery, config) plus a Python FastAPI “recommendation” service.
• Infra: Docker on AWS EC2, NGINX LB, Jenkins CI/CD, AWS S3, Redis, RabbitMQ, multiple databases (MySQL, MongoDB).
File Structure Highlights
• frontend/ → Next.js app, API layers, 3D assets under public/3d, state stores and hooks under src/.
• backend/
• homeggu-config → Spring Cloud Config Server
• homeggu-discovery → Eureka Discovery Server
• homeggu-gateway → Spring Cloud Gateway, JWT, Redis caching
• homeggu-user, homeggu-goods, homeggu-pay, homeggu-chat → domain services (each with REST controllers, JPA repos, service layers)
• homeggu-recommendation → FastAPI Python service for ML-based recommendations
• exec/ → deployment docs & exec assets
Key Architectural Patterns & Tech
• MSA with centralized Config & Discovery, API Gateway routing + security (JWT).
• Each service has its own MySQL schema; recommendation uses MongoDB; Redis for caching and session; RabbitMQ for chat pub/sub and 3D conversion jobs.
• S3 for static & 3D model storage; FeignClient for sync inter-service calls; asynchronous jobs via RabbitMQ.
• CI/CD with Jenkins, containerized via Docker, fronted by NGINX on EC2.
Main Components
• Clients (Browser, Mobile)
• Next.js Frontend
• NGINX Load Balancer
• Spring Cloud Gateway
• Service Registry (Eureka Discovery)
• Config Server
• Microservices:
• User Service
• Goods Service
• Pay Service
• Chat Service (with STOMP/WebSocket)
• Recommendation Service (FastAPI)
• Datastores: MySQL (per microservice), MongoDB (recommendations), Redis (cache/session)
• Message Broker: RabbitMQ
• External Storage: AWS S3
• Infra & CI/CD: Docker, Jenkins, AWS EC2
Interactions & Data Flows
• Synchronous HTTP:
Browser → NGINX → Gateway → target microservice → its DB.
Microservice A → FeignClient → Microservice B via Gateway/Discovery.
• Asynchronous:
Goods Service → RabbitMQ → Chat/Conversion Worker → S3/MongoDB.
Frontend subscribes to Chat WS feed via Gateway → Chat Service → RabbitMQ.
• Caching:
Gateway/User Service ↔ Redis for JWT blacklisting & session data.