A command-line application for tracking pull requests across multiple code repositories. Built with Spring Boot and Spring Shell, following clean layered architecture principles.
- 📋 Register and manage multiple code repositories
- 🔍 Track pull requests across registered repositories
- 💾 Persistent storage using JSON file-based storage
- ⚡ Scheduled background checks for repository updates
- 🎯 Clean separation of concerns with layered architecture
- 🖥️ Interactive CLI powered by Spring Shell
- Java 21
- Spring Boot 4.0.2
- Spring Shell 4.0.1 - Interactive CLI framework
- Jackson - JSON serialization/deserialization
- Lombok - Boilerplate reduction
- Maven - Dependency management
This project follows a Layered Architecture pattern with clear separation of concerns:
Presentation Layer (CLI)
↓
Application Layer (Use Cases)
↓
Domain Layer (Business Logic)
↑
Infrastructure Layer (Persistence, External APIs)
See ARCHITECTURE.md for detailed architecture documentation.
src/main/java/com/prtracker/
├── Application.java # Spring Boot entry point
├── presentation/cli/ # CLI commands
├── application/
│ ├── service/ # Application services
│ ├── dto/ # Data transfer objects
│ └── usecase/ # Use case implementations
├── domain/
│ ├── entity/ # Domain entities (CodeRepository, PullRequest)
│ ├── valueobject/ # Value objects (CodeRepositoryId, PullRequestId)
│ ├── enums/ # Domain enumerations (Status)
│ └── repository/ # Repository interfaces
└── infrastructure/
├── persistence/ # File-based storage implementation
├── scheduling/ # Background job scheduling
└── external/ # External API integrations
- Java 21 or higher
- Maven 3.6+
- Clone the repository:
git clone <repository-url>
cd pr-tracker- Build the project:
./mvnw clean installStart the application using Maven:
./mvnw spring-boot:runOr run the compiled JAR:
java -jar target/pr-tracker-0.0.1-SNAPSHOT.jarOnce the application starts, you'll be presented with an interactive shell. Type help to see available commands.
# Register a new repository
pr-tracker:> register-repository --owner spring-projects --name spring-boot
# List all registered repositories
pr-tracker:> list-repositories
# Check repositories for pull requests
pr-tracker:> check-repositories
# Exit the application
pr-tracker:> exitRepository data is stored in JSON format in the data/ directory:
data/
└── repositories.json
The application automatically loads repositories on startup and persists changes to disk.
All application logic is implemented as use cases, inheriting from base classes:
AbstractUseCase<T>- For use cases that return a valueAbstractVoidUseCase- For use cases that return void
Example use cases:
InitializeCodeRepositoriesUseCase- Loads repositories from file on startupPersistCodeRepositoriesUseCase- Saves repositories to fileCheckRepositoriesUseCase- Checks all repositories for updates
Domain entities are persisted through repository interfaces defined in the domain layer and implemented in the infrastructure layer.
To keep the domain layer free from infrastructure concerns (like Jackson annotations), DTOs and mappers are used in the infrastructure layer to handle serialization.
./mvnw test./mvnw clean packageThe compiled JAR will be available in the target/ directory.
Application configuration is managed through application.yaml:
spring:
application:
name: pr-tracker- Follow the layered architecture principles
- Keep domain logic free from infrastructure dependencies
- Use the use case pattern for application logic
- Write tests for new features
- Follow existing code style and conventions