How venky4378/pg-finder-microservices works
PG Finder is a microservices platform for hostel discovery and bed-level reservations. The main user journey passes through the gateway, uses the user service for identity, discovers hostel inventory, and books a bed; owners can then manage booking status. Booking events are consumed asynchronously for notifications. The README documents frontend, database-per-service, and service-discovery capabilities, while the tree and sampled code support the service components shown. Some inter-service wiring is documented rather than present in sampled source, so those edges follow the README.
Main entry points: AuthenticationFilter.java API gateway · BookingServiceImpl.java Booking workflow · HostelController.java Hostel, room, bed APIs · AuthController.java Registration and login
Components 20
Entry and discovery
- API gateway
api-gateway/src/main/java/com/pgfinder/api_gateway/filter/AuthenticationFilter.java - Eureka registry
eureka-server/src/main/java/com/pgfinder/eureka_server/EurekaServerApplication.java
Identity and access
- Registration and login
user-service/src/main/java/com/pgfinder/user/controller/AuthController.java - User management
user-service/src/main/java/com/pgfinder/user/serviceImpl/UserServiceImpl.java - JWT service
user-service/src/main/java/com/pgfinder/user/security/JwtService.java - User database
Hostel inventory
- Hostel, room, bed APIs
hostel/src/main/java/com/pgfinder/hostel/controller/HostelController.java - Inventory services
hostel/src/main/java/com/pgfinder/hostel/serviceImpl - Hostel database
Reservations and events
- Booking API
booking-service/src/main/java/com/pgfinder/booking_service/controller/BookingController.java - Booking workflow
booking-service/src/main/java/com/pgfinder/booking_service/ServiceImpl/BookingServiceImpl.java - Booking database
- Kafka booking events
- Notification consumer
notification-service/notification-service/src/main/java/com/pgfinder/notification/consumer/NotificationConsumer.java
AI discovery
- AI chat API
ai-service/src/main/java/com/pgfinder/aiservice/controller/AiChatController.java - Recommendation and RAG
ai-service/src/main/java/com/pgfinder/aiservice/service/AiRecommendationService.java
Other components
- Resident / Owner
- React frontend
- Gemini API
- Email / SMS processing
Connections 23
- Resident / Owner → React frontend: uses
- React frontend → API gateway: HTTP + JWT
- API gateway → Registration and login: routes auth
- API gateway → Hostel, room, bed APIs: routes inventory
- API gateway → Booking API: routes bookings
- API gateway → User management: routes users
- API gateway → Eureka registry: discovers services
- Registration and login → User database: reads and writes
- Registration and login → JWT service: generates token
- User management → User database: reads and writes
- Hostel, room, bed APIs → Inventory services: dispatches
- Inventory services → Hostel database: reads and writes
- Booking API → Booking workflow: dispatches
- Booking workflow → Booking database: reads and writes
- Booking workflow → Hostel, room, bed APIs: validates bed
- Booking workflow → User management: validates user
- Booking workflow → Kafka booking events: publishes events
- Kafka booking events → Notification consumer: delivers events
- Notification consumer → Email / SMS processing: processes notices
- React frontend → AI chat API: sends chat
- AI chat API → Recommendation and RAG: dispatches
- Recommendation and RAG → Hostel, room, bed APIs: retrieves catalog
- Recommendation and RAG → Gemini API: generates answer