How f3rren/century-road-backend works
Century Road is a three-service backend: the gateway is the browser-facing entry point, auth-service manages identity and tokens, and history-service serves Wikipedia-based history plus discovery, editorial, reporting, and usage features. The shown on-this-day path validates a query, loads feeds through a cache, records a view, and returns an envelope. Other history capabilities are documented, but their controller-to-service wiring is not sampled; those links are marked unverified rather than inferred as direct calls.
Main entry points: OnThisDayController.java History endpoints · SessionService.java Session service · GatewayApplication.java Gateway routing · AuthController.java Auth endpoints
Components 22
API gateway
- Gateway routing
service/gateway/src/main/java/centuryroad/gateway/GatewayApplication.java
Identity and sessions
- Auth endpoints
service/auth-service/src/main/java/centuryroad/auth/controller/AuthController.java - User administration
service/auth-service/src/main/java/centuryroad/auth/controller/AdminUserController.java - Session service
service/auth-service/src/main/java/centuryroad/auth/service/SessionService.java - Identity management
service/auth-service/src/main/java/centuryroad/auth/service/AuthService.java - User lookup
service/auth-service/src/main/java/centuryroad/auth/service/UserService.java - JWT service
service/auth-service/src/main/java/centuryroad/auth/service/JwtService.java - Refresh tokens
service/auth-service/src/main/java/centuryroad/auth/service/RefreshTokenService.java - Identity database
service/auth-service/src/main/java/centuryroad/auth/model/User.java
Historical feeds
- History endpoints
service/history-service/src/main/java/centuryroad/history/controller/OnThisDayController.java - Query validation
service/history-service/src/main/java/centuryroad/history/query/OnThisDayQuery.java - On-this-day service
service/history-service/src/main/java/centuryroad/history/service/OnThisDayService.java - Feed cache
service/history-service/src/main/java/centuryroad/history/service/FeedCache.java
Discovery and editorial
- Timeline and discovery
service/history-service/src/main/java/centuryroad/history/controller/TimelineController.java - Timeline queries
service/history-service/src/main/java/centuryroad/history/service/TimelineService.java - Editorial catalog
service/history-service/src/main/java/centuryroad/history/service/EditorialCatalog.java - Error reports
service/history-service/src/main/java/centuryroad/history/controller/ReportsController.java - Report handling
service/history-service/src/main/java/centuryroad/history/service/ReportService.java - History database
service/history-service/src/main/java/centuryroad/history/repository/TimelineEventRepository.java
Other components
- Browser client
- TLS proxy
- Wikipedia feeds
Connections 21
- Browser client → TLS proxy: sends HTTPS
README.md - TLS proxy → Gateway routing: forwards requests
README.md - Gateway routing → Auth endpoints: routes auth
README.md - Gateway routing → History endpoints: routes history
README.md - Auth endpoints → Session service: delegates to
service/auth-service/src/main/java/centuryroad/auth/controller/AuthController.java - Session service → Identity management: authenticates with
service/auth-service/src/main/java/centuryroad/auth/service/SessionService.java - Session service → JWT service: issues tokens
service/auth-service/src/main/java/centuryroad/auth/service/SessionService.java - Session service → Refresh tokens: rotates tokens
service/auth-service/src/main/java/centuryroad/auth/service/SessionService.java - Identity management → Identity database: reads and writes
service/auth-service/src/main/java/centuryroad/auth/service/AuthService.java - User administration → User lookup: manages users
service/auth-service/src/main/java/centuryroad/auth/controller/AdminUserController.java - User lookup → Identity database: looks up users
service/auth-service/src/main/java/centuryroad/auth/service/UserService.java - History endpoints → Query validation: validates request
service/history-service/src/main/java/centuryroad/history/controller/OnThisDayController.java - History endpoints → On-this-day service: requests events
service/history-service/src/main/java/centuryroad/history/controller/OnThisDayController.java - On-this-day service → Feed cache: loads feeds
service/history-service/src/main/java/centuryroad/history/service/OnThisDayService.java - Feed cache → Wikipedia feeds: fetches feeds
- History endpoints → Timeline and discovery: also exposes
- Timeline and discovery → Timeline queries: queries index
- Timeline queries → History database: reads index
service/history-service/src/main/java/centuryroad/history/service/TimelineService.java - History endpoints → Error reports: also exposes
- Error reports → Report handling: submits reports
- Report handling → Editorial catalog: checks targets
service/history-service/src/main/java/centuryroad/history/service/ReportService.java