Conghao97's picture tcftrees's picture
ProgramGen release
d086025
|
Raw History Blame Contribute Delete
5.24 kB

Milestone 5: Ecosystem - Web Gateway

Status: Complete Started: 2025-12-21 Completed: 2025-12-21

Overview

Milestone 5 implements ecosystem features that enhance the user experience and enable broader adoption. The primary focus is on a Web Gateway that provides browser-based access to repositories, making Guts accessible to users who prefer a web interface over CLI.

Goals

  1. Web Gateway: Browser-based repository access with modern UI
  2. Repository Browser: View files, commits, branches in the browser
  3. Collaboration UI: View PRs, Issues, and discussions in the browser
  4. Search: Search repositories, code, issues, and PRs
  5. API Documentation: Interactive API documentation (OpenAPI/Swagger)

New Crate: guts-web

Technology Choices

Component Technology Rationale
Templates Askama Type-safe, compile-time templates
CSS Tailwind CSS (CDN) Utility-first, no build step
Syntax Highlighting highlight.js Client-side code highlighting
Markdown pulldown-cmark Fast, safe Markdown rendering

Route Structure

Page Components

Repository Home

  • README rendering (Markdown)
  • File tree preview
  • Branch selector
  • Clone URLs (HTTP)
  • Stats (commits, contributors, stars)

File Browser

  • Directory tree navigation
  • File content with syntax highlighting
  • Breadcrumb navigation
  • Branch/tag selector
  • "Raw" and "History" links

Commit History

  • Commit list with author, date, message
  • Commit diff viewer
  • File changes summary

Pull Request View

  • PR description (Markdown)
  • Conversation thread
  • Commits included
  • Files changed with diff
  • Review status
  • Merge button (for admins)

Issue View

  • Issue description (Markdown)
  • Comment thread
  • Labels and assignees
  • Status (open/closed)
  • Close/reopen actions

Data Flow

Phase 1: Foundation (Completed)

  1. Create guts-web crate structure
  2. Set up Askama template engine
  3. Create base template with navigation
  4. Add static asset serving (CSS via Tailwind CDN)
  5. Implement landing page
  6. Implement explore/repository list page

Phase 2: Repository Browsing (Completed)

  1. Repository list page (/explore)
  2. Repository home page (README) (/{owner}/{repo})
  3. File tree browser (/{owner}/{repo}/tree/{ref}/*path)
  4. File content viewer with syntax highlighting (/{owner}/{repo}/blob/{ref}/*path)
  5. Commit history page (/{owner}/{repo}/commits/{ref})
  6. Single commit view (/{owner}/{repo}/commit/{sha})

Phase 3: Collaboration Views (Completed)

  1. Pull request list page (/{owner}/{repo}/pulls)
  2. Pull request detail page (/{owner}/{repo}/pull/{num})
  3. Issue list page (/{owner}/{repo}/issues)
  4. Issue detail page (/{owner}/{repo}/issues/{num})
  5. Comment rendering with markdown

Phase 4: Organization Views (Completed)

  1. User profile page (/users/{username})
  2. Organization list page (/orgs)
  3. Organization detail page (/orgs/{org})
  4. Team list page (/orgs/{org}/teams)
  5. Team detail page (/orgs/{org}/teams/{team})
  6. Navigation bar with Organizations link

Phase 5: Search & Discovery (Completed)

  1. Repository search (/search?q=&type=repositories)
  2. Code search (/search?q=&type=code)
  3. Issue/PR search (/search?q=&type=issues, /search?q=&type=pullrequests)
  4. Advanced filters (filter by result type, case-insensitive matching)

Phase 6: API Documentation (Completed)

  1. OpenAPI 3.1 spec generation (comprehensive coverage of all 50+ endpoints)
  2. Swagger UI integration (/api/docs)
  3. Interactive API explorer with try-it-out functionality

API Integration

The web gateway reuses existing API infrastructure:

Success Criteria

  • Landing page with repository explorer
  • Repository file browser with syntax highlighting
  • Commit history and diff viewer
  • Pull request and issue views
  • Organization and team pages
  • Code search functionality
  • Responsive design (mobile-friendly via Tailwind CSS)
  • No JavaScript required for core functionality (JS used only for syntax highlighting and Swagger UI)
  • Interactive API documentation with Swagger UI

Dependencies

  • askama: Template engine
  • pulldown-cmark: Markdown rendering
  • syntect: Server-side syntax highlighting (optional)
  • guts-storage: Access git objects
  • guts-collaboration: PR/Issue data
  • guts-auth: Permission checking

Future Considerations

These features are out of scope for Milestone 5 but planned:

  1. CI/CD Integration: Decentralized build pipelines
  2. Package Registry: Decentralized package hosting
  3. Federation: Inter-network repository bridging
  4. Real-time Updates: WebSocket for live updates
  5. Dark Mode: Theme switching
  6. Keyboard Shortcuts: Vim-style navigation
  7. Notifications: In-browser notifications

References