# The Hugging Bay 🏴‍☠️ A Pirate-Bay-flavoured index for AI models, weights, datasets, papers... and honestly anything you can wrap in a `.torrent`. Files are never hosted — the app parses the metadata, pulls the info-hash, and publishes magnet links. ## Original Insipration from a meme I found on twitter Original mock up: ![TwitterMockup](https://github.com/DrMaxis/the-hugging-bay/blob/main/image.png) My screenshots are at the bottom. (I know the svg/logo is not the same as the mock up. I tried to use ai for it but... it didnt work out.) ## Disclaimer - This app is a proof of concept. It is fully functional but in order to actually go live you not only need to deploy it like any other web application, but you also should consider the legal issues and the security (protecting yourelf, and the users). I built this for fun after seeing the meme thrown around twitter for the past week or so. This puts you probably 70-80% of the way there. The remaining 20-30% is all yours. Good luck, have fun! ## Stack | Layer | Choice | | -------------- | -------------------------------------------------- | | Language | PHP 8.3, TypeScript 5, Vue 3 | | Framework | Laravel 12, InertiaJS v2, Tailwind 3, Vite 5 | | Auth | Session (web guard) + Spatie Permission | | Database | Postgres via Sail (in-memory SQLite for tests) | | Realtime | Reverb + Laravel Echo + pusher-js | | Routing | Wayfinder (typed action helpers on the frontend) | | Static tooling | Rector (php83 + Laravel level-up), Pint, `vue-tsc` | | Testing | Pest 4, `RefreshDatabase`, parallel by default | ## Getting Started ### Prerequisites - **PHP**: 8.3+ - **Composer**: 2.x - **Node.js**: v20+ - **pnpm**: v9+ - **Docker Desktop** - **homebrew** (this is a mac world) - [**zsh**](https://www.zsh.org/) > If you're on Windows, you'll need WSL. Get Docker Desktop, open your editor/terminal under the WSL context, and run everything from there. ### Installation 1. Clone the repository ```bash git clone cd the-hugging-bay ``` 2. Copy the env file and boot Sail ```bash cp .env.example .env composer install ./vendor/bin/sail up -d ``` 3. Install deps, generate the key, migrate + seed ```bash ./vendor/bin/sail composer install ./vendor/bin/sail artisan key:generate ./vendor/bin/sail artisan migrate:fresh --seed pnpm install ``` 4. Optionally alias Sail so you can drop `./vendor/bin/` from every command ```bash alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' ``` 5. Run the frontend dev script to watch for local updates ```bash pnpm dev ``` 6. Visit [http://localhost](http://localhost) and you should see everything working. Seeded logins: ``` admin@hugging.bay / password → admin role test@example.com / password → user role ``` The seeder also drops in six trust-tier crew (`CaptainHug`, `SeaLLM`, `VectorJack`, …) across vip / trusted / moderator / helper, plus 25 factory torrents attributed to random crew. ### Realtime with Reverb Reverb runs as a separate process. Fire it up in another tab: ```bash sail artisan reverb:start --host=0.0.0.0 --port=8080 ``` Upload a torrent from one tab and any other open tab gets a `[~~] New upload …` toast at the top of the screen. Set `BROADCAST_CONNECTION=null` in `.env` if you want to skip Reverb entirely. Tests already do this. ## Common commands | Task | Command | | ----------------------- | ---------------------------------------------- | | Run tests | `sail artisan test --parallel` | | Filter tests | `sail artisan test --filter=browses` | | Format PHP | `sail composer lint:fix` | | Rector dry-run | `sail composer refactor` | | Rector apply | `sail composer refactor:fix` | | Type-check + build Vue | `sail npm run build` | | Re-seed clean | `sail artisan migrate:fresh --seed` | | Scrape trackers (sync) | `sail artisan hb:scrape-torrents --sync` | ## Environment knobs - `HB_REQUIRE_EMAIL_VERIFICATION=false` — bypass the verify-email gate on uploads. - `HB_SEED_TORRENTS=25` — how many factory torrents the seeder produces. - `BROADCAST_CONNECTION=reverb` — set to `null` to disable realtime. ## Contributing A number of code style and quality checks are enabled — please run them before pushing. - PHP formatting: `sail composer lint:fix` - PHP refactor pass: `sail composer refactor` (dry-run) / `sail composer refactor:fix` - Vue type-check: `sail npm run build` (runs `vue-tsc --noEmit`) - Tests: `sail artisan test --parallel` Routes should be typed via Wayfinder on the Vue side — don't hand-write URLs when a generated action helper exists. Permissions live in `PermissionSeeder`; guard new routes with `->can('your.permission')` rather than `hasRole('admin')`. ## Screenshots - ![Homepage](https://github.com/DrMaxis/the-hugging-bay/blob/main/screenshots/home.png) - ![Search](https://github.com/DrMaxis/the-hugging-bay/blob/main/screenshots/search.png) - ![Show](https://github.com/DrMaxis/the-hugging-bay/blob/main/screenshots/show.png) - ![Upload](https://github.com/DrMaxis/the-hugging-bay/blob/main/screenshots/upload.png) - ![Admin](https://github.com/DrMaxis/the-hugging-bay/blob/main/screenshots/admin.png)