Skip to content

Fast, modern SMB share file browser with rich instant previews for images, documents, and code. Responsive UI built for speed and ease of use.

Notifications You must be signed in to change notification settings

helgeklein/sambee

Repository files navigation

Sambee

Fast, modern SMB share file browser with rich instant previews for images, documents, and code. Responsive UI built for speed and ease of use.

Features

  • 🌐 Browser-based SMB share viewer
  • 📄 Rich file preview capabilities (starting with Markdown)
  • 🔒 Secure credential management
  • 🎨 Modern, responsive UI
  • 🐳 Easy deployment with Docker

Quick Start

Development with VS Code Dev Container

  1. Clone the repository:
git clone https://github.com/helgeklein/sambee.git
cd sambee
  1. Open in VS Code:
code .
  1. Reopen in Container when prompted (or use Command Palette: Remote-Containers: Reopen in Container)

  2. Start development servers:

# Backend (FastAPI)
cd backend && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

# Frontend (React + Vite)
cd frontend && npm run dev

Or use VS Code tasks: Ctrl+Shift+PTasks: Run Task

Production Deployment

docker compose up -d

Access the application at http://localhost

Architecture

  • Backend: FastAPI (Python 3.13)
  • Frontend: React 18 with TypeScript + Vite
  • Database: SQLite
  • SMB Library: smbprotocol

Development

See DEVELOPMENT.md for detailed development setup instructions.

Code Quality

Sambee uses Ruff for Python (backend) and Biome for TypeScript/JavaScript (frontend).

Check code quality (lint)

./scripts/lint

This runs:

  • Backend: ruff check and ruff format --check
  • Frontend: biome check

Auto-format code

./scripts/format

This runs:

  • Backend: ruff check --fix and ruff format
  • Frontend: biome check --write and biome format --write

Individual commands

Backend only:

cd backend
ruff check app              # Check for issues
ruff check --fix app        # Auto-fix issues
ruff format app             # Format code

Frontend only:

cd frontend
npm run lint                # Check for issues
npm run lint:fix            # Auto-fix issues
npm run format              # Format code

Logging & Debugging

Sambee includes comprehensive logging to help diagnose issues:

View Logs

# View all logs with status
/workspace/scripts/logs

# Show more lines
/workspace/scripts/logs -n 100

# Follow logs in real-time
/workspace/scripts/logs -f

# Or view individual logs
tail -f /tmp/backend.log
tail -f /tmp/frontend.log
tail -f /tmp/dev-start.log
tail -f /tmp/post-start.log

Log Files

  • /tmp/backend.log - FastAPI backend logs (includes startup, requests, errors)
  • /tmp/frontend.log - Vite frontend logs (includes build output, HMR)
  • /tmp/dev-start.log - Dev server startup logs
  • /tmp/post-start.log - Container post-start hook logs

Rotate Logs

If logs get too large:

/workspace/scripts/rotate-logs

This archives current logs and starts fresh files.

What's Logged

Backend:

  • Application startup/shutdown with timestamps
  • Database initialization
  • All HTTP requests with duration (e.g., → GET /api/browse - 200 (45.2ms))
  • SMB connection attempts and failures
  • Errors with full stack traces

Frontend:

  • Vite server startup
  • Build progress
  • Hot module replacement (HMR) updates
  • Build errors

Startup Scripts:

  • Post-start command execution
  • Dev server launch attempts
  • Process IDs and verification
  • Failure diagnostics with log tails

License

MIT

About

Fast, modern SMB share file browser with rich instant previews for images, documents, and code. Responsive UI built for speed and ease of use.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published