How stefan-kolov/smartreview works
Purpose and Runtime
SmartReview is a Spring Boot backend that accepts repository/code-review requests, runs AI-assisted review jobs, persists results, and exposes authentication, user, and review APIs. The executable entry point is src/main/java/com/smartreview/smartreview/SmartReviewApplication.java; Maven builds the service via pom.xml. Container deployment is defined by Dockerfile and docker-compose.yml.
HTTP API and Security Boundary
REST controllers form the inbound boundary:
• src/main/java/com/smartreview/smartreview/web/AuthController.java
• src/main/java/com/smartreview/smartreview/web/UserController.java
• src/main/java/com/smartreview/smartreview/web/ReviewController.java
JWT authentication is handled before protected endpoints by config/JwtFilter.java, backed by token operations in config/JwtService.java and authorization rules in config/WebSecurityConfig.java. API documentation is configured in config/SwaggerConfig.java.
Identity and User Management
Authentication and account lifecycle operations flow from controllers through service interfaces and implementations:
• service/AuthService.java, service/impl/AuthServiceImpl.java
• service/UserService.java, service/impl/UserServiceImpl.java
• repository/UserRepository.java
The model/User.java entity is the durable identity model. Request/response DTOs separate public API payloads from persistence entities, especially under model/dto/.
Review Job Domain and Persistence
A review is represented as a durable job with associated reviewed files and detected issues:
• model/ReviewJob.java
• model/FileReview.java
• model/ReviewIssue.java
model/enums/ReviewStatus.java, Severity.java, and IssueCategory.java define workflow and result classifications. repository/ReviewJobRepository.java is the persistence boundary for review lifecycle state and results.
Review Submission and Orchestration Flow
Review requests enter through web/ReviewController.java, then pass through service/ReviewService.java and service/impl/ReviewServiceImpl.java. The orchestration layer coordinates repository retrieval, provider execution, job updates, and result persistence:
• service/impl/ReviewOrchestrator.java
• service/impl/RepoService.java
• service/impl/ReviewProgressService.java
This separates synchronous API submission/status access from potentially long-running review execution. config/AsyncConfig.java indicates asynchronous processing infrastructure for review work.
AI Provider Abstraction
service/CodeReviewProvider.java defines the boundary for external LLM review engines. service/impl/providers/BaseReviewProvider.java supplies shared provider behavior, while ReviewProviderFactory.java selects an implementation. Supported external services are represented by:
• AnthropicReviewProvider.java
• GeminiReviewProvider.java
• GroqReviewProvider.java
• OpenAiReviewProvider.java
Provider-specific API credentials, model selection, and runtime settings are expected to be environment/property-driven through src/main/resources/application.properties and application-prod.properties.
Primary Control Flow
1. A client registers or logs in; authentication returns a JWT.
2. The JWT filter authenticates subsequent user and review API calls.
3. A review request creates or updates a ReviewJob.
4. Async orchestration obtains repository/code content, chooses an AI provider, and submits file/code review work.
5. Provider output is normalized into FileReview and ReviewIssue records, persisted against the job, and exposed through review-job response DTOs.
Main entry points: ReviewController.java Review API · SmartReviewApplication.java SmartReview Application · AuthController.java Auth API · UserController.java User API
Components 20
HTTP API
- Auth API
src/main/java/com/smartreview/smartreview/web/AuthController.java - User API
src/main/java/com/smartreview/smartreview/web/UserController.java - Review API · Submits jobs and exposes status/results.
src/main/java/com/smartreview/smartreview/web/ReviewController.java - API DTOs
Security
- JWT Filter
- JWT Service
- Security Rules
- Auth & User Services
Review Pipeline
- Review Service
- Review Orchestrator · Coordinates repository retrieval, provider execution, and result updates.
- Repository Content
- Review Progress
- Async Execution
AI Providers
- Provider Factory
- Code Review Provider
- LLM Providers · Provider implementations share base behavior.
Persistence
- Users · User entity and repository.
- Review Jobs & Results · Stores jobs, file reviews, and detected issues.
- Review Domain Model · ReviewJob, FileReview, ReviewIssue, status, severity, and category.
Other components
- SmartReview Application
src/main/java/com/smartreview/smartreview/SmartReviewApplication.java
Connections 21
- SmartReview Application → Security Rules: boots
- SmartReview Application → Async Execution: boots
- JWT Filter → JWT Service: validates tokens
- Security Rules → JWT Filter: installs
- Auth API → Auth & User Services: auth requests
- User API → Auth & User Services: account requests
- Auth & User Services → JWT Service: issues tokens
- Auth & User Services → Users: reads and writes
- Review API → Review Service: submits and queries
- Review API → API DTOs: uses
- Review Service → Review Jobs & Results: creates and reads jobs
- Review Service → Review Orchestrator: starts async work
- Async Execution → Review Orchestrator: executes
- Review Orchestrator → Repository Content: retrieves code
- Review Orchestrator → Provider Factory: selects provider
- Provider Factory → Code Review Provider: returns
- LLM Providers → Code Review Provider: implements
- Review Orchestrator → Review Progress: updates progress
- Review Progress → Review Jobs & Results: persists lifecycle
- Review Orchestrator → Review Jobs & Results: persists results
- Review Jobs & Results → Review Domain Model: stores