A modern React application for exploring and managing Bitbucket repositories and their branches. Built with TypeScript, Vite, and Tailwind CSS, this tool provides an intuitive interface to visualize branches across multiple repositories in your Bitbucket workspace.
- π’ Multi-Repository Support: Browse all repositories in your Bitbucket workspace
- π Routing & Navigation: Direct URLs for repositories with React Router integration
- π₯ Branch Grouping: Organize branches by author across all repositories
- π Advanced Search: Search across branches, repositories, and contributors
- β‘ Performance Optimized: Built-in caching and rate limiting for Bitbucket API
- π¨ Modern UI: Clean, responsive design with shadcn/ui components
- π Dark Mode: Seamless light/dark theme switching
- π± Mobile Responsive: Optimized for all device sizes
- Node.js 18+
- pnpm (recommended) or npm
- Bitbucket workspace access with Access Token
-
Clone the repository
git clone https://github.com/jessedubbink/bitbucket-branch-discovery.git cd bitbucket-branch-discovery -
Install dependencies
pnpm install # or npm install -
Configure Bitbucket access
Copy the example environment file:
cp .env.example .env
Edit
.envwith your Bitbucket credentials:VITE_BITBUCKET_WORKSPACE=your-workspace-name VITE_BITBUCKET_ACCESS_TOKEN=your-access-token
-
Start the development server
pnpm dev # or npm run dev -
Open your browser
Navigate to
http://localhost:5173
- Go to your Bitbucket workspace settings
- Navigate to Access tokens under Access management
- Click Create access token
- Give it a descriptive name (e.g., "Branch Discovery Tool")
- Select the following permissions:
- Repositories: Read
- Account: Read
- Copy the generated password - you won't see it again!
Environment Variables
- Set
VITE_BITBUCKET_WORKSPACEandVITE_BITBUCKET_ACCESS_TOKENin your.envfile - The app will automatically use these credentials
src/
βββ components/ # React components (organized by feature)
β βββ ui/ # Reusable UI components (shadcn/ui)
β βββ layout/ # Layout & navigation components
β β βββ Layout.tsx # Main app layout with header & sidebar
β β βββ NavBar.tsx # Top navigation bar
β β βββ RepositorySidebar.tsx # Repository navigation sidebar
β β βββ index.ts # Export barrel
β βββ features/ # Feature-specific components
β β βββ branches/ # Branch-related functionality
β β β βββ BranchGroup.tsx # Branch grouping and display
β β β βββ UserBranchGroup.tsx # User-specific branch groups
β β β βββ index.ts # Export barrel
β β βββ search/ # Search functionality
β β βββ SearchBar.tsx # Search interface component
β β βββ index.ts # Export barrel
β βββ common/ # Shared/reusable components
β β βββ ErrorState.tsx # Error handling UI
β β βββ LoadingState.tsx # Loading indicators & skeletons
β β βββ NotFound.tsx # 404 page component
β β βββ ThemeProvider.tsx # Theme context provider
β β βββ ThemeSwitch.tsx # Theme toggle component
β β βββ index.ts # Export barrel
β βββ views/ # Page/view components
β βββ BranchesView.tsx # All branches overview page
β βββ RepositoryView.tsx # Single repository detail page
β βββ index.ts # Export barrel
βββ hooks/ # Custom React hooks
β βββ useBitbucketData.ts # Main data fetching & caching hook
β βββ use-mobile.tsx # Mobile detection utility
βββ services/ # API services
β βββ bitbucketApi.ts # Bitbucket API client with rate limiting
βββ types/ # TypeScript definitions
β βββ bitbucket.ts # Bitbucket API response types
βββ lib/ # Utilities
β βββ utils.ts # Helper functions (localStorage, etc.)
βββ App.tsx # Main application component
βββ router.tsx # React Router configuration
βββ main.tsx # Application entry point
# Development
pnpm dev # Start development server
pnpm build # Build for production
pnpm preview # Preview production build
pnpm lint # Run ESLint
# Using npm
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint- React 18 - UI library with modern hooks
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing for SPA navigation
- Radix UI - Accessible component primitives
- shadcn/ui - Pre-built component library
- Lucide React - Beautiful icon library
- Sonner - Toast notifications
- date-fns - Modern date utility library
- ESLint - Code linting
- PostCSS - CSS processing
- Autoprefixer - CSS vendor prefixes
- LocalStorage Caching: API responses cached in browser storage for 5 minutes
- Rate Limiting: Built-in protection against API rate limits
- Retry Logic: Automatic retry with exponential backoff
- Request Deduplication: Prevents duplicate API calls
- useCallback: Memoized functions to prevent unnecessary re-renders
- useMemo: Cached computed values for better performance
- Code Splitting: Optimized bundle loading
- Component Architecture: Feature-based organization for maintainability
- Routing: Direct URLs for repositories with React Router
- 404 Handling: Custom not-found pages with helpful navigation
- Loading States: Skeleton loading for better perceived performance
- Search Performance: Debounced search across multiple data sources
The application features a modern routing system that enables:
- Home:
/- Overview of all repositories and branches - Repository View:
/repository/{repo-name}- Detailed view of specific repository - Branches View:
/branches- All branches across repositories grouped by author - 404 Page:
*- Custom not-found page for invalid routes
- Direct Repository Links: Share URLs to specific repositories
- Sidebar Navigation: Persistent repository sidebar on all pages
- Breadcrumb Navigation: Clear back navigation with visual indicators
- Deep Linking: Bookmark and share specific repository views
The application integrates with the Bitbucket REST API v2:
- Repositories: Fetches all repositories in the workspace
- Branches: Retrieves branch information for each repository
- Authors: Groups branches by commit author with avatar support
- Metadata: Includes commit dates, branch names, author info, and repository details
- LocalStorage: Persistent caching across browser sessions
- Cache Keys: Workspace-specific cache isolation
- TTL: 5-minute cache expiration for fresh data
- Cache Management: Manual refresh capability with cache clearing
- Respects Bitbucket API rate limits
- Automatic retry with exponential backoff
- Request queuing to prevent API abuse
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
"Authentication failed"
- Verify your App Password has the correct permissions
- Check that your workspace name is correct
- Ensure the access token is properly set
"No repositories found"
- Confirm you have access to repositories in the workspace
- Check if the workspace name is spelled correctly
- Verify the App Password has "Repositories: Read" permission
Rate limit errors
- The app automatically handles rate limits with retry logic
- If you hit limits frequently, consider reducing the refresh frequency
- Check the Issues page
- Create a new issue with detailed information about your problem
- Include browser console errors
- shadcn/ui for the beautiful component library
- Radix UI for accessible primitives
- Lucide for the icon set
- Bitbucket API for the data access
Made with β€οΈ by Jesse Dubbink