How delihiros/uno works
Main Components
• Data Crawler: The pkg/crawler package indicates a component that retrieves player history data from the Valorant API.
• Database Integration: The pkg/database package shows that uno leverages the shockv portable database to cache and store crawled data.
• Data Entities & Analysis: The pkg/entities directory contains representations of various data objects (matches, player stats, events, etc.), while pkg/analysis (and its subdirectories like maps) suggests modules dedicated to statistical analysis and generating visuals (e.g., heatmaps).
• Visualization & Web Server: The pkg/view and pkg/server packages (with its subdirectories for web and databank) indicate that uno includes functionality to render visualizations and provide a web interface for map images (assets and public directories reinforce this).
• Discord Bot: The pkg/discord folder, containing code like wardell.go, integrates a Discord bot for data visualization triggered from Discord channels.
• Examples/CLI Entrypoints: Multiple examples in the examples folder (e.g., heatmap, killmap, crawler, etc.) illustrate how to run specific features and provide hands-on usage scenarios.
Relationships and Interactions
• The API Client interacts directly with Valorant APIs to fetch game data.
• The Data Crawler uses the API Client to collect data, which it then passes to the Database module for caching.
• The Data Entities layer acts as the shared data model throughout the system—linking data input (from the crawler/API client) and output (visualization or analysis).
• The Analysis component processes cached game data, deriving insights (maps, histograms, etc.) that are subsequently used by the Visualization module.
• The Web Server serves the visual assets (with HTML, JS, and images stored under pkg/server/web and public), enabling users to view processed information.
• The Discord Bot leverages the analysis and visualization outputs to provide real-time data views in a chat interface.
• The proxy components (pkg/proxy) suggest there might be network middleware or operations related to routing requests.
Architectural Patterns & Principles
• Layered Architecture: The project clearly separates concerns between data retrieval (client/crawler), storage (database), data processing (analysis/entities), and presentation (view/server/discord).
• Modularity: Each module (client, crawler, database, discord, analysis) is self-contained, promoting a microservices-like conceptual separation, even though they are packaged within a single project.
• Extensibility and Testing: The presence of counterpart test files (e.g., in pkg/client) reflects a design geared towards robustness and extendability.