How ganeshedula/url_shorter works
This is a Spring Boot REST backend for account-authenticated URL shortening. Users register or sign in, manage owner-scoped short links, and resolve links through a redirect that records clicks; analytics summarize those events. Authentication also supports OTP verification and Google OAuth, while JWTs and Redis-backed sessions govern protected requests. The graph follows the documented capabilities and sampled controller/service/repository behavior; unsampled analytics enrichment and other wiring are represented only where directory and type names support it.
Main entry points: AuthService.java Auth workflows · UrlMappingService.java URL workflows · GoogleOAuthService.java Google OAuth · UrlMappingController.java URL endpoints
Components 27
Identity and sessions
- Auth endpoints
src/main/java/com/url/shortener/controllers/AuthController.java - Auth workflows
src/main/java/com/url/shortener/service/AuthService.java - OTP workflows
src/main/java/com/url/shortener/service/OtpService.java - Google OAuth
src/main/java/com/url/shortener/service/GoogleOAuthService.java - User service
src/main/java/com/url/shortener/service/UserService.java - User records
src/main/java/com/url/shortener/repo/UserRepository.java - Email delivery
src/main/java/com/url/shortener/service/EmailService.java - Redis sessions
src/main/java/com/url/shortener/service/RedisSessionService.java
Short URL lifecycle
- URL endpoints
src/main/java/com/url/shortener/controllers/UrlMappingController.java - Client metadata
src/main/java/com/url/shortener/util/ClientInfoExtractor.java - URL workflows
src/main/java/com/url/shortener/service/UrlMappingService.java - Code generator
src/main/java/com/url/shortener/util/ShortCodeGenerator.java - URL records
src/main/java/com/url/shortener/repo/UrlMappingRepository.java
Click analytics
- Click records
src/main/java/com/url/shortener/repo/ClickEventRepository.java - Click event
src/main/java/com/url/shortener/service/ClickEventRecorded.java - Click enrichment
src/main/java/com/url/shortener/service/ClickAnalyticsEnrichmentListener.java - Geo lookup
src/main/java/com/url/shortener/service/GeoLocationService.java - GeoIP clients
src/main/java/com/url/shortener/service/GeoLocationClient.java
Request security
- JWT service
src/main/java/com/url/shortener/security/JwtService.java - Security filters
src/main/java/com/url/shortener/security/security/WebSecurityConfig.java - JWT filter
src/main/java/com/url/shortener/security/JwtAuthenticationFilter.java - Rate limiting
src/main/java/com/url/shortener/security/RateLimitFilter.java
Other components
- API client
- Brevo service
- Redis
- GeoIP provider
- Google identity
Connections 32
- API client → Auth endpoints: calls auth API
- API client → URL endpoints: calls URL API
- Auth endpoints → Auth workflows: delegates auth
- Auth endpoints → Google OAuth: starts OAuth
- Auth workflows → OTP workflows: issues/verifies OTP
- Auth workflows → JWT service: creates/validates tokens
- Auth workflows → Redis sessions: manages sessions
- Auth workflows → User service: uses users
- User service → User records: reads/writes users
- OTP workflows → Redis: stores OTP state
- OTP workflows → Email delivery: sends codes
- Email delivery → Brevo service: delivers mail
- Google OAuth → Redis sessions: uses OAuth state
- Google OAuth → Auth workflows: completes sign-in
- Google OAuth → Google identity: exchanges/verifies
- Redis sessions → Redis: stores sessions
- URL endpoints → URL workflows: delegates URLs
- URL endpoints → User service: resolves owner
- URL endpoints → Client metadata: extracts click data
- URL workflows → Code generator: generates codes
- URL workflows → URL records: reads/writes URLs
- URL workflows → Click records: records and queries clicks
- URL workflows → Click event: publishes click event
- Click event → Click enrichment: dispatches event
- Click enrichment → Geo lookup: enriches location
- Geo lookup → GeoIP clients: uses lookup clients
- GeoIP clients → GeoIP provider: queries location
- API client → Security filters: sends protected request
- Security filters → JWT filter: configures filter
- Security filters → Rate limiting: configures filter
- JWT filter → JWT service: validates bearer token
- JWT filter → Redis sessions: checks revocation