# 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. [x] Create `guts-web` crate structure 2. [x] Set up Askama template engine 3. [x] Create base template with navigation 4. [x] Add static asset serving (CSS via Tailwind CDN) 5. [x] Implement landing page 6. [x] Implement explore/repository list page ### Phase 2: Repository Browsing (Completed) 1. [x] Repository list page (`/explore`) 2. [x] Repository home page (README) (`/{owner}/{repo}`) 3. [x] File tree browser (`/{owner}/{repo}/tree/{ref}/*path`) 4. [x] File content viewer with syntax highlighting (`/{owner}/{repo}/blob/{ref}/*path`) 5. [x] Commit history page (`/{owner}/{repo}/commits/{ref}`) 6. [x] Single commit view (`/{owner}/{repo}/commit/{sha}`) ### Phase 3: Collaboration Views (Completed) 1. [x] Pull request list page (`/{owner}/{repo}/pulls`) 2. [x] Pull request detail page (`/{owner}/{repo}/pull/{num}`) 3. [x] Issue list page (`/{owner}/{repo}/issues`) 4. [x] Issue detail page (`/{owner}/{repo}/issues/{num}`) 5. [x] Comment rendering with markdown ### Phase 4: Organization Views (Completed) 1. [x] User profile page (`/users/{username}`) 2. [x] Organization list page (`/orgs`) 3. [x] Organization detail page (`/orgs/{org}`) 4. [x] Team list page (`/orgs/{org}/teams`) 5. [x] Team detail page (`/orgs/{org}/teams/{team}`) 6. [x] Navigation bar with Organizations link ### Phase 5: Search & Discovery (Completed) 1. [x] Repository search (`/search?q=&type=repositories`) 2. [x] Code search (`/search?q=&type=code`) 3. [x] Issue/PR search (`/search?q=&type=issues`, `/search?q=&type=pullrequests`) 4. [x] Advanced filters (filter by result type, case-insensitive matching) ### Phase 6: API Documentation (Completed) 1. [x] OpenAPI 3.1 spec generation (comprehensive coverage of all 50+ endpoints) 2. [x] Swagger UI integration (`/api/docs`) 3. [x] Interactive API explorer with try-it-out functionality ## API Integration The web gateway reuses existing API infrastructure: ## Success Criteria - [x] Landing page with repository explorer - [x] Repository file browser with syntax highlighting - [x] Commit history and diff viewer - [x] Pull request and issue views - [x] Organization and team pages - [x] Code search functionality - [x] Responsive design (mobile-friendly via Tailwind CSS) - [x] No JavaScript required for core functionality (JS used only for syntax highlighting and Swagger UI) - [x] 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 - [GitHub Web Interface](https://github.com) - [GitLab Web Interface](https://gitlab.com) - [Gitea](https://gitea.io) - Lightweight self-hosted - [Askama Documentation](https://djc.github.io/askama/)