Skip to content

NeuralEmpowerment/local-code-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Local Code Browser

A powerful desktop application for browsing, analyzing, and managing your local code projects. Built with Tauri (Rust + React) for fast performance and native desktop integration.

Local Code Browser Screenshot

Table of Contents

Features

πŸ” Project Discovery & Analysis

  • Automatic scanning of your code directories
  • Multi-language support (Python, Node.js, Rust, Java, Go, .NET, etc.)
  • Lines of Code (LOC) analysis with tokei integration
  • File size and project metrics tracking
  • Git repository detection and metadata

πŸ“Š Interactive Project Browser

  • Sortable columns with ascending/descending order
  • Real-time search and filtering
  • Pagination with customizable page sizes (100, 250, 500, 1000)
  • Total project count display
  • Last edit date tracking with human-readable formatting

πŸš€ Editor Integration

  • One-click project opening in your favorite editors
  • Windsurf integration (windsurf <path>)
  • Cursor integration (cursor <path>)
  • Fallback to clipboard if editor not found

πŸ’« Modern UI/UX

  • Professional dark theme with zinc color palette
  • Responsive layout with fixed header/footer
  • Loading indicators with animated spinners
  • Human-readable file sizes (B, KB, MB, GB, TB)
  • Relative date formatting (Today, Yesterday, 3d ago, etc.)

Installation

Choose from multiple installation methods:

πŸš€ Option 1: Pre-built Releases (Recommended)

Download the latest release from GitHub for your platform:

Installation Steps:

  1. Download the appropriate file for your operating system
  2. macOS: Open the .dmg file and drag Project Browser.app to your Applications folder
  3. Windows: Run the .msi installer
  4. Linux: Install the .deb package with your package manager
  5. Launch the application from your applications menu or desktop

πŸ› οΈ Option 2: Development Build

Perfect for developers who want to contribute or customize the application.

Prerequisites

  • Rust (latest stable)
  • Node.js (v16+)
  • npm or yarn

πŸš€ Quickstart

Get up and running in just three commands:

# Clone the repository
git clone https://github.com/NeuralEmpowerment/local-code-browser.git
cd local-code-browser

# 1. Setup development environment
make setup

# 2. Build the application
make build

# 3. Run the application
make run

That's it! The application will launch with all analysis features enabled.

πŸ”§ Option 3: CI/CD Pipeline & Automated Releases

This project includes automated building and releases via GitHub Actions.

Automated Release Process

When a new version tag is pushed to the repository:

# Create and push a new version tag
git tag v0.1.5
git push origin v0.1.5

The CI/CD pipeline will automatically:

  1. Build the application for macOS, Windows, and Linux
  2. Create platform-specific installers (.dmg, .msi, .deb)
  3. Sign the applications with proper certificates
  4. Upload release assets to GitHub Releases
  5. Generate checksums for security verification

CI/CD Configuration

The build pipeline (.github/workflows/release.yml) handles:

  • Multi-platform builds using GitHub Actions runners
  • Code signing with platform-specific certificates
  • Automated testing before release
  • Release notes generation
  • Asset upload to GitHub Releases

Manual Release Build

To build releases locally:

# Build for current platform
cargo tauri build --release

# Build for all platforms (requires cross-compilation setup)
cargo tauri build --release --target all

Release Script

Use the automated release script for easy version management:

# Make executable and run
chmod +x scripts/release.sh
./scripts/release.sh

# Follow the prompts to create a new version release
# This will update versions, commit, tag, and trigger CI/CD

Usage

πŸ–₯️ Desktop Application

  1. Launch the app:

    make tauri-run-analyzed
  2. Scan your projects:

    • Click the "Scan" button to discover projects
    • Default scan location: $HOME/Code
    • Scans recursively for project files
  3. Browse and sort:

    • Click any column header to sort (Name, Type, Size, LOC, Last Edit)
    • Click again to reverse sort direction
    • Use the search box to filter projects
  4. Adjust view:

    • Select page size (100, 250, 500, 1000 items)
    • Navigate with Previous/Next buttons
    • View total project count in footer
  5. Open projects:

    • Click any project path to open "Open In..." modal
    • Choose Windsurf or Cursor to launch editor
    • Project opens directly in your chosen editor

πŸ–±οΈ CLI Interface

# Scan projects
make run-scan

# List projects (basic)
make run-list

# List projects with analysis
make run-list-analyzed

# Show database path
make db-path

# Run full QA pipeline
make qa

Advanced CLI Options:

# Scan with custom roots
cargo run -p cli -- scan --root /path/to/projects --root /another/path

# Dry run (preview without writing to DB)
cargo run -p cli -- scan --dry-run

# List with JSON output
cargo run -p cli -- list --json --limit 100

# List with different sort options
cargo run -p cli -- list --sort name --limit 50
cargo run -p cli -- list --sort recent --limit 20
cargo run -p cli -- list --sort loc --limit 100 --show-loc

# Configuration commands
cargo run -p cli -- config --print          # Show effective config
cargo run -p cli -- config --db-path        # Show database path

βš™οΈ Configuration

Config File Location

Default configuration is stored at:

  • macOS: ~/Library/Application Support/ProjectBrowser/config.json

Configuration Options

{
  "roots": ["~/Code"],                    // Directories to scan
  "global_ignores": [                      // Additional ignore patterns
    ".git", "node_modules", "target", 
    "build", "dist", ".venv", "Pods", 
    "DerivedData", ".cache"
  ],
  "size_mode": "exact_cached",           // File size calculation mode
  "concurrency": 8,                       // Worker tasks count
  "git.use_cli_fallback": false           // Use git CLI if git2 fails
}

Ignore Precedence

The scanner follows this precedence for ignore patterns:

  1. Repository .gitignore files
  2. App global_ignores configuration
  3. User ignore files (if present):
    • ~/Library/Application Support/ProjectBrowser/ignore
    • ~/.config/project-browser/ignore (legacy)

Configuration Commands

# Show effective configuration
cargo run -p cli -- config --print

# Show database path
cargo run -p cli -- config --db-path

# Preview scan without writing to database
cargo run -p cli -- scan --dry-run

Project Detection

The scanner automatically detects projects by looking for these files:

  • Python projects: pyproject.toml, requirements.txt
  • Node.js projects: package.json
  • Rust projects: Cargo.toml
  • Java projects: pom.xml, build.gradle, gradlew
  • Go projects: go.mod
  • .NET projects: global.json, *.csproj
  • Git repositories: .git directories

Development

πŸ”„ CI/CD Workflows

This project includes automated testing and release workflows:

Pull Request Validation (.github/workflows/ci.yml)

  • Code formatting checks with cargo fmt
  • Linting with cargo clippy
  • Testing with cargo test
  • Frontend linting and testing
  • Multi-platform builds for macOS, Linux, and Windows

Automated Releases (.github/workflows/release.yml)

  • Triggered on version tags (e.g., v1.2.3)
  • Multi-platform builds for distribution
  • Automatic uploads to GitHub Releases
  • Release notes generation

πŸ› οΈ Available Commands

# Development
make setup          # Install Rust components
make build          # Build the workspace
make qa             # Run full QA pipeline

# Desktop App
make tauri-run              # Run Tauri app
make tauri-run-analyzed     # Run with analysis features

# Web Frontend
make web-dev        # Start development server
make web-build      # Build for production
make web-preview    # Preview built frontend

# CLI Tools
make run-scan       # Scan projects
make run-list       # List projects
make run-scan-analyzed      # Scan with analysis
make run-list-analyzed      # List with LOC info

# Code Quality
make fmt            # Check formatting
make fmt-fix        # Auto-format code
make lint           # Run clippy linter
make test           # Run tests
make clean          # Clean build artifacts

πŸ“ Project Structure

local-code-browser/
β”œβ”€β”€ src-tauri/              # Tauri backend (Rust)
β”‚   β”œβ”€β”€ src/main.rs         # Main application logic
β”‚   β”œβ”€β”€ Cargo.toml          # Rust dependencies
β”‚   └── tauri.conf.json     # Tauri configuration
β”œβ”€β”€ web/                    # Frontend (React + TypeScript)
β”‚   β”œβ”€β”€ src/ui/App.tsx      # Main UI component
β”‚   β”œβ”€β”€ package.json        # Node.js dependencies
β”‚   └── vite.config.ts      # Vite configuration
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ indexer/            # Core indexing logic
β”‚   └── cli/                # Command-line interface
β”œβ”€β”€ Makefile                # Build automation
└── README.md               # This file

πŸ”§ Architecture

Workspace Structure

The project uses a Cargo workspace structure for better code organization:

local-code-browser/
β”œβ”€β”€ Cargo.toml              # Workspace definition
β”œβ”€β”€ crates/                 # Rust crates
β”‚   β”œβ”€β”€ indexer/           # Core indexing logic
β”‚   β”‚   β”œβ”€β”€ lib.rs         # Main library interface
β”‚   β”‚   β”œβ”€β”€ scan.rs        # Directory scanning
β”‚   β”‚   β”œβ”€β”€ db.rs          # Database operations
β”‚   β”‚   β”œβ”€β”€ detect.rs      # Project type detection
β”‚   β”‚   β”œβ”€β”€ config.rs      # Configuration management
β”‚   β”‚   β”œβ”€β”€ vcs.rs         # Version control (git)
β”‚   β”‚   └── analyzers.rs   # Code analysis (LOC)
β”‚   └── cli/               # Command-line interface
β”‚       └── main.rs        # CLI entry point
β”œβ”€β”€ src-tauri/             # Tauri desktop app
β”‚   β”œβ”€β”€ src/main.rs        # Tauri backend
β”‚   └── Cargo.toml         # Tauri dependencies
β”œβ”€β”€ web/                   # Frontend (React + TypeScript)
β”‚   β”œβ”€β”€ src/ui/App.tsx     # Main UI component
β”‚   └── package.json       # Node.js dependencies
└── Makefile               # Build automation

Feature Flags

The application supports optional features for conditional compilation:

  • git: Enables Git repository detection and metadata

    • Adds git2 dependency
    • Enables vcs module in indexer
    • Provides git status information
  • analyzers: Enables code analysis features

    • Adds tokei dependency for Lines of Code counting
    • Enables analyzers module in indexer
    • Provides per-language LOC breakdowns

Technology Stack

  • Backend: Rust with Tauri v2 for native desktop integration
  • Frontend: React 18 with TypeScript and Tailwind CSS
  • Database: SQLite with Rusqlite for project metadata storage
  • Analysis: Tokei v12 for lines of code counting (optional)
  • Build: Vite for fast frontend bundling
  • UI Components: React Window for virtualized scrolling
  • Styling: Tailwind CSS with zinc color palette

Key Dependencies

# Core
anyhow = "1"          # Error handling
serde = { version = "1", features = ["derive"] }  # Serialization
tracing = "0.1"       # Structured logging

# Database
rusqlite = "0.31"     # SQLite with bundled version

# Optional features
git2 = "0.18"         # Git integration (optional)
tokei = "12"          # Code analysis (optional)

# Frontend
react = "^18.3.1"     # UI framework
tauri = "^2.0.0"      # Desktop framework

Troubleshooting

Editor Integration Issues

If Windsurf or Cursor don't open:

  1. Check if editor is installed:

    which windsurf
    which cursor
  2. Add to PATH if needed:

    # For Windsurf
    export PATH="/Applications/Windsurf.app/Contents/Resources/app/bin:$PATH"
    
    # For Cursor
    export PATH="/Applications/Cursor.app/Contents/Resources/app/bin:$PATH"
  3. Fallback: Commands are copied to clipboard if editor not found

Performance Tips

  • Use page size 500 (default) for best performance
  • Scan periodically to keep project data fresh
  • Use search/filter for large project collections

Contributing

Creating Releases

To create a new release:

  1. Update version in all relevant files (use the release script)
  2. Test thoroughly with make qa
  3. Create a pull request for the version bump
  4. After merging, create a version tag to trigger automated release:
git tag v1.2.3
git push origin v1.2.3

The CI/CD pipeline will automatically build and publish releases to GitHub.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Run make qa to ensure code quality
  4. Submit a pull request

License

MIT


Built with ❀️ using Tauri, Rust, and React

About

Tauri desktop app to browse local coding project directories.

Resources

License

Stars

Watchers

Forks

Packages

No packages published