How top-poop/top-of-the-poops-site works
Main System Components
The system appears to be a microservices-based architecture with the following key components:
a. Core Services:
• Data Service (services/data)
• Badges Service (services/badges and services/badges-dynamic)
• Tiles Service (services/tiles)
• TLS Service (services/tls)
• Postgres Database (services/postgres)
• Monitoring Services (services/rainfall, services/thames)
b. Frontend Layer:
• Web Application (src/main/resources/templates)
• Static Assets (src/main/resources/assets)
c. Backend Layer:
• Kotlin-based API (src/main/kotlin)
• Data Processing Services
[Frontend Layer]
• ↓ ↑
[TLS/Gateway Layer]
• ↓ ↑
[Backend Services Layer]
• ↓ ↑
[Data Layer]
Key Relationships to Highlight
a. Data Flow:
• How data flows from external sources (Environment Agency, Thames Water) through the data processing services
• How processed data is stored in Postgres
• How the data is served to the frontend through the various services
b. Service Integration:
• How the badges service generates dynamic badges
• Tile service's role in map visualization
• Demonstrate the cron service's scheduled tasks
Specific Implementation Details
Technical elements:
• Kotlin/JVM backend (main application)
• Handlebars templating (templates directory)
• PostgreSQL database
• Nginx for serving static content
• Python services for data processing
• Docker containerization (multiple Dockerfiles present)
External Integrations
Connections to:
• Environment Agency data sources
• Thames Water data
• Tile services
• Social media sharing capabilities
Architectural Patterns
Highlight:
• Microservices architecture
• MVC pattern in the main application
• RESTful API design
• Event-driven data processing
External Services Layer
Use standardized symbols:
• Rectangles for services
• Hexagons for external systems