The Dashboard is the main interface of Source Code Portal, providing a unified view of all repository groups, commit activity, documentation, and status metrics across your GitHub organization.
The Dashboard aggregates data from multiple GitHub repositories and presents it in an organized, easy-to-navigate interface. It serves as the central hub for monitoring code activity, viewing documentation, and tracking build/security status.
Key Capabilities:
- Display repository groups with commit counts
- Show recent commit activity across all repositories
- Render documentation (Markdown/AsciiDoc) inline
- Display build status badges (Jenkins, GitHub Actions)
- Show security scan results (Snyk)
- Real-time updates via GitHub webhooks
The main dashboard displays all repository groups configured in config.json.
Features:
- Group Cards: Each repository group is shown as a card with:
- Group name and description
- Number of repositories in the group
- Recent commit count (last 24 hours)
- Quick links to group details
- Commit Activity Timeline: Recent commits across all repositories
- Status Summary: Overall health indicators for GitHub API, cache, and executors
Endpoint: http://localhost:9090/dashboard
Controller: no.cantara.docsite.controller.spring.DashboardWebController
Detailed view of a specific repository group showing all repositories in that group.
Features:
- Repository List: All repositories matching the group's artifact patterns
- Per-Repository Cards: Each repository shows:
- Repository name, description, and URL
- Latest commit information (author, message, timestamp)
- Build status badge (Jenkins/GitHub Actions)
- Security status badge (Snyk)
- Stars, forks, and watchers count
- Primary language and license
- Group Documentation: Rendered README from the default group repository
- Commit History: Recent commits specific to this group
Endpoint: http://localhost:9090/group/whydah
Controller: no.cantara.docsite.controller.spring.GroupWebController
View the contents and documentation of a specific repository.
Features:
- Documentation Rendering:
- Markdown (.md) files rendered with GitHub-flavored Markdown
- AsciiDoc (.adoc, .asciidoc) files rendered with AsciiDoctor
- Syntax highlighting for code blocks
- Automatic table of contents generation
- Image embedding support
- File Browser: Navigate repository directory structure
- Branch Selection: Switch between branches to view different versions
- Commit Context: Show which commit the content is from
Endpoint: http://localhost:9090/contents/Cantara/Whydah-UserAdminService/master
Controller: no.cantara.docsite.controller.spring.ContentsWebController
View the commit log for a specific repository.
Features:
- Commit List: Chronological list of commits with:
- Commit SHA (short and full)
- Author name and avatar
- Commit message
- Timestamp (relative and absolute)
- Files changed count
- Commit Details: Click to expand and see:
- Full commit message
- List of changed files
- Diff stats (additions/deletions)
- Pagination: Navigate through commit history
- Filtering: Filter by author, date range, or message content
Endpoint: http://localhost:9090/commits/Cantara/Whydah-UserAdminService
Controller: no.cantara.docsite.controller.spring.CommitsWebController
Source Code Portal can render documentation in multiple formats directly in the dashboard.
Rendered using a GitHub-flavored Markdown parser with support for:
- Headers (H1-H6)
- Bold, italic, strikethrough
- Ordered and unordered lists
- Code blocks with syntax highlighting
- Tables
- Blockquotes
- Links and images
- Task lists (checkboxes)
- Emoji shortcodes
Example:
# My Project
## Features
- Feature 1
- Feature 2
## Code Example
```java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
#### 2. AsciiDoc (.adoc, .asciidoc)
Rendered using AsciiDoctor with support for:
- Document structure (parts, chapters, sections)
- Admonitions (NOTE, TIP, WARNING, IMPORTANT, CAUTION)
- Code blocks with callouts
- Tables with complex formatting
- Include directives
- Conditional text
- Bibliography and footnotes
**Example**:
```asciidoc
= My Project Documentation
:toc:
:icons: font
== Introduction
NOTE: This is an important note.
[source,java]
----
public class Example {
public void method() {
// Code here
}
}
----
1. Fetch content from GitHub API
↓
2. Identify file format (.md, .adoc)
↓
3. Parse with appropriate renderer
↓
4. Apply syntax highlighting (code blocks)
↓
5. Inject Thymeleaf template fragments
↓
6. Render final HTML
Renderer Classes:
no.cantara.docsite.domain.renderer.MarkdownRenderer- Markdown processingno.cantara.docsite.domain.renderer.AsciiDocRenderer- AsciiDoc processing
The Dashboard tracks and displays commit activity across all repositories.
GitHub Webhooks enable real-time updates when events occur:
- Push Events: New commits trigger cache refresh
- Release Events: New releases update release information
- Branch/Tag Creation: New branches/tags appear immediately
Configuration: See Webhooks documentation.
Recent Commits View:
- Shows commits from the last 24 hours (configurable)
- Grouped by repository
- Sorted by timestamp (newest first)
- Includes author avatar, name, and commit message
- Direct link to commit on GitHub
Commit Statistics:
- Total commits today/this week/this month
- Commits per repository
- Most active repositories
- Top contributors
The Dashboard integrates with multiple external services to display status badges.
Shows the current build status for each repository.
Badge States:
- Green (Success): Last build passed
- Yellow (Unstable): Build passed with warnings
- Red (Failure): Last build failed
- Gray (Unknown): No build information available
- Animated (Building): Build in progress
Configuration: Set Jenkins URL and job prefix in config.json:
{
"groupId": "whydah",
"jenkins": {
"prefix": "Whydah-"
}
}Shows security vulnerability scan results from Snyk.
Badge States:
- Green: No vulnerabilities found
- Yellow: Low/medium severity vulnerabilities
- Red: High/critical severity vulnerabilities
- Gray: Not scanned or scan failed
Configuration: Set Snyk organization and project prefix in config.json:
{
"groupId": "whydah",
"snyk": {
"organization": "cantara",
"projectPrefix": "whydah-"
}
}Display custom badges from Shields.io for metrics like:
- Code coverage
- License type
- Latest version
- Dependencies status
- Docker pulls
Configuration: Add shields to config.json:
{
"groupId": "whydah",
"shields": [
{
"label": "coverage",
"message": "85%",
"color": "brightgreen"
}
]
}The Dashboard uses an aggressive caching strategy to minimize GitHub API calls and provide fast page loads.
-
Repository Cache: Basic repository metadata (name, description, URL)
- TTL: 1 hour
- Refreshed on webhook push events
-
Commit Cache: Commit history per repository
- TTL: 5 minutes
- Refreshed on webhook push events
-
Content Cache: Documentation content (README files)
- TTL: 10 minutes
- Refreshed on webhook push events
-
Build Status Cache: Jenkins/GitHub Actions status
- TTL: 2 minutes
- Refreshed on Jenkins webhook (if configured)
-
Snyk Badge Cache: Security scan results
- TTL: 15 minutes
- Refreshed on scheduled task
On application startup, the PreFetchData service warms up caches by:
- Loading all repository groups from
config.json - Fetching repository list from GitHub for each group
- Fetching recent commits for each repository
- Fetching README content for default group repositories
- Fetching build status for all repositories
- Fetching Snyk badges for all repositories
This ensures the first dashboard load is fast.
The Dashboard is designed to work within GitHub's API rate limits:
- Authenticated: 5000 requests/hour
- Unauthenticated: 60 requests/hour
Mitigation Strategies:
- Aggressive caching (reduces API calls)
- Circuit breaker pattern (prevents cascading failures)
- Conditional requests with ETags (GitHub returns 304 Not Modified when content unchanged)
- GitHub webhooks (eliminates polling)
Monitoring: Check rate limit status at /actuator/health/github
All external API calls use Resilience4j circuit breakers:
- Failure Threshold: 50% (opens after 50% of calls fail)
- Open State Duration: 60 seconds
- Half-Open Test Requests: 3 requests
- Bulkhead: Max 25 concurrent calls
- Timeout: 75 seconds per call
Benefits:
- Prevents cascading failures
- Fails fast when external services are down
- Automatically recovers when services return
The Dashboard is rendered using Thymeleaf server-side templates.
src/main/resources/META-INF/views/
├── template.html # Base layout (header, footer, navigation)
├── index.html # Dashboard view
├── group/
│ └── card.html # Group detail view
├── contents/
│ └── content.html # Repository content view
├── commits/
│ └── commits.html # Commit history view
└── fragments/
├── repository.html # Repository card fragment
├── commit.html # Commit list item fragment
└── badge.html # Status badge fragment
Thymeleaf Capabilities Used:
- Layouts:
th:replacefor template composition - Conditionals:
th:if,th:unlessfor conditional rendering - Iteration:
th:eachfor lists of repositories/commits - Text Interpolation:
th:text,th:utextfor safe/unsafe HTML - Attributes:
th:href,th:srcfor dynamic URLs - Fragments:
th:fragmentfor reusable components
Example:
<div th:each="repo : ${repositories}">
<h3 th:text="${repo.name}">Repository Name</h3>
<p th:text="${repo.description}">Description</p>
<a th:href="@{/contents/{org}/{repo}(org=${repo.owner},repo=${repo.name})}">
View Documentation
</a>
</div>While the Dashboard is primarily a web UI, it exposes REST endpoints for programmatic access:
GET /actuator/healthResponse:
{
"status": "UP",
"components": {
"github": {
"status": "UP",
"details": {
"rateLimit": {
"remaining": 4850,
"limit": 5000
}
}
},
"cache": {
"status": "UP"
}
}
}GET /actuator/infoResponse:
{
"app": {
"name": "Source Code Portal",
"version": "0.10.17-SNAPSHOT",
"java": {
"version": "21.0.1"
}
}
}Styles are written in Sass/SCSS and compiled to CSS.
Source: src/main/sass/scss/
Output: target/classes/META-INF/views/css/
To customize styling:
- Edit
.scssfiles insrc/main/sass/scss/ - Compile with:
sass --watch src/main/sass/scss:target/classes/META-INF/views/css - Changes are reflected immediately (no restart needed)
To customize templates:
- Edit Thymeleaf templates in
src/main/resources/META-INF/views/ - Rebuild the project:
mvn clean compile - Restart the application
Issue: Dashboard shows loading spinner indefinitely.
Possible Causes:
- GitHub API rate limit exceeded
- Invalid GitHub access token
- Network connectivity issues
Solutions:
- Check rate limit:
curl -H "Authorization: token YOUR_TOKEN" https://api.github.com/rate_limit - Verify token: Check
security.propertiesorSCP_GITHUB_ACCESS_TOKENenv var - Check logs:
tail -f logs/application.log
Issue: Dashboard shows outdated commit information.
Possible Causes:
- Cache not expiring
- Webhooks not configured
- Scheduled refresh not running
Solutions:
- Check cache health:
http://localhost:9090/actuator/health/cache - Verify webhook configuration: See Webhooks
- Check scheduled tasks:
http://localhost:9090/actuator/scheduledtasks
Issue: Some repositories not appearing in groups.
Possible Causes:
- Incorrect regex pattern in
config.json - Repository visibility (private repos require proper token permissions)
- Organization membership
Solutions:
- Test regex pattern: Use a regex tester to verify pattern matches repository names
- Verify token has
reposcope for private repositories - Check GitHub organization membership
- Repository Groups - Configure repository grouping
- Integrations - Set up Jenkins, Snyk, Shields.io
- Webhooks - Configure real-time updates
- Observability - Monitor dashboard health
- Architecture Overview - System design