How praveen8848/toolshare_application works
1. Overall shape
ToolShare is a microservice-based rental platform with a React frontend and several Spring Boot backend services. The backend is split by business domain rather than by technical layer, with each service owning its own API, persistence model, and security boundary.
2. Edge entry and routing
The gateway is the single backend entry point from the frontend. It handles request routing to downstream services and also contains cross-cutting concerns such as JWT authentication, logging, rate limiting, circuit breaking, and fallback/error handling. This makes the gateway the main boundary between public traffic and internal services.
3. Service discovery
All Spring services register with the Eureka server, which acts as the internal service registry. The gateway and inter-service clients rely on discovery instead of hardcoded service locations, so runtime topology is dynamic.
4. Authentication boundary
auth-service is responsible for credential handling and JWT token issuance/validation. It contains the login/register controllers, JWT filter/provider, Spring Security configuration, and a User entity/repository for authentication data. Other services trust the token rather than re-authenticating users locally.
5. User profile subsystem
user-service stores user profile data separate from authentication data. It manages profile updates, password-change related workflows, and user-facing metadata such as owner profile information. The presence of Feign clients and a registration listener suggests profile creation/synchronization is coordinated with auth-related flows rather than duplicated manually.
6. Inventory/tool subsystem
tool-service owns tool listings, categories, and search-related logic. It includes Tool, Category, repositories, controllers, and services such as GeocodingService, which implies location-aware tool discovery. The README’s PostGIS reference indicates this service is the geospatial boundary for radius-based and location-filtered search.
7. Booking/subscription lifecycle
booking-service models the rental workflow and booking state transitions. Its domain includes Booking, BookingStatus, request/response DTOs, availability/conflict views, and dashboard metrics. This is the service that coordinates request creation, approval, updates, and completion, so it is the core transactional workflow for renting tools.
8. Asynchronous notifications
notification-service is decoupled from booking and user flows through RabbitMQ. It consumes NotificationEvent messages and delegates to EmailService, so notifications are event-driven rather than synchronous API calls. This keeps user-facing booking actions responsive while notification delivery happens out of band.
9. Synchronous service-to-service calls
Several services use Feign-style REST clients to fetch data from neighboring domains:
- booking-service calls tool-service and user-service
- tool-service calls user-service
- auth-service and user-service also coordinate around registration/profile sync
These calls are used for enriching responses and validating ownership/profile context without duplicating data locally.
10. Caching and state support
Redis is configured in booking-service and tool-service, indicating caching or short-lived state support for performance-sensitive flows such as availability checks, session-like data, or query acceleration. It is an auxiliary store, not the primary system of record.
11. Frontend composition
The frontend is a React SPA organized by feature: auth, tools, bookings, dashboards, and common UI. It uses a central Axios config, an auth context, protected routes, custom hooks, and feature-specific service wrappers to talk to the gateway rather than directly to backend services.
12. Data ownership and boundaries
The architecture follows a database-per-service style. auth-service, user-service, booking-service, and tool-service each maintain their own persistence model, which reduces coupling and keeps lifecycle rules local to the service that owns them.
13. Infrastructure and deployment
The repo is containerized with per-service Dockerfiles and a top-level docker-compose.yaml for local stack orchestration. Maven wrappers are used for each Java service, and the frontend is a separate Node-based application. The main runtime dependencies that shape the architecture are Spring Boot, Eureka, RabbitMQ, Redis, PostgreSQL/PostGIS, and React.
14. Primary request/data flow
A typical user journey is: React frontend → gateway → domain service. For example, browsing tools goes through the gateway into tool-service; creating a booking goes through the gateway into booking-service, which may consult tool-service/user-service and emit a RabbitMQ event; notification-service consumes that event and sends email; profile or ownership data is served from user-service. This combination of synchronous API calls and asynchronous events is the central architectural pattern of the system.
Main entry points: gateway Gateway · booking-service Booking Service · user-service User Service · eureka-server Eureka Server
Components 19
Frontend
React client and feature UI
- React SPA · Feature-based client UI and route composition
frontend - App Routes · Protects pages and wires feature views
frontend/src/routes/AppRoutes.js - API Client · Central Axios/auth context used by feature services
frontend/src/config/axiosConfig.js
Edge
Public entry and routing layer
- Gateway · Single entry point with routing, JWT, logging, rate limiting, and fallback handling
gateway - Gateway Filters · JWT auth, logging, circuit breaking, and error handling
gateway/src/main/java/com/toolsharing/gateway/filter - Gateway Config · Route, security, rate limit, and client setup
gateway/src/main/java/com/toolsharing/gateway/config
Domain Services
Business-domain Spring Boot services
- Auth Service · Credentials, JWT issuance, and auth persistence
auth-service - Auth Security · JWT filter, token provider, and Spring Security
auth-service/src/main/java/com/toolsharing/auth_service/security - User Service · User profiles, password workflows, and registration sync
user-service - Reg Listener · Consumes registration events and coordinates profile creation
user-service/src/main/java/com/toolsharing/user_service/listener/UserRegistrationListener.java - Tool Service · Tools, categories, search, and geospatial discovery
tool-service - Geocoding · Location-aware tool lookup support
tool-service/src/main/java/com/toolsharing/tool_service/service/GeocodingService.java - Booking Service · Booking lifecycle, availability, approval, and metrics
booking-service - Booking Logic · State transitions and booking operations
booking-service/src/main/java/com/toolsharing/booking_service/service/BookingService.java - Notification Service · Consumes events and sends email notifications
notification-service
Infra
Shared runtime infrastructure
- Eureka Server · Service discovery registry for Spring services
eureka-server - RabbitMQ · Async event bus between booking, user, and notifications
- Redis · Short-lived state and query acceleration for booking/tool flows
- PostgreSQL/PostGIS · Service-owned persistence including geospatial data
Connections 30
- React SPA → App Routes: renders · UI routes to feature pages
- React SPA → API Client: calls API · Frontend features use shared client/auth context
- API Client → Gateway: requests · All API traffic is sent through the gateway
- Gateway → Gateway Filters: applies · Cross-cutting edge concerns run at ingress
- Gateway → Gateway Config: routes · Gateway config defines downstream routing and policies
- Gateway → Eureka Server: discovers · Gateway resolves services through the registry
- Auth Service → Auth Security: secures · JWT and Spring Security boundary
- Auth Service → Eureka Server: registers · Service discovery registration
- Auth Service → PostgreSQL/PostGIS: stores · Auth data is persisted locally
- Auth Service → User Service: syncs user · Registration/profile coordination
- User Service → Reg Listener: consumes · Registration event handling and profile creation flow
- User Service → Eureka Server: registers · Service discovery registration
- User Service → PostgreSQL/PostGIS: stores · Profile data is persisted locally
- User Service → RabbitMQ: publishes/consumes · Event-driven profile coordination
- Tool Service → Geocoding: uses · Location-aware tool discovery
- Tool Service → Eureka Server: registers · Service discovery registration
- Tool Service → PostgreSQL/PostGIS: stores · Tool and category data are persisted locally
- Tool Service → Redis: caches · Supports performance-sensitive lookup flows
- Booking Service → Booking Logic: drives · Core rental workflow implementation
- Booking Service → Eureka Server: registers · Service discovery registration
- Booking Service → PostgreSQL/PostGIS: stores · Bookings are persisted locally
- Booking Service → Redis: caches · Supports availability and short-lived state
- Booking Service → RabbitMQ: publishes · Emits booking events for notifications
- Notification Service → RabbitMQ: consumes · Listens for notification events
- Notification Service → Eureka Server: registers · Service discovery registration
- Gateway → Auth Service: routes auth · Public auth requests are forwarded to auth-service
- Gateway → User Service: routes user · Profile requests are forwarded to user-service
- Gateway → Tool Service: routes tools · Tool browsing and management requests flow through the gateway
- Gateway → Booking Service: routes bookings · Booking requests flow through the gateway
- Gateway → Notification Service · Notifications are not directly exposed as a public API