How phu0312/veggiepal_be works
VeggiePal is a Java microservice backend for vegan community and nutrition features. The documented user path is client → API Gateway → identity, nutrition, or blog APIs; those services own separate data stores. Sampled code also exposes AI meal-plan, prompt-preview, diary-snapshot, payment, and restaurant-search behavior. The README describes several of these as not yet implemented, so they are shown as repository capabilities rather than confirmed live routes. Cross-service edges follow explicit README statements or sampled calls; unsampled wiring is omitted.
Main entry points: ApiGatewayApplication.java API Gateway · HealthRecordController.java Health and allergies · BlogService.java Blogs and comments · UserController.java Accounts and profiles
Components 20
API entry
- API Gateway
api-gateway/src/main/java/com/veggiepal/gateway/ApiGatewayApplication.java
Identity
- Accounts and profiles
identity-service/src/main/java/com/veggiepal/controller/UserController.java - Identity data
identity-service/src/main/java/com/veggiepal/entity/User.java
Nutrition
- Health and allergies
nutrition-service/src/main/java/com/veggiepal/nutrition/controller/HealthRecordController.java - Nutrition data
nutrition-service/src/main/java/com/veggiepal/nutrition/service/HealthRecordService.java - Food and activity diary
nutrition-service/src/main/java/com/veggiepal/nutrition/diary/DiaryService.java
Community
- Blogs and comments
blog-service/src/main/java/com/veggiepal/blog/service/BlogService.java - Content moderation
blog-service/src/main/java/com/veggiepal/blog/moderation/AiContentModerationService.java - Blog data
blog-service/src/main/java/com/veggiepal/blog/entity/Blog.java
AI features
- AI chat
ai-service/src/main/java/com/veggiepal/ai/chat/ChatService.java - Meal planning
ai-service/src/main/java/com/veggiepal/ai/mealplan/MealPlanService.java - Prompt preview
ai-service/src/main/java/com/veggiepal/ai/prompt/PromptPreviewService.java - Groq client
ai-service/src/main/java/com/veggiepal/ai/groq/GroqClient.java
Other domains
- Payments and plans
payment-service/src/main/java/com/veggiepal/payment/service/PaymentService.java - Restaurant search
location-service/src/main/java/com/veggiepal/location/service/RestaurantService.java - Recipes and ingredients
recipe-service/src/main/java/com/veggiepal/recipe/service/RecipeService.java
Other components
- Web / mobile clients
- Groq API
- PayOS
- Cloudinary storage
Connections 17
- Web / mobile clients → API Gateway: send requests
- API Gateway → Accounts and profiles: routes to
- API Gateway → Health and allergies: routes to
- API Gateway → Blogs and comments: routes to
- Accounts and profiles → Identity data: owns data
- Health and allergies → Nutrition data: owns data
- Health and allergies → Food and activity diary: offers diary
- Blogs and comments → Blog data: owns data
- Content moderation → Blogs and comments: moderates content
- Prompt preview → Groq client: requests preview
ai-service/src/main/java/com/veggiepal/ai/prompt/PromptPreviewService.java - Prompt preview → Meal planning: reads active prompt
ai-service/src/main/java/com/veggiepal/ai/prompt/PromptPreviewService.java - Groq client → Groq API: calls completion API
ai-service/src/main/java/com/veggiepal/ai/groq/GroqClient.java - Food and activity diary → Meal planning: fetches plan snapshot
nutrition-service/src/main/java/com/veggiepal/nutrition/diary/DiaryService.java - Meal planning → Health and allergies: fetches health data
ai-service/src/main/java/com/veggiepal/ai/mealplan/MealPlanService.java - Payments and plans → PayOS: creates payment link
payment-service/src/main/java/com/veggiepal/payment/service/PaymentService.java - Accounts and profiles → Cloudinary storage: stores avatars
- Blogs and comments → Cloudinary storage: stores thumbnails