# 🔧 PlugSnatcher

A powerful Minecraft plugin manager for server administrators.

## Features

- **Plugin Discovery**: Automatically detect installed plugins in your server
- **Update Management**: Keep your plugins up-to-date with minimal effort
- **Multi-Source Support**: Find plugins across HangarMC, SpigotMC, Modrinth, GitHub, and more
- **Plugin Intelligence**: Smart matching of plugins for accurate updates
- **Dark Mode**: Easy on the eyes for those late-night server maintenance sessions

## Development Status

PlugSnatcher is currently in early development (v0.1.0). Check our [ROADMAP.md](ROADMAP.md) for current progress and upcoming features.

## Setup

1. Install Rust: https://www.rust-lang.org/tools/install
2. Install Node.js and npm: https://nodejs.org/
3. Navigate to the PlugSnatcher directory:
   ```
   cd PlugSnatcher
   ```
4. Install dependencies:
   ```
   npm install
   ```
5. Run the development server:
   ```
   npm run tauri dev
   ```

## Building

```
cd PlugSnatcher
npm run tauri build
```

## Project Structure

- `PlugSnatcher/src/` - React frontend
- `PlugSnatcher/src-tauri/` - Rust backend
- `ROADMAP.md` - Development roadmap and progress

## Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

## License

[MIT](LICENSE)

---

Built with 💻 and ☕ using [Tauri](https://tauri.app/) and [React](https://reactjs.org/)

🔧 Minecraft Plugin Manager - Desktop App Spec Sheet
Codename: PlugSnatcher
Version: 0.1.0 (initial dev)
Target Platforms: Windows, Linux, macOS (Electron / Tauri)

🧠 Core Features
🔍 Plugin Discovery
Auto-detect server type: Paper, Spigot, Velocity, Bukkit

Locate /plugins/ folder based on selected server root

Parse installed .jar files

Extract plugin metadata:

Name

Version

Description

Authors

Website (from plugin.yml)

API version

Source URL (if embedded or in plugin.yml)

Fallback to hash-based identification (SHA256 of JAR)

🌐 Plugin Intelligence Web Crawler
Crawl and parse:

HangarMC

SpigotMC.org

Modrinth

GitHub releases + tags

CurseForge if you hate yourself

Smart matching:

Fuzzy match plugin name + author

Use plugin.yml metadata for confidence scoring

GitHub fallback for obscure shit

🔄 Update Management
Notify user of available updates

Changelog/commit messages when available

Prompt user to confirm update

Automatically replace .jar in /plugins/ directory

Optional plugin data backup (zip old plugin + config)

Restart server after update (optional checkbox)

🧰 Tech Stack
🖥️ Frontend
Tauri + Svelte/React (blazingly sexy and native AF)

Dark mode default (because we're not monsters)

🧠 Backend
Rust or Node.js for system access + networking

Plugin parser using:

ZIP extraction (JAR = ZIP) → plugin.yml

YAML parser

Web crawler/scraper:

Puppeteer/Playwright for JavaScript-heavy sites

Regex + HTML parser for faster sites

📦 Storage
Local SQLite DB or JSON for cache (plugin registry, version history)

Logs for updates, errors, changelogs

🛡️ Permissions & Security
Sandboxed (no outbound requests unless plugin sources are being queried)

All downloads via HTTPS

Optional SHA256 checksum verification

Download warning if unverified source (manual override possible)

🤖 Extra Features (Future Roadmap)
Plugin conflict checker (API version mismatches, dupe commands)

Compatibility checker for Minecraft versions

Server config backup + restore manager

Scheduled plugin update check (daily, weekly, etc.)

Rollback system (previous plugin version restore)

Plugin recommendation system based on existing server meta

Discord webhook for plugin update logs

🧪 Example Flow
User launches PlugSnatcher, selects server folder

App lists all plugins, shows current version vs latest

User clicks "Check for Updates"

App crawls the web like an info-hungry stalker

Update found → Prompt user

User says "ye" → Old plugin backed up, new one slotted in

Optional: Server restarts, all is good in blockyland

🧼 UX Expectations
Drag & drop server folder

Clear plugin list UI with version indicators

One-click updates with optional review

Update logs saved per session

Error messages that don't suck

👹 Known Challenges
Some plugins are unlisted or distributed on Discord/GitHub only

No consistent plugin metadata across sites (we'll brute force it)

API rate limits (user token support for GitHub)

## Configuration

### GitHub API Token (Optional)

To avoid GitHub API rate limits when checking for updates for plugins hosted on GitHub, you can provide a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-tokens).

1.  **Create a PAT:** Go to your GitHub settings > Developer settings > Personal access tokens > Tokens (classic). Generate a new token (classic). No specific scopes are required for reading public repository information.
2.  **Set Environment Variable:** Set the `GITHUB_API_TOKEN` environment variable to the value of your generated token before running PlugSnatcher.

   *   **Windows (PowerShell):**
       ```powershell
       $env:GITHUB_API_TOKEN="your_github_pat_here"
       npm run tauri dev
       ```
   *   **Windows (Command Prompt):**
       ```cmd
       set GITHUB_API_TOKEN=your_github_pat_here
       npm run tauri dev
       ```
   *   **Linux/macOS:**
       ```bash
       export GITHUB_API_TOKEN="your_github_pat_here"
       npm run tauri dev
       ```

If this environment variable is not set, PlugSnatcher will still attempt to check GitHub, but you may encounter `403 Forbidden` errors if you check many plugins frequently.

