# AnyShip Deployment Playbook (For Developers & Coding Agents)

> Canonical URL: https://anyship.top/en/docs/deploy.md | Platform: https://anyship.top

## 1. Choosing the Right Artifact Format
- **Single-File HTML (`index.html`)**: Best for Vibe Coding tools, calculators, visualizations, and prototypes generated by Claude Artifacts, ChatGPT, or Cursor. Inline CSS/JS or load standard CDN assets; upload directly without zipping.
- **Static Site ZIP (`site.zip`)**: Must contain `index.html` at the archive root (or single top-level folder). Use relative asset paths (`./assets/...`) so the app works cleanly under `/projects/<slug>/`.
- **Frontend Framework ZIP (`Vite` / `React` / `Vue` / `Next.js`)**: Include `package.json` with a standard `build` script. AnyShip automatically builds inside an isolated Docker container and publishes the output directory (`dist/`, `build/`, or `out/`).

## 2. Subpath Safety Checklist (Important)
Hosted apps are served at `https://anyship.top/projects/<slug>/`. To prevent broken assets:
- **Vite**: Set `base: "./"` in `vite.config.js` / `vite.config.ts`.
- **React (CRA)**: Set `"homepage": "."` in `package.json`.
- **Next.js**: Configure `output: "export"` and relative paths or `assetPrefix: "./"`.
- **Plain HTML**: Reference scripts/styles with `./app.js` instead of `/app.js`.

## 3. Security & Validation Rules
- Symbolic links (`symlinks`) inside ZIP archives are rejected.
- Dangerous executable or server-side extensions (e.g. `.php`, `.sh`, `.exe`) are blocked.
- Guest deployments expire after 24 hours and remain private to the uploading browser session.
- Signed-in deployments persist indefinitely and can be toggled between Public (listed in `/store`) and Private.

## 4. Quick Packaging Command for Agents
```bash
# Package a Vite/React project excluding node_modules and .git
zip -r deploy.zip . -x "node_modules/*" ".git/*" ".env*" "dist/*"
```
