CodeRover is a sophisticated Spring Boot web application that provides AI-powered code review services with seamless GitHub integration. The application enables developers to authenticate via GitHub OAuth2, browse their repositories, and leverage multiple AI models (GPT-5 and CodeT5) for intelligent code analysis and review.
- GitHub OAuth2 Integration: Secure login using GitHub credentials
- JWT Token Management: Session management with JSON Web Tokens
- Spring Security: Comprehensive security configuration with role-based access
- Repository Management: Fetch and browse user repositories (Java-focused filtering)
- File System Navigation: Explore repository trees and file structures
- Branch Management: Access and switch between different repository branches
- File Content Retrieval: Read and analyze individual file contents via GitHub API
- Multiple AI Providers:
- GPT-5 integration via custom Review Client
- CodeT5 model integration for specialized code analysis
- Intelligent Analysis: Automated code review with detailed feedback
- Build Status Review: Specialized prompts for build and deployment analysis
- Customizable Prompts: Configurable review prompts for different scenarios
- Email Reports: Send formatted code review reports via SMTP
- Real-time Notifications: Instant feedback on code analysis results
- MySQL Integration: Persistent data storage with Spring Data JPA
- User Management: Store and manage user profiles and preferences
- Repository Tracking: Track user interactions and review history
- Java 21: Latest LTS version for optimal performance
- Spring Boot 3.5.0: Modern Spring framework with latest features
- Spring Security: OAuth2 and JWT authentication
- Spring Data JPA: Database abstraction and ORM
- Spring Web: RESTful web services
- OpenFeign: Declarative HTTP client for external APIs
- GitHub API: Complete GitHub integration
- OAuth2 Client: GitHub OAuth2 authentication flow
- MySQL 8: Primary database for data persistence
- Hibernate: JPA implementation for ORM
- Connection Pooling: Optimized database connections
- Maven: Dependency management and build automation
- JUnit 5: Modern testing framework
- Mockito: Mocking framework for unit tests
- AssertJ: Fluent assertion library
- Jacoco: Code coverage analysis
- Lombok: Reduce boilerplate code
- Log4j2: Advanced logging framework
- JJWT: JSON Web Token library
- Jakarta Mail: Email functionality
- Java 21 or higher
- Maven 3.9+
- MySQL 8.0+
- Docker (optional, for containerized deployment)
git clone https://github.com/DamianRavinduPeiris/coderover-spring-web.git
cd coderover-spring-webCreate a MySQL database for the application:
CREATE DATABASE coderover;Create a .env file or set the following environment variables:
# GitHub OAuth2
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Database Configuration
DB_URL=jdbc:mysql://localhost:3306/coderover
DB_USERNAME=your_db_username
DB_PASSWORD=your_db_password
# JWT Configuration
JWT_SECRET=your_jwt_secret_key
# Frontend Configuration
FRONTEND_REDIRECT_URI=http://localhost:3000
# Email Configuration
MAIL_HOST=smtp.gmail.com
APP_USERNAME=your_email@gmail.com
APP_PASSWORD=your_app_password
MAIL_FROM=your_email@gmail.com
MAIL_DEBUG=false
# AI Review Service Configuration
REVIEW_CLIENT_BASE_URL=your_review_api_url
REVIEW_CLIENT_TOKEN=your_review_api_token
REVIEW_CLIENT_PROMPT=your_custom_review_prompt
REVIEW_CLIENT_BUILD_PROMPT=your_build_review_prompt
# CodeT5 Configuration
CODE_T5_V1_BASE_URL=your_codet5_api_url
# User Configuration
USER_DEFAULT_PROFILE_PICTURE_URL=https://github.com/identicons/default.png# Using Maven
mvn clean install
mvn spring-boot:run
# Using Java directly
java -jar target/coderover-0.0.1-SNAPSHOT.jarThe application will start on http://localhost:8080
docker build -t coderover-spring .docker run -p 8080:8080 \
-e GITHUB_CLIENT_ID=your_client_id \
-e GITHUB_CLIENT_SECRET=your_client_secret \
-e DB_URL=your_db_url \
-e DB_USERNAME=your_db_user \
-e DB_PASSWORD=your_db_password \
-e JWT_SECRET=your_jwt_secret \
coderover-springGET /oauth2/authorization/github- Initiate GitHub OAuth2 flowPOST /login/oauth2/code/github- GitHub OAuth2 callback
GET /api/v1/github/user/repos- Fetch user repositoriesGET /api/v1/github/repos/{owner}/{repo}/tree- Get repository file treeGET /api/v1/github/repos/{owner}/{repo}/blob- Get file contentGET /api/v1/github/repos/{owner}/{repo}- Get repository branchesGET /api/v1/github/user- Get user information
POST /api/v1/review- Request standard code reviewPOST /api/v1/review/codeT5/v1- Request CodeT5 model reviewPOST /api/v1/review/status- Request build status review
POST /email/send-report- Send code review report via email
GET /health- Application health statusGET /actuator/health- Detailed health information
mvn testmvn clean verifyCoverage reports will be generated in target/site/jacoco/index.html
The project includes comprehensive test exclusions in pom.xml to focus on service layer testing while excluding configuration and DTO classes.
The project includes GitHub Actions workflow for automated review and build:
- Automated Code Review: AI-powered review of changed Java files on pull requests
- Build Validation: Maven build execution with Java 21
- Quality Gates: Build blocking based on review feedback
- Caching: Maven dependencies caching for faster builds
- Pull requests to
masterbranch - Automatic review of all changed Java files
- Build execution only if review passes
src/
├── main/
│ ├── java/com/damian/coderover/
│ │ ├── config/ # Configuration classes
│ │ ├── controller/ # REST controllers
│ │ ├── dto/ # Data Transfer Objects
│ │ ├── entity/ # JPA entities
│ │ ├── exception/ # Custom exceptions
│ │ ├── feign/ # Feign clients for external APIs
│ │ ├── filter/ # Security filters
│ │ ├── handler/ # OAuth2 handlers
│ │ ├── repository/ # Data repositories
│ │ ├── response/ # Response models
│ │ ├── service/ # Business logic services
│ │ └── util/ # Utility classes
│ └── resources/
│ └── application.yml # Application configuration
└── tests/
└── java/ # Test classes
- Go to GitHub → Settings → Developer settings → OAuth Apps
- Create a new OAuth App with:
- Application name: CodeRover
- Homepage URL:
http://localhost:8080 - Authorization callback URL:
http://localhost:8080/login/oauth2/code/github
- Copy the Client ID and Client Secret to your environment variables
Configure your preferred AI review service endpoints and authentication tokens in the environment variables.
- Copy
.env.exampleto.envand configure your settings - Never commit
.envfiles to version control - Use different environment files for different deployment environments
- CONTRIBUTING.md: Detailed contribution guidelines
- .env.example: Environment variables template
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Java coding conventions
- Write unit tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
Damian Ravindu Peiris
- GitHub: @DamianRavinduPeiris
- Email: Contact via GitHub
- Spring Boot team for the excellent framework
- GitHub for their comprehensive API
- OpenAI and Hugging Face for AI model access
- All contributors and users of this project
Ready to revolutionize your code review process? Get started with CodeRover today!