How 23klhuynh/soccer-api works
Project type and purpose
• This is primarily a backend data‐pipeline + REST API service. It ingests raw data via a web scraper, stages/normalizes it in CSV, persists it in PostgreSQL, then exposes it via a Spring Boot–based HTTP API.
File structure
• Top level:
• scraping/ (Python scraper using BeautifulSoup)
• stats.csv (scraped, intermediate data)
• soccer-stats/ (Spring Boot service)
• soccer-stats:
• pom.xml / Maven wrapper – build and dependency management
• src/main/java/com/soccerstats – controllers, services, repositories (MVC pattern)
• src/main/resources/application.properties – DB connection config
• src/test – unit/integration tests
Key insights from README
• Scraping → CSV → PostgreSQL → API
• Endpoints: GET /api/v1/player (all players or filtered by name)
Main components and interactions
a. External Websites
• Source of raw HTML (Europe’s top competitions).
b. Scraping Service (Python)
• Uses BeautifulSoup to parse HTML → produces stats.csv.
c. Data Store
• stats.csv staging, then a PostgreSQL database (configured in application.properties).
d. API Service (Java Spring Boot)
• Controller layer (PlayerController)
• Service layer (PlayerService)
• Repository layer (PlayerRepository → JPA/Hibernate to PostgreSQL)
e. Clients
• Web/mobile/CLI clients invoking HTTP endpoints
Architectural patterns & principles
• ETL pipeline: Extract (scraper) → Transform (normalize into CSV) → Load (PostgreSQL)
• Layered MVC in Spring Boot: clear separation of concerns
• Configuration‐as‐code: application.properties for environment settings
• Build automation via Maven