Local development
Set up a local development environment to customize hyAway for your needs.
TL;DR
- Start dev server:
pnpm installthenpnpm dev(http://localhost:3000) - Share to your LAN:
pnpm dev:host - Share to your tailnet:
pnpm dev:ts(Tailscale URL typically has no port)
Prerequisites
Quick start
# Clone the repository
git clone https://github.com/hyaway/hyaway.git
cd hyaway
# Install dependencies
pnpm install
# Start the dev server
pnpm devThe app will be available at http://localhost:3000
Available scripts
| Command | Description |
|---|---|
pnpm dev | Start dev server on port 3000 |
pnpm dev:host | Start dev server accessible from other devices |
pnpm build | Production build |
pnpm serve | Preview production build |
pnpm test | Run Vitest tests |
pnpm check | Format + lint fix |
pnpm typecheck | TypeScript check only |
pnpm storybook | Component playground on port 6006 |
Tailscale integration
pnpm dev:ts # Expose dev server via Tailscale Serve
pnpm dev:ts:off # Stop Tailscale Serve
pnpm ts:status # Check Tailscale Serve statusProject structure
src/
├── components/ # Shared components
│ ├── app-shell/ # Header, sidebar, layout
│ ├── file-detail/ # File viewer components
│ ├── page-shell/ # Page layout primitives
│ ├── settings/ # Settings controls
│ ├── tag/ # Tag components
│ ├── thumbnail-gallery/# Gallery components
│ └── ui-primitives/ # Base UI (shadcn/ui style)
├── hooks/ # Shared hooks
├── integrations/ # External integrations
│ ├── hydrus-api/ # Hydrus API client and queries
│ └── tanstack-query/ # Query client setup
├── lib/ # Utilities and stores
├── routes/ # File-based routing (TanStack Router)
└── stores/ # Zustand state storesTech stack
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| TypeScript | Type safety |
| TanStack Router | File-based routing |
| TanStack Query | Data fetching |
| Zustand | Client state management |
| Zod | Schema validation |
| Tailwind CSS v4 | Styling |
| Vite | Build tool |
Development workflow
Adding UI components
Use shadcn to add base UI primitives:
npx shadcn@latest add buttonComponents install to src/components/ui-primitives/.
Code quality
# Format and lint in one command
pnpm check
# Or run separately
pnpm format # Prettier
pnpm lint # ESLint
pnpm typecheck # TypeScriptTesting
pnpm test # Run once
pnpm test --watch # Watch modeStorybook
View and develop components in isolation:
pnpm storybookOpens at http://localhost:6006
Connecting to Hydrus
During development, connect to your Hydrus instance:
- Start Hydrus with the Client API enabled (see Getting started)
- Open http://localhost:3000/settings/connection
- Enter
http://127.0.0.1:45869as the endpoint - Request or enter an access key
Testing from other devices
To access the dev server from your phone or another device:
# Option 1: Network access (same WiFi)
pnpm dev:host
# Access at http://YOUR_IP:3000
# Option 2: Tailscale (any network)
pnpm dev:ts
# Access at https://your-machine.tail1234.ts.net:3000Building for production
# Build
pnpm build
# Preview the build locally
pnpm serveThe output is in the dist/ folder — static files you can deploy anywhere.
Testing with Docker
Test your production build in Docker:
pnpm build
pnpm docker:devThis runs nginx with your local dist/ folder mounted.
Documentation
The docs site (what you're reading now) is built with VitePress:
pnpm docs:dev # Start docs dev server
pnpm docs:build # Build docs
pnpm docs:preview # Preview built docsFeedback
Found a bug or have a feature request? Open an issue on GitHub.
Troubleshooting
Port 3000 already in use
Either stop the other process or use a different port:
pnpm dev -- --port 3001Hydrus connection issues
- Ensure Hydrus is running with the Client API enabled
- Check that CORS is enabled in Hydrus
- Verify the endpoint URL and port
TypeScript errors
pnpm typecheckFix any errors before committing.
Stale dependencies
# Clear and reinstall
rm -rf node_modules pnpm-lock.yaml
pnpm installNext steps
- Docker deployment — Deploy your customized build
- Connect to Hydrus — Full connection guide