How flashky/advent-of-code-2024 works
Project type and purpose
• This is an open-source, Maven-based Java puzzle-solver tool implementing “Advent of Code 2024” daily challenges.
• Each “dayXX” package contains one or more classes solving that day’s puzzle, plus a README explaining the problem.
• There is no web front end or external database; it’s a command-line tool/library whose outputs are validated by unit tests.
File structure
• Top-level:
• pom.xml: Maven project descriptor, lists dependencies (e.g. JGraphT) and plugins.
• .github/workflows/*.yml: CI pipelines that run build, tests, code-quality reports, year updates.
• .gitmodules: references to submodule “jgrapht” under common/jgrapht.
• src/main/java/com/adventofcode/flashk/common: shared utilities (IO, math, JSON, vector, 2D arrays).
• src/main/java/com/adventofcode/flashk/day{01…25}: per-day puzzle solvers.
• src/main/resources: static puzzle input data (e.g. day21 mapping files).
• src/test/java/...: JUnit tests for common utilities and each day’s solver.
README for additional insights
• Dependency on Maven, JGraphT, Codacy badges, submodule for graph algorithms.
Components & relationships
a. Main components
• CLI Runner / Entry point (could be each DayXX main class invoked by Maven).
• Common Utilities Module
• Day-solution Modules (25 components)
• Data/Resource Files
• Unit Tests
• Build & CI Infrastructure (Maven, GitHub Actions, Codacy)
• External Libraries (JGraphT, JSON parser)
b. Interactions
• The CLI Runner or each DayXX class imports and uses classes from Common Utilities (e.g., Input, Array2DUtil).
• Day modules read input files under src/main/resources.
• Unit Tests invoke both Common Utilities and Day modules, comparing outputs against expected values under src/test/resources.
• Maven orchestrates compilation, test execution, packaging.
• GitHub Actions listen for repository events, trigger Maven build → tests → Codacy quality checks.
• Submodule jgrapht is a dependency of the Common Utilities (for graph algorithms).
c. Architectural patterns / design principles
• Modular packaging: one Java package per puzzle/day.
• Shared-library (common) pattern: centralize reusable utilities.
• Standard Maven lifecycle & dependency injection via imports.
• CI/CD pipeline ensuring code quality and coverage.
d. Key technologies / frameworks
• Java 17+ (assumed)
• Maven (pom.xml)
• JUnit for tests
• JGraphT submodule
• GitHub Actions CI
• Codacy for static analysis & coverage
Detailed capture of essential elements
• Submodule relationship: Common Utilities → jgrapht submodule.
• How each Day-module sits on top of Common Utilities.
• Where runtime data comes from (Resources).
• How testing and CI integrate via Maven.
• Which external libraries are linked.
• And how new days can be added by following the same module pattern.