How nbulteau/mystravastats-2 works
Main Components
• Frontend: The “front-vue” directory contains the Vue.js application, including views, components, services, stores, and routing logic.
• Backend API(s): There are two backend implementations:
• “back-go”: A Go-based backend that follows a layered architecture with packages for adapters (integrating with both local and Strava APIs), API (controllers, routing, and DTOs), and domain (business logic, services, statistics calculations, and helpers).
• “back-kotlin”: A Kotlin-based backend with a similar layered structure, featuring modules for adapters (e.g., local repositories, Strava integration, terrain data), API (REST controllers, DTOs, configuration), and a domain layer (including business services, statistics services, and interfaces).
• Domain/Business Core: Both backends have a rich domain layer that encapsulates business rules, data models, and statistical calculations used for various activity-related metrics.
• External Services Integration: Integration with the Strava API for obtaining user activity data (using OAuth2 flow—as indicated by the README’s explanation) and local activity data caching.
• CSV Exporting: Services to generate CSV files with the computed statistics.
Relationships and Data Flow
• Both backend implementations expose HTTP endpoints (controllers/handlers) that receive API requests, convert data via DTOs, and delegate processing to business logic.
• The Backend’s API Layer calls into the Domain Layer (services, business logic, and statistics computation modules). Show these as internal calls within the backend.
• The Domain Layer might fetch or update data through the Adapters layer, which includes integration with:
• Strava API (for retrieving activity data).
• Local storage systems and file-based data (such as the “strava-cache” directory).
• Computation results (statistics) are then returned through the layered structure from the Domain back to the API layer and finally to the Frontend.
Architectural Patterns and Design Principles
• Layered Architecture (or hexagonal architecture): Separate concerns into layers—Adapters (for external integrations), Domain/Business (core rule and computation logic), and API/Controllers (presentation of services).
• Interface Abstraction: Both implementations use interfaces (e.g., ILocalStorage, IStravaApi) to abstract away data fetching and processing, important for extensibility and future testing.
Technologies and Frameworks
• Frontend: Vue.js with TypeScript, along with supporting libraries for routing and state management.
• Backend (Kotlin version): Spring Boot (as evidenced by the “ServletInitializer” and application configuration files) and Gradle as the build system.
Specific Elements
• Data/request flow from the Frontend to Backend.
• Internal calls from API Controllers to Domain Services.
• External calls from the Domain to external sources (Strava API, local cache).
• Clearly Omit Docker Workflows: Exclude any references to Docker containers or orchestration details since the instructions require removing Docker specifics.