A modern two-page web application for visualizing Gradle project dependencies from GitHub repositories. Built with vanilla JavaScript and Mermaid.js for clean, interactive dependency graphs.
- π― Two-Page Flow: Clean separation between input and graph visualization
- π Project Dependencies Only: Focuses on Gradle project-to-project dependencies (excludes external Maven libraries)
- π Smart Discovery: Recursively finds all
build.gradleandbuild.gradle.ktsfiles in your repository - β Validation: Real-time URL validation with helpful error messages
- π± Responsive Design: Works on desktop and mobile devices
- π¨ Modern UI: Built with CSS custom properties and modern design tokens
- π Deterministic: Same input always produces the same graph output
-
Clone this repository:
git clone https://github.com/MikolajLemanski/GradleProjectGraph.git cd GradleProjectGraph -
Start a local web server:
# Using Python 3 python3 -m http.server 8080 # Or using Node.js npx serve
-
Open your browser to
http://localhost:8080 -
Enter a public GitHub repository URL and click "Analyze Repository"
https://github.com/spring-projects/spring-boothttps://github.com/gradle/gradle- Any public Gradle multi-project repository
-
Input Page: Enter a GitHub repository URL
- Supports:
https://github.com/owner/repo - Optional branch:
https://github.com/owner/repo/tree/branch-name - Real-time validation shows if URL is valid
- Supports:
-
Analysis: Click "Analyze Repository"
- App fetches repository metadata
- Discovers all Gradle build files
- Parses project dependencies (Groovy and Kotlin DSL)
-
Graph Page: View the dependency graph
- Mermaid flowchart showing project relationships
- Legend explaining node and edge types
- Warnings for any parsing issues
- Metadata showing projects found and commit SHA
The parser extracts project dependencies from these patterns:
dependencies {
implementation project(':core')
api project(path: ':shared')
}dependencies {
implementation(project(":core"))
api(projects.shared.utils)
}- Public repositories only: Private repositories are not accessible
- Rate limits: 60 requests/hour without authentication, 5000/hour when authenticated
- Large repositories: Very large repositories (>1000 files) may be truncated by GitHub API
- Project dependencies only: External Maven/library dependencies are excluded from the graph
- Static parsing: Does not execute Gradle; uses pattern matching on source files
- Supported files: Only
build.gradle,build.gradle.kts,settings.gradle,settings.gradle.kts
- Modern browsers: Requires ES2020+ support (Chrome 80+, Firefox 74+, Safari 13.1+, Edge 80+)
- JavaScript enabled: Application requires JavaScript to function
- Modern browsers: Requires ES2020+ support (Chrome 80+, Firefox 74+, Safari 13.1+, Edge 80+)
- JavaScript enabled: Application requires JavaScript to function
- URL Normalization: Validates and parses GitHub repository URLs
- Metadata Fetch: Retrieves repository information and resolves branch to commit SHA
- Tree Discovery: Recursively lists all files in the repository
- File Filtering: Identifies Gradle build files
- Content Fetch: Downloads Gradle file content at pinned commit SHA
- Dependency Extraction: Parses project dependencies using regex patterns
- Graph Canonicalization: Deduplicates and sorts nodes/edges for deterministic output
- Mermaid Rendering: Generates and displays interactive flowchart
.
βββ index.html # Two-page HTML shell
βββ style.css # Modern CSS with design tokens
βββ js/
β βββ input-page.js # Input validation and analysis orchestration
β βββ graph-page.js # Graph rendering and Mermaid integration
β βββ github-client.js # GitHub REST API client
β βββ gradle-parser.js # Gradle dependency extraction
βββ tests/
β βββ integration/ # Integration test placeholders
β βββ parser/ # Parser unit test placeholders
βββ specs/
βββ 001-gradle-graph-viewer/ # Feature specifications
-
Enable GitHub Pages in your repository settings:
- Navigate to Settings β Pages
- Set Source to your main branch
- Click Save
-
Access your website:
- URL:
https://yourusername.github.io/GradleProjectGraph/ - May take a few minutes to deploy
- URL:
- Verify the repository is public
- Check the URL format is correct
- Ensure the repository exists
- Wait 60 minutes for rate limit reset
- Authenticate with GitHub for higher limits (not currently supported in this version)
- Verify the repository contains Gradle build files
- Check if files are in standard locations
- This tool only works with Gradle projects
- Check browser console for errors
- Verify Mermaid.js loaded successfully
- Try refreshing the page
This is a learning project. Feel free to fork and experiment!
See LICENSE file for details.