How lukas-rodrigo/monify works
Project Type and Purpose
• This is a Spring-based microservices system (“Monify”) for managing users and financial data, plus an AI-powered chatbot exposed via WhatsApp.
• It uses Spring Cloud Netflix components (Eureka server for service discovery, a Spring Cloud Gateway), an API gateway, multiple independent Spring Boot microservices, and Docker Compose for local orchestration.
File-Structure Analysis
• Root: contains docker-compose.yml to orchestrate all services and a README placeholder.
• monify-eureka-server: Service Discovery (Eureka) implementation.
• ms-monify-gateway: Spring Cloud Gateway acting as the single external entry point.
• ms-users: User management microservice (REST controllers, JPA repository).
• ms-finance-monify: Finance management microservice (categories, expenses).
• ms-chatbot-openAi: Chatbot service integrating with OpenAI (uses Feign to call finance & user services, persists conversations).
• ms-whatsapp: Exposes a webhook for WhatsApp messages, forwards them to ms-chatbot-openAi.
• Each service has its own Spring application.yml (profiles for dev/prod) and Dockerfile.
Architectural Patterns & Key Components
a. Service Discovery Layer
• monify-eureka-server registers all services and allows dynamic lookup.
b. API Gateway
• ms-monify-gateway routes incoming HTTP/HTTPS traffic to downstream services based on path.
c. Microservices
• ms-users, ms-finance-monify, ms-chatbot-openAi, ms-whatsapp – each with its own domain model, database, and REST API.
d. Inter-service Communication
• OpenFeign clients for synchronous RPC (finance & users clients in chatbot & WhatsApp).
e. External Integrations
• OpenAI REST API (called by ms-chatbot-openAi).
• WhatsApp platform webhook (incoming requests to ms-whatsapp).
f. Persistence
• Each service likely has its own database (not shown but implied by JPA repositories).
• Eureka Server
• API Gateway
• User Service
• Finance Service
• Chatbot Service
• WhatsApp Service
• OpenAI External API
• WhatsApp Platform
• Databases (one per microservice; optional grouping)
1) Client → Gateway → Eureka (to resolve) → target service.
2) WhatsApp Platform → WhatsApp Service → forwards to Chatbot Service.
3) Chatbot Service → Feign → User Service & Finance Service.
4) Chatbot Service → OpenAI API → Chatbot Service → Database.
5) All services register with Eureka.
• Docker Compose at the bottom or side as the orchestration layer that brings up all services.
Architectural Patterns & Principles to Call Out
• Microservices decomposition by bounded contexts (users, finance, chatbot, messaging).
• Service discovery for loose coupling and dynamic scaling.
• API Gateway for authentication, routing, and load balancing.
• Synchronous Feign calls but could mention circuit breakers if added later.
• Each service isolated (separate codebase, Docker container, config).
Essential Details to Capture
• Service registry interactions (heartbeats/register/unregister).
• API Gateway routing rules (e.g., /users/** → ms-users).
• Feign client usage inside chatbot and WhatsApp services.
• Persistence layer per service (JPA repositories).
• External HTTP integrations (OpenAI key, WhatsApp webhook).